Skip to content

Instantly share code, notes, and snippets.

@rkpinheiro
Last active February 1, 2020 17:10
Show Gist options
  • Save rkpinheiro/44680a6c19c7735ec7c16d63e7e9af21 to your computer and use it in GitHub Desktop.
Save rkpinheiro/44680a6c19c7735ec7c16d63e7e9af21 to your computer and use it in GitHub Desktop.
create aws profile script for CircleCI
#!/bin/bash
set -e
set -u
# Create credentials
mkdir ~/.aws
touch ~/.aws/config
chmod 600 ~/.aws/config
echo "[profile $1]" >> ~/.aws/config
echo "region = us-east-2" >> ~/.aws/config
echo "aws_access_key_id=$AWS_ACCESS_KEY_ID" >> ~/.aws/config
echo "aws_secret_access_key=$AWS_SECRET_ACCESS_KEY" >> ~/.aws/config
@rkpinheiro
Copy link
Author

create your profile running bash aws-credentials.sh my-profile and use it in --profile my-profile argument on aws-cli

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment