Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Profile field for Fluent bit S3 output #1127

Merged
merged 2 commits into from
Apr 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion apis/fluentbit/v1alpha2/plugins/output/s3_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,9 @@ type S3 struct {
// Integer value to set the maximum number of retries allowed.
RetryLimit *int32 `json:"RetryLimit,omitempty"`
// Specify an external ID for the STS API, can be used with the role_arn parameter if your role requires an external ID.
ExternalId string `json:"ExternalId,omitempty"`
ExternalId string `json:"ExternalId,omitempty"`
// Option to specify an AWS Profile for credentials.
Profile string `json:"Profile,omitempty"`
*plugins.TLS `json:"tls,omitempty"`
}

Expand Down Expand Up @@ -154,6 +156,9 @@ func (o *S3) Params(sl plugins.SecretLoader) (*params.KVs, error) {
if o.ExternalId != "" {
kvs.Insert("external_id", o.ExternalId)
}
if o.Profile != "" {
kvs.Insert("profile", o.Profile)
}
if o.TLS != nil {
tls, err := o.TLS.Params(sl)
if err != nil {
Expand Down
2 changes: 2 additions & 0 deletions apis/fluentbit/v1alpha2/plugins/output/s3_types_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ func TestOutput_S3_Params(t *testing.T) {
StorageClass: "storage_class",
RetryLimit: ptrAny(int32(1)),
ExternalId: "external_id",
Profile: "my-profile",
}

expected := params.NewKVs()
Expand Down Expand Up @@ -69,6 +70,7 @@ func TestOutput_S3_Params(t *testing.T) {
expected.Insert("storage_class", "storage_class")
expected.Insert("retry_limit", "1")
expected.Insert("external_id", "external_id")
expected.Insert("profile", "my-profile")

kvs, err := s3.Params(sl)
g.Expect(err).NotTo(HaveOccurred())
Expand Down
Loading