Created
May 29, 2024 10:45
-
-
Save filipeandre/0165f118c883bb3a08b056b241e0d28c to your computer and use it in GitHub Desktop.
Get user data script from EC2
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 -X PUT "http://169.254.169.254/latest/api/token" -H "X-aws-ec2-metadata-token-ttl-seconds: 21600"` | |
export INSTANCE_ID=`curl -H "X-aws-ec2-metadata-token: $TOKEN" -v http://169.254.169.254/latest/meta-data/instance-id` | |
sudo cat /var/lib/cloud/instances/$INSTANCE_ID/user-data.txt |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment