Created
April 26, 2022 06:26
-
-
Save markymarkus/826b2bd73d4ea919d5edc959e287eaec to your computer and use it in GitHub Desktop.
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
TOKEN=$(curl --silent -X PUT "http://169.254.169.254/latest/api/token" -H "X-aws-ec2-metadata-token-ttl-seconds: 600") | |
INSTANCEID=$(curl --silent -H "X-aws-ec2-metadata-token: ${TOKEN}" http://169.254.169.254/latest/dynamic/instance-identity/document | python3 -c 'import json,sys;print(json.load(sys.stdin)["instanceId"])') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment