2 réponses
- Le plus récent
- Le plus de votes
- La plupart des commentaires
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
répondu il y a 8 mois
Contenus pertinents
- demandé il y a 2 mois
- demandé il y a un an
- demandé il y a 2 mois
- Comment gérer les adresses IP statiques sur mes instances Lightsail à l'aide des commandes AWS CLI ?AWS OFFICIELA mis à jour il y a 3 ans
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