You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The environment variable ECS_CONTAINER_METADATA_URI_V4 is set in AWS fargate platform 1.4.0+
DockerId
The Docker ID for the container.
When you use Fargate, the id is a 32-digit hex followed by a 10 digit number.
When querying the ${ECS_CONTAINER_METADATA_URI_V4} endpoint you are returned only metadata about the container itself. The following is an example output.
Aside: Multiple ECS containers can run on individual EC2 instances. I haven't checked what the endpoint currently does in that case. To preserve existing behavior, 169.254.169.254 (exports.AWS_UNIQUE_ID_URL) could be tried first: https://cloudonaut.io/ecs-vs-fargate-whats-the-difference/
The text was updated successfully, but these errors were encountered:
EC2 is already implemented and uses https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/instance-identity-documents.html , which does not exist for fargate
https://stackoverflow.com/a/75993784 https://docs.aws.amazon.com/AmazonECS/latest/userguide/task-metadata-endpoint-v4-fargate.html#task-metadata-endpoint-v4-fargate-examples has fields such as dockerId/privateId. dockerId seems the most similar to instanceId.
The environment variable ECS_CONTAINER_METADATA_URI_V4 is set in AWS fargate platform 1.4.0+
Aside: Multiple ECS containers can run on individual EC2 instances. I haven't checked what the endpoint currently does in that case. To preserve existing behavior, 169.254.169.254 (exports.AWS_UNIQUE_ID_URL) could be tried first: https://cloudonaut.io/ecs-vs-fargate-whats-the-difference/
The text was updated successfully, but these errors were encountered: