Skip to content

Commit

Permalink
Merge pull request #253 from dxw/prevent-local-aws-env-superceding-da…
Browse files Browse the repository at this point in the history
…lmatian-profile-configuration

Prevent local AWS environment variables superceding Dalmatian profile
  • Loading branch information
rjw1 authored Mar 1, 2024
2 parents 7f555af + 85770d3 commit e6586c0
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions bin/dalmatian
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,17 @@ then
export AWS_CONFIG_FILE="$CONFIG_AWS_SSO_FILE"
export AWS_PROFILE="dalmatian-main"

# These AWS environment variables take precedence when authenticating, which
# can cause errors if they are not related to Dalmatian
unset AWS_SESSION_TOKEN
unset AWS_SECRET_ACCESS_KEY
unset AWS_ACCESS_KEY_ID
unset AWS_DEFAULT_REGION
unset AWS_DEFAULT_OUTPUT
unset AWS_REGION
unset AWS_ROLE_ARN
unset AWS_ROLE_SESSION_NAME

if [ "$SUBCOMMAND" != "update" ]
then
if [ "$IS_PARENT_SCRIPT" == 1 ]
Expand Down

0 comments on commit e6586c0

Please sign in to comment.