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 inside the host machine but would require to restart the docker agent.
Is there any other way to do this without having to go inside the EC2 to set this and restart the docker agent?
ECS_CONTAINER_METADATA_URI_V4
environment variable is no longer available. You can useECS_CONTAINER_METADATA_URI
instead. – Levileviable