aws-sdk

How to get Task ID from within ECS container?

房东的猫 提交于 2020-08-27 03:12:31
问题 Hello I am interested in retrieving the Task ID from within inside a running container which lives inside of a EC2 host machine. AWS ECS documentation states there is an environment variable ECS_CONTAINER_METADATA_FILE with the location of this data but will only be set/available if ECS_ENABLE_CONTAINER_METADATA variable is set to true upon cluster/EC2 instance creation. I don't see where this can be done in the aws console. Also, the docs state that this can be done by setting this to true