Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Exposing host's hostname and image id #456
Maybe I'm missing something, but I find it useful to know which image (image id) I am running from the Web application itself.
Similarly I would like to know what EC2 instance it's running upon, just to get a better idea what the load balancer is doing.
I don't quite understand how to expose those environment variables. I'm thinking the agent should just do it. Or should I look elsewhere?
https://count.dabase.com/ is my env test running on ECS in Singapore.
Can you explain a little bit more about your use case and what you would be using the image id for?
In regards to the EC2 instance-id, this is not exposed as an environment variable within the host (or container for that matter), it is exposed though the Instance Metadata Service. This can be accessed from any container on the host; you can read more about the available Instance Metadata Categories here.
Currently, we do not support setting these values into environment variables. That said, you are free to set them manually using the values from the Instance Metadata Service.
IIUC in general there is a use-case for exposing some of the static details from