Skip to content

Instantly share code, notes, and snippets.

@mijndert
Last active May 3, 2020 14:07
Show Gist options
  • Select an option

  • Save mijndert/d3058f3e9e02836078133b5e5a7259c4 to your computer and use it in GitHub Desktop.

Select an option

Save mijndert/d3058f3e9e02836078133b5e5a7259c4 to your computer and use it in GitHub Desktop.
simple script to read credentials from ~/.aws/credentials and export it into your env vars
#!/usr/bin/env bash
echo "Enter the account for which you want to export credentials and [enter]"
read account
export AWS_ACCESS_KEY_ID=$(aws configure get $account.aws_access_key_id)
export AWS_SECRET_ACCESS_KEY=$(aws configure get $account.aws_secret_access_key)
export AWS_REGION=$(aws configure get $account.region)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment