【发布时间】:2016-12-26 01:36:29
【问题描述】:
我正在尝试使用 AWS ECS 在 docker 容器内运行 boto3 python 脚本。我的脚本需要访问 SQS(获取和删除消息)和 Lambda(搜索和运行权限)。
为了让 docker 容器在我的本地机器上运行,我可以使用以下 docker run 命令将我的 aws 凭据传递到 docker 容器中。
docker run -v ~/.aws:/root/.aws
最近ECS宣布:
Amazon ECS now supports IAM roles for tasks. When you specify an IAM role for a task, its containers can then use the latest versions of the AWS CLI or SDKs to make API requests to authorized AWS services. Learn More
我将任务 IAM 角色附加到任务,但在运行任务时出现以下错误:
Unable to run task
ECS was unable to assume the role that was provided for this task. Please verify that the role being passed has the proper trust relationship and permissions and that your IAM user has permissions to pass this role.
任何想法将不胜感激。
【问题讨论】:
-
Boto3 尚不支持 ECS 任务的 IAM 角色 - docs.aws.amazon.com/AmazonECS/latest/developerguide/… (我也很难学会...尝试部署一些东西,但没有用,然后我想通了)
-
感谢您的回复。很高兴知道 IAM 角色不适用于 Boto3。我正在研究这篇文章作为解决方案,但无法让它发挥作用。 docs.aws.amazon.com/AmazonECS/latest/developerguide/…
标签: amazon-web-services docker amazon-iam boto3