I want to securely fetch configuration files from S3 using a secure VPC from my Docker container. But I want to determine inside the application which configuration file to fetch and use based on the region I am on. Is there a good/best practice to go on about describing the current container’s region?
I understand that you can use the AWS SDK/CLI to describe the ECS instances, but that doesn’t tell me which one the container is specifically deployed on.
See this page for full details about instance metadata.
Within ECS, I’d be interested to see if these might still work — my hunch is they would, as the container should query the host machine’s API for the answer, and the ECS host is most certainly an EC2 instance.