Skip to content

Instantly share code, notes, and snippets.

@ctgardner
Created March 13, 2019 06:45
Show Gist options
  • Save ctgardner/a0fcba5ff4678095650a500054fbfa9d to your computer and use it in GitHub Desktop.
Save ctgardner/a0fcba5ff4678095650a500054fbfa9d to your computer and use it in GitHub Desktop.
Export the credentials an AWS CLI profile
#!/bin/bash
# usage: $ `./export_aws_profile.sh my-profile`
profile=$1
echo "export AWS_ACCESS_KEY_ID=$(aws configure get $profile.aws_access_key_id)"
echo "export AWS_SECRET_ACCESS_KEY=$(aws configure get $profile.aws_secret_access_key)"
echo "export AWS_DEFAULT_REGION=$(aws configure get $profile.region)"
unset profile
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment