我正在尝试在使用AWS ECS的码头集装箱内运行boto3 python脚本。我的脚本需要访问SQS(获取&删除消息)和Lambda(许可搜索和运行)。AWS ECS码头集装箱Boto3 IAM权限
为了让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还不支持IAM角色ECS任务 - http://docs.aws.amazon.com/AmazonECS/latest/developerguide/task-iam-roles.html#task-iam-roles-最低 - SDK(我也学会了这种困难的方式...试图部署的东西,没有工作,然后我想通了) –
感谢您的答复。很高兴知道IAM角色不适用于Boto3。我正在研究这个帖子作为一个解决方案,但一直没有能够得到它的工作。 https://docs.aws.amazon.com/AmazonECS/latest/developerguide/task-iam-roles.html –