1 Answer
- Newest
- Most votes
- Most comments
0
I’m seeing that this is related to IMDSv1 being disabled on my machines and that I need to either enable it or—better—use IMDSv2, which requires tokens, e.g.,
TOKEN=`curl -X PUT "http://169.254.169.254/latest/api/token" -H "X-aws-ec2-metadata-token-ttl-seconds: 21600"`
LOCAL_HOST_IP =`curl -H "X-aws-ec2-metadata-token: $TOKEN" http://169.254.169.254/latest/meta-data/local-ipv4`
Docs for IMDSv2 https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/configuring-instance-metadata-service.html
answered 3 years ago
Relevant content
- asked 2 months ago
- AWS OFFICIALUpdated 6 months ago
- AWS OFFICIALUpdated 7 months ago
- AWS OFFICIALUpdated a year ago