我正在嘗試在使用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 –