Accessing host metadata from ECS tasks

0

I know that it's possible to access metadata about ECS tasks using the ECS task metadata endpoint. Is it possible to access the host metadata from a task if the task is running on an ECS EC2 instance? How about from an ECS Fargate task?

profile picture
EXPERT
bwhaley
asked a year ago1728 views
1 Answer
0
Accepted Answer

Hello bwhaley,

If you are running your ECS task on ECS container instances (EC2 type), you can call the EC2 IMDS endpoint (http://169.254.169.254/latest/meta-data/instance-id) to get the host metadata.

However, this will not be allowed for ECS tasks running on ECS Fargate.

Hope this is helpful!

profile pictureAWS
SUPPORT ENGINEER
answered a year ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions