How can an ECS task know in which region is runs?

落花浮王杯 提交于 2020-07-09 14:58:42

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!