Skip to content

Commit d9594c5

Browse files
authored
S3 plugin auth (#90)
* S3 plugin auth - [x] arn role credentials support - [x] instance profile support * - [x] Readme update
1 parent 9e78bf3 commit d9594c5

File tree

3 files changed

+41
-3
lines changed

3 files changed

+41
-3
lines changed

README.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -83,13 +83,14 @@ $ helm install banzaicloud-stable/logging-operator
8383
```
8484

8585

86-
#### Install S3 output Plugin chart
86+
#### Install S3 output Plugin chart with Aws Credential Access
8787
```bash
8888
$ helm install \
8989
--set bucketName='<Mybucket>' \
9090
--set region='<S3_REGION>' \
91-
--set secret.awsAccessValue='<AWS_ACCESS_KEY_ID>' \
92-
--set secret.awsSecretValue='<AWS_SECRET_ACCESS_KEY>' \
91+
--set awsCredentialsAccess.enabled=true \
92+
--set awsCredentialsAccess.secret.awsAccessValue='<AWS_ACCESS_KEY_ID>' \
93+
--set awsCredentialsAccess.secret.awsSecretValue='<AWS_SECRET_ACCESS_KEY>' \
9394
banzaicloud-stable/s3-output
9495
```
9596

docs/plugins/s3.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,10 @@
33
| Variable name | Default | Applied function |
44
|---|---|---|
55
| pattern | - | |
6+
| role_arn | - | |
7+
| role_session_name | - | |
8+
| instance_profile_ip_address | - | |
9+
| instance_profile_port | - | |
610
| aws_key_id | - | |
711
| aws_sec_key | - | |
812
| s3_bucket | - | |
@@ -18,8 +22,25 @@
1822
<match {{ .pattern }}.** >
1923
@type s3
2024
25+
{{- if .role_arn }}
26+
<assume_role_credentials>
27+
role_arn {{ .role_arn }}
28+
role_session_name {{ .role_session_name }}
29+
</assume_role_credentials>
30+
{{- end }}
31+
32+
{{- if .instance_profile_ip_address }}
33+
<instance_profile_credentials>
34+
ip_address {{ .instance_profile_ip_address }}
35+
port {{ .instance_profile_port }}
36+
</instance_profile_credentials>
37+
{{- end }}
38+
39+
{{- if .aws_key_id }}
2140
aws_key_id {{ .aws_key_id }}
2241
aws_sec_key {{ .aws_sec_key }}
42+
{{- end }}
43+
2344
s3_bucket {{ .s3_bucket }}
2445
s3_region {{ .s3_region }}
2546
{{- if .s3_endpoint }}

pkg/resources/plugins/s3.go

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,24 @@ const S3Template = `
3434
<match {{ .pattern }}.** >
3535
@type s3
3636
37+
{{- if .role_arn }}
38+
<assume_role_credentials>
39+
role_arn {{ .role_arn }}
40+
role_session_name {{ .role_session_name }}
41+
</assume_role_credentials>
42+
{{- end }}
43+
44+
{{- if .instance_profile_ip_address }}
45+
<instance_profile_credentials>
46+
ip_address {{ .instance_profile_ip_address }}
47+
port {{ .instance_profile_port }}
48+
</instance_profile_credentials>
49+
{{- end }}
50+
51+
{{- if .aws_key_id }}
3752
aws_key_id {{ .aws_key_id }}
3853
aws_sec_key {{ .aws_sec_key }}
54+
{{- end }}
3955
s3_bucket {{ .s3_bucket }}
4056
s3_region {{ .s3_region }}
4157
{{- if .s3_endpoint }}

0 commit comments

Comments
 (0)