Skip to content

Instantly share code, notes, and snippets.

@tomahim
Last active September 9, 2022 15:49
Show Gist options
  • Save tomahim/c640bf8625343135340251faa1179100 to your computer and use it in GitHub Desktop.
Save tomahim/c640bf8625343135340251faa1179100 to your computer and use it in GitHub Desktop.
Bash script to create an AWS credential file
#!/usr/bin/env bash
set -x
set -e
{
AWS_CONFIG_FILE=~/.aws/config
mkdir ~/.aws
touch $AWS_CONFIG_FILE
chmod 600 $AWS_CONFIG_FILE
echo "[profile eb-cli]" > $AWS_CONFIG_FILE
echo "aws_access_key_id=${AWS_ACCESS_KEY_ID}" >> $AWS_CONFIG_FILE
echo "aws_secret_access_key=${AWS_SECRET_ACCESS_KEY}" >> $AWS_CONFIG_FILE
} &> /dev/null
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment