Difference between revisions of "AWS: 169.254.169.254"

From wikieduonline
Jump to navigation Jump to search
(Created page with " curl -s "-ec2-metadata-token: $TOKEN" http://169.254.169.254/latest/meta-data/iam/security-credentials/role-name == See also == * {{AWS}} Category:AWS")
 
 
(27 intermediate revisions by 3 users not shown)
Line 1: Line 1:
 +
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
  
curl -s "-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 ==
 +
* <code>[[ipconfig]]</code>
 +
* <code>[[aws ec2 modify-instance-metadata-options]]</code>
 +
* [[IMDS]]
 +
* Terraform: <code>[[user_data]]</code>
 +
* <code>[[aws ec2 describe-availability-zones]]</code>
  
 
== See also ==
 
== See also ==
* {{AWS}}
+
* {{169.254.169.254}}
 +
* {{IMDS}}
 +
* {{AWS EC2}}
  
 
[[Category:AWS]]
 
[[Category:AWS]]

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]

See also[edit]

Advertising: