Difference between revisions of "AWS: 169.254.169.254"
Jump to navigation
Jump to search
(One intermediate revision by the same user not shown) | |||
Line 5: | Line 5: | ||
[[curl --silent]] "-ec2-metadata-token: $TOKEN" http://169.254.169.254/latest/meta-data/iam/security-credentials/role-name | [[curl --silent]] "-ec2-metadata-token: $TOKEN" http://169.254.169.254/latest/meta-data/iam/security-credentials/role-name | ||
+ | |||
+ | TOKEN=`[[curl -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" -v http://169.254.169.254/latest/[[user-data]] | ||
[[curl http://169.254.169.254/]] | [[curl http://169.254.169.254/]] | ||
Line 10: | Line 12: | ||
[[curl http://169.254.169.254/latest/meta-data/]] | [[curl http://169.254.169.254/latest/meta-data/]] | ||
− | [[http://169.254.169.254/latest/user-data]] | + | [[curl http://169.254.169.254/latest/user-data]] |
curl http://169.254.169.254/latest/meta-data/instance-type | curl http://169.254.169.254/latest/meta-data/instance-type |
Latest revision as of 14:14, 26 February 2024
Instance metadata https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/instancedata-data-retrieval.html
TOKEN=$(curl -s -X PUT "http://169.254.169.254/latest/api/token" -H "X-aws-ec2-metadata-token-ttl-seconds: 21600") curl --silent "-ec2-metadata-token: $TOKEN" http://169.254.169.254/latest/meta-data/iam/security-credentials/role-name
TOKEN=`curl -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" -v http://169.254.169.254/latest/user-data
curl http://169.254.169.254/ curl -v http://169.254.169.254/
curl http://169.254.169.254/latest/meta-data/ curl http://169.254.169.254/latest/user-data
curl http://169.254.169.254/latest/meta-data/instance-type t3.medium
REGION=$(curl http://169.254.169.254/latest/meta-data/placement/region)
curl -X PUT http://169.254.169.254/api/token
curl http://169.254.169.254/latest/meta-data/local-ipv4
curl http://169.254.169.254/latest/meta-data/public-ipv4
Related[edit]
ipconfig
aws ec2 modify-instance-metadata-options
- IMDS
- Terraform:
user_data
aws ec2 describe-availability-zones
See also[edit]
169.254.169.254
- IMDS, IMDS versions (IMDSv2), IMDS initiate session,
ec2-imdsv2-check, aws ec2 modify-instance-metadata-options, /latest/meta-data, /latest/user-data, modify-instance-metadata-defaults
- AWS EC2, Amazon EC2 API,
aws ec2, AWS::EC2
, Amazon EC2 Spot Instances, CPU credits, Instance type, EC2 limitations, 169.254.169.254, Instance metadata and user data (IMDS),InstanceType, InstanceId
, Amazon EC2 Auto Scaling, AWS EC2 Instance Connect, launch template, lifecycle, AWS Security group (SG), Amazon EC2 Recycle Bin, Amazon EC2 Mac Instances, Global View
Advertising: