title: How to get Task ID from within ECS container?
body: <p>Hello I am interested in retrieving the <code>Task ID</code> from within inside a running container which lives inside of a EC2 host machine.</p>
  
  <p><a href="https://docs.aws.amazon.com/AmazonECS/latest/developerguide/container-metadata.html" rel="noreferrer">AWS ECS documentation</a> states there is an environment variable <code>ECS_CONTAINER_METADATA_FILE</code> with the location of this data but will only be set/available if <code>ECS_ENABLE_CONTAINER_METADATA</code> variable is set to true upon cluster/EC2 instance creation. I don't see where this can be done in the aws console.</p>
  
  <p>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. </p>
  
  <p>Is there any other way to do this without having to go inside the EC2 to set this and restart the docker agent?</p>