Skip to content

Instantly share code, notes, and snippets.

@thinkst
Created September 14, 2017 09:08
Show Gist options
  • Select an option

  • Save thinkst/23367c7fa64382fdc41147ba6e544918 to your computer and use it in GitHub Desktop.

Select an option

Save thinkst/23367c7fa64382fdc41147ba6e544918 to your computer and use it in GitHub Desktop.
#!/usr/bin/env bash
usage(){
echo "./test_aws_creds.sh <access_key_id> <secret_access_key>"
}
export AWS_ACCESS_KEY_ID=$1
export AWS_SECRET_ACCESS_KEY=$2
export AWS_DEFAULT_REGION=us-east-2
echo "Access Key ID: $AWS_ACCESS_KEY_ID"
echo "Secret Access Key: $AWS_SECRET_ACCESS_KEY"
echo "Region: $AWS_DEFAULT_REGION"
resp=$(aws iam create-user --user-name TestMePlease)
if [[ $? != 0 ]];then
echo 'If the token worked, you should receive an alert shortly (0-20 mins)'
else
echo 'Seems the AWS Key allowed you to create an actual user. What?!'
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment