Skip to content

Commit bf4130e

Browse files
authored
Merge pull request #13 from abyss/feature-aws-profile
Add support for non-default AWS profile
2 parents 69aa42b + 81c65d4 commit bf4130e

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

scripts/lib/aws.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,10 @@ DEFAULT_AWS_CLI_VERSION="2.0.52"
2121
# To use a specific version of the AWS CLI, set the ACK_AWS_CLI_IMAGE_VERSION
2222
# environment variable, otherwise the value of DEFAULT_AWS_CLI_VERSION is used.
2323
daws() {
24+
aws_cli_profile_env=$([ ! -z "$AWS_PROFILE" ] && echo "--env AWS_PROFILE=$AWS_PROFILE")
2425
aws_cli_img_version=${ACK_AWS_CLI_IMAGE_VERSION:-$DEFAULT_AWS_CLI_VERSION}
2526
aws_cli_img="amazon/aws-cli:$aws_cli_img_version"
26-
docker run --rm -v ~/.aws:/root/.aws:z -v $(pwd):/aws "$aws_cli_img" "$@"
27+
docker run --rm -v ~/.aws:/root/.aws:z $(echo $aws_cli_profile_env) -v $(pwd):/aws "$aws_cli_img" "$@"
2728
}
2829

2930
# aws_check_credentials() calls the STS::GetCallerIdentity API call and

0 commit comments

Comments
 (0)