AWS ECSを使用してdockerコンテナ内でboto3 pythonスクリプトを実行しようとしています。私のスクリプトはSQS(メッセージの削除&)とLambda(検索と実行の許可)にアクセスする必要があります。AWS ECS DockerコンテナBoto3 IAMパーミッション
私のローカルマシンで稼働しているドッカーコンテナを取得するには、次のドッカー実行コマンドを使用して、私のaws資格情報をドッキングコンテナに渡すことができました。
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の役割をサポートしていません - 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 –