check snapshotter IAM role

This commit is contained in:
Alex Grin 2019-11-13 10:17:51 -05:00 committed by GitHub
parent cf11283f95
commit 4c009dd252
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -5,6 +5,7 @@
echo "Running $0"
hash aws 2>/dev/null || { echo >&2 '`aws` command not found. Install it: sudo apt install awscli'; exit 1; }
[ "$(curl -q http://169.254.169.254/latest/meta-data/iam/security-credentials)" == "ec2-snapshotter" ] || { echo >&2 'This instance is missing the "ec2-snapshotter" IAM role'; exit 1; }
user=$(whoami)