Skip to content

Instantly share code, notes, and snippets.

@stuaxo
Created April 11, 2025 12:06
Show Gist options
  • Save stuaxo/81519d345616a0aafc399dc3437ae86b to your computer and use it in GitHub Desktop.
Save stuaxo/81519d345616a0aafc399dc3437ae86b to your computer and use it in GitHub Desktop.
aws-env
aws-env() {
export AWS_REGION=$(aws configure get region)
export AWS_ACCOUNT_ID=$(aws sts get-caller-identity --query Account --output text)
export AWS_ACCESS_KEY_ID=$(aws configure get aws_access_key_id)
export AWS_SECRET_ACCESS_KEY=$(aws configure get aws_secret_access_key)
echo "AWS environment variables set:"
echo "AWS_REGION=$AWS_REGION"
echo "AWS_ACCOUNT_ID=$AWS_ACCOUNT_ID"
echo "AWS_ACCESS_KEY_ID=$AWS_ACCESS_KEY_ID"
echo "AWS_SECRET_ACCESS_KEY=********"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment