AWS ECS Docker Container Boto3 IAM Permissions
<p>I am attempting to run a boto3 python script inside a docker container using AWS ECS. My script need access to SQS ( get &amp; delete messages ) and Lambda ( permission to search and run ). </p>

<p>In order to get the docker container running on my local machine I was able to pass my aws credentials into the docker container using the following docker run command.</p>

<p><code>docker run -v ~/.aws:/root/.aws</code></p>

<p>Recently ECS has announced: </p>

<p><code>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
</code></p>

<p>I attach a task IAM role to the task but upon running the task I get the following error:</p>

<p><code>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.
</code></p>

<p>Any ideas would be appreciated.  </p>