Add explicit credential configuration for S3 archiver #8781
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
This PR adds explicit credential configuration support to the S3 archiver, enabling easier use with non-AWS S3-compatible object stores like MinIO, Wasabi, DigitalOcean Spaces, etc.
Problem
Currently, the S3 archiver relies solely on AWS SDK's default credential chain (environment variables,
~/.aws/credentials, IAM roles, etc.). This makes it difficult to:Solution
Following the existing Elasticsearch AWS request signing pattern, this PR adds three credential provider options:
When
credentialProvideris not specified, it defaults toaws-sdk-default, ensuring full backward compatibility with existing configurations.Configuration Examples
Static Credentials
Static Credentials with STS Token
Environment Credentials
Backward Compatible (Unchanged)
Changes
CredentialProviderandStaticfields toS3Archiverconfigcommon/archiver/s3store/aws_credentials.go- Credential provider logiccommon/archiver/s3store/aws_credentials_test.go- Comprehensive unit testshistory_archiver.go- Uses newcreateS3Session()helpervisibility_archiver.go- Uses newcreateS3Session()helperTesting
✅ All existing tests pass
✅ 13 new unit tests covering:
Backward Compatibility
This change is fully backward compatible. Existing configurations without
credentialProviderwill continue to work exactly as before, using the AWS SDK's default credential chain.