2 回答
- 最新
- 投票最多
- 评论最多
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
已回答 8 个月前
相关内容
- AWS 官方已更新 3 个月前
- AWS 官方已更新 1 年前
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