feat(services/s3): add container credentials support for ECS and EKS #6525
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 comprehensive support for AWS container credentials used in ECS tasks and EKS pods, enabling OpenDAL to seamlessly work in containerized AWS environments. The implementation leverages reqsign's
ECSCredentialProvider
to provide robust credential handling.Background
Container credentials are essential for AWS workloads running in ECS and EKS:
This feature addresses issue #6456 and replaces the previous placeholder implementation with a complete solution based on reqsign's proven credential provider.
Implementation
Integration with reqsign's ECSCredentialProvider
The implementation directly uses reqsign's
ECSCredentialProvider
, which provides:New Configuration Fields
container_credentials_relative_uri
aws_container_credentials_relative_uri
container_credentials_endpoint
aws_container_credentials_full_uri
,container_credentials_full_uri
container_authorization_token
aws_container_authorization_token
container_authorization_token_file
aws_container_authorization_token_file
container_metadata_uri_override
aws_container_metadata_uri_override
Builder Methods
Added corresponding builder methods for programmatic configuration:
container_credentials_relative_uri(uri: &str)
container_credentials_endpoint(endpoint: &str)
container_authorization_token(token: &str)
container_authorization_token_file(file: &str)
container_metadata_uri_override(uri: &str)
Example Usage
JSON Configuration
Implementation Details
Architecture Changes
ECSCredentialProvider
in the build process usingcustomized_credential_load()
Key Features
ECSCredentialProvider
Design Decisions
Testing
Dependencies
This implementation depends on reqsign's
ECSCredentialProvider
which is currently under review in Xuanwo/reqsign#598. The code is ready and will work once that dependency is merged.Compatibility
This change is fully backward compatible. Existing configurations continue to work unchanged, with new fields providing additional flexibility for containerized environments.
Fixes #6456