0
votes

We have plan to implement AWS Elastic Beanstalk with Multi Container Docker. I have a IAM user with full access for all services. I have created docker image and pushed to AWS Elastic Container service successfully. When I deploy docker image (.json) to server using AWS Elastic Beanstalk, I got the below Issue. Please guide me for solution. I have checked the IAM user policy and add Amazon ECS,Elastic Beanstalk full access. I have list my .json code for your ref..

Json Code:

{
  "AWSEBDockerrunVersion": "2",  
"containerDefinitions": [

{

      "name": "agshift_strawberry",
      "image": "705395670584.dkr.ecr.us-west-2.amazonaws.com/agshift_strawberry:latest",
      "essential": true,
      "memory": 512,
      "portMappings": [
        {
          "hostPort": 80,
          "containerPort": 80
        }
      ]
}

]
}

Error:

ECS task stopped due to: Essential container in task exited. (agshift_strawberry: CannotPullContainerError: AccessDeniedException: User: arn:aws:sts::705395670584:assumed-role/aws-elasticbeanstalk-ec2-role/i-05f177a336c68b998 is not authorized to perform: ecr:GetAuthorizationToken on resource: * status code: 400, request id: c37a11c1-)

1

1 Answers

7
votes
  1. Open the IAM Console
  2. Click on Roles
  3. Find the aws-elasticbeanstalk-ec2-role
  4. Add a policy that includes ecr:GetAuthorizationToken permission.