问题
I have a python application using boto3 in a task launched by ECS (in a docker container). The boto3 command I use need a region to work properly, but I only know the region at runtime (multi-region application). The idea was then to define the AWS_DEFAULT_REGION
environment variable by retrieving the region in the dynamic document provided by Amazon from URI http://169.254.169.254. However, whereas the call works fine from the instance, I cannot access the endpoint from within the task container.
Is there a clean way to know in which region the task actually runs ?
[SOLUTION]
Have a look at the issue enter link description here
来源:https://stackoverflow.com/questions/62480915/how-can-an-ecs-task-know-in-which-region-is-runs