UID2-4739: use DefaultCredentialsProvider for S3 clients in CloudStorageS3#613
Open
sophia-chen-ttd wants to merge 2 commits into
Open
UID2-4739: use DefaultCredentialsProvider for S3 clients in CloudStorageS3#613sophia-chen-ttd wants to merge 2 commits into
sophia-chen-ttd wants to merge 2 commits into
Conversation
…ageS3 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
sophia-chen-ttd
commented
Jun 4, 2026
Contributor
Author
sophia-chen-ttd
left a comment
There was a problem hiding this comment.
The swap to DefaultCredentialsProvider is the correct direction: it supports IRSA (WebIdentityTokenFile), EKS Pod Identity (container credentials endpoint), instance profile, and all other standard chain entries transparently. The old comment's 'unknown reason' failure was almost certainly an early AWS SDK v2 version that predated reliable IRSA support in the default chain — the PR's explanation is credible. The change is minimal and low-risk, but removal of the historical warning, lack of credential test coverage, and resource-lifecycle subtleties are worth calling out.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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
CloudStorageS3explicitly constructedWebIdentityTokenFileCredentialsProvider, readingAWS_ROLE_ARNandAWS_WEB_IDENTITY_TOKEN_FILEenv vars directly — tying it hard to OIDC/IRSADefaultCredentialsProvider.create(), which automatically resolves credentials via the standard AWS SDK credential chain (IRSA, EKS Pod Identity, instance profiles, env vars, etc.)AWS_WEB_IDENTITY_TOKEN_FILEenv var read is removed as it was only used to construct the old providerWhy
WebIdentityTokenFileCredentialsProvideronly works with IRSA (OIDC-based service account annotation). With EKS Pod Identity (the newer, preferred mechanism), credentials are injected differently and this explicit provider will fail to pick them up.DefaultCredentialsProviderhandles both IRSA and EKS Pod Identity transparently, and will continue to work with any future AWS credential mechanism without code changes.The original code contained this comment (now removed):
This failure was most likely caused by an old AWS SDK v2 version that did not fully auto-detect IRSA credentials via the default chain. Early SDK v2 releases had gaps in
WebIdentityTokenCredentialsProviderauto-detection, requiring explicit construction from env vars. This was a known SDK issue fixed in later versions.Modern AWS SDK v2 includes
WebIdentityTokenCredentialsProviderin the default chain and detectsAWS_WEB_IDENTITY_TOKEN_FILEautomatically.DefaultCredentialsProvideralso handles EKS Pod Identity via the container credentials endpoint (AWS_CONTAINER_CREDENTIALS_FULL_URI).This change must be explicitly tested in a non-prod EKS environment before merging — the historical comment is a warning that this code path failed silently once. Do not assume the theoretical fix works without verification.
Test plan
mvn test)DefaultCredentialsProviderstill picks up IRSA env vars via itsWebIdentityTokenCredentialsProviderstep in the chain)🤖 Generated with Claude Code