Skip to content
This repository was archived by the owner on Apr 22, 2025. It is now read-only.

fix(cli-integ): atmosphere credentials not used when profile is set via AWS_PROFILE #83

Merged
merged 1 commit into from
Apr 21, 2025

Conversation

iliapolo
Copy link
Contributor

In CodeBuild, our initial credentials are configured via a profile ~/.aws/config and set via the AWS_PROFILE env variable.
This in turn causes the SDK to prefer the profile credentials, even after acquiring an atmosphere environment that provides static env creds:

@aws-sdk/credential-provider-node - defaultProvider::fromEnv WARNING:
--
741 | Multiple credential sources detected:
742 | Both AWS_PROFILE and the pair AWS_ACCESS_KEY_ID/AWS_SECRET_ACCESS_KEY static credentials are set.
743 | This SDK will proceed with the AWS_PROFILE value.
744 |  
745 | However, a future version may change this behavior to prefer the ENV static credentials.
746 | Please ensure that your environment only sets either the AWS_PROFILE or the
747 | AWS_ACCESS_KEY_ID/AWS_SECRET_ACCESS_KEY pair.

To fix, lets unset the AWS_PROFILE variable if/when static env creds are used.

@aws-cdk-automation aws-cdk-automation added this pull request to the merge queue Apr 21, 2025
Merged via the queue into main with commit 7afef9c Apr 21, 2025
17 checks passed
@aws-cdk-automation aws-cdk-automation deleted the epolon/unset-profile-atmo branch April 21, 2025 11:07
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants