2 Antworten
- Neueste
- Die meisten Stimmen
- Die meisten Kommentare
1
That command uses a HTTP GET to access the instance metadata service IMDS. IMDSv1 allows a GET request but IMDSv2 uses a PUT request - is it possible that the instance has been configured to use IMDSv2?
0
To get the same result now on a IMDSv2 host you now run:
TOKEN=`curl -s -X PUT "http://169.254.169.254/latest/api/token" -H "X-aws-ec2-metadata-token-ttl-seconds: 21600"` && curl -s -H "X-aws-ec2-metadata-token: $TOKEN" http://169.254.169.254/latest/meta-data/placement/region
beantwortet vor 8 Monaten
Relevanter Inhalt
- AWS OFFICIALAktualisiert vor einem Jahr
- AWS OFFICIALAktualisiert vor 2 Jahren
- AWS OFFICIALAktualisiert vor 3 Jahren
- AWS OFFICIALAktualisiert vor 2 Jahren
The host is running AL2023 with IMDSv2.
Then you'll need to do a PUT to get the IMDSv2 token then a GET to retrieve the data: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/AMI-launch-index-examples.html