2 Respostas
- Mais recentes
- Mais votos
- Mais comentários
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
respondido há 8 meses
Conteúdo relevante
- AWS OFICIALAtualizada há 2 meses
- AWS OFICIALAtualizada há 2 anos
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