-
-
Save sapslaj/1eee8117956c68a7d96bcece5ef95391 to your computer and use it in GitHub Desktop.
AWS EC2 IMDS helper script
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
set -e | |
TOKEN=`curl -sSL -X PUT "http://169.254.169.254/latest/api/token" -H "X-aws-ec2-metadata-token-ttl-seconds: 21600"` | |
curl -H "X-aws-ec2-metadata-token: $TOKEN" http://169.254.169.254/latest/meta-data/$1 | |
echo |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment