Answer my own question, in AWS ECS cluster, a daemon is running, you can queue its metadata by below commands
$ curl http://localhost:51678/v1/tasks | python -mjson.tool
$ curl -s http://localhost:51678/v1/metadata | python -mjson.tool
{
"Cluster": "application-1",
"ContainerInstanceArn": "arn:aws:ecs:us-east-2:1234567890:container-instance/ee4d3451d-2de3-4180-b1c6-023ed6e8c343",
"Version": "Amazon ECS Agent - v1.14.1 (467c3d7)"
}
This will be useful if you need to deregister itself from ECS cluster, for example, you use spot instance in ecs cluster.
Refer:
ecs agent introspection