Cannot access metadata and user data from EC2 instance

0

Hello, I am doing an AWS Certified Solutions Architect - Associate (SAA-C03) course in Cloud Guru. Unfortunately they just removed the forum. I was wondering about the following.

In the EC2 instance provisioned by them, when I connect to it using AWS console (EC2 Instance Connect), and execute e.g. curl http://169.254.169.254/latest/meta-data/public-ipv4, then the ip is printed in the terminal.

When I launch my own instance, with same OS, similar type (the type provisioned by them is no accessible in the list), with public IP, with same subnet and security group, then the same command gives me an empty string.

It is the same for meta data and user data. What could possibly be the reason of this?

Monika
질문됨 한 달 전138회 조회
1개 답변
1
수락된 답변

Your EC2 instance is probably configured to use IMDS v2 only. This is the default starting Nov 2023

For more info, you can refer to this blog Get the full benefits of IMDSv2 and disable IMDSv1 across your AWS infrastructure

AWS
전문가
Mike_L
답변함 한 달 전
profile picture
전문가
Steve_M
검토됨 한 달 전
  • yes seems to have been the reason, thanks!

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠