简体   繁体   中英

AWS ECS Fargate not creating task AmazonECSTaskExecutionRole error

I'm trying to launch a test task in a ECS Fargate environment from the AWS console, but every time I try to launch it, I have the error:

Execution Role Failed creation of AmazonECSTaskExecutionRole

I supposed that it was a permissions error, so I asked the account owner (I am a IAM user of another account) to give me them, and now I do but still doesn't work.

My current permissions for ECS are:

  • AmazonECS_FullAccess
  • AmazonECSTaskExecutionRolePolicy

The worst thing is that AWS doesn't give any kind of information about this error. Anyone have an idea of how to make it work?

Thank you in advance!

您需要“iam:createRole”权限。

I was having this same issue, it wasn't related to my permissions but rather the task setup trying to access an ECR image.

I needed to create a new IAM Role that gave ECS Task access to my ECR repo, then attach that Role to Execution Role ARN for the task definition. This fixed it for both CLI and Console creation for me.

The solution is to add the "iam:createRole" permission. To do that add this policy to your IAM Policies:

{
  "Version": "2012-10-17",
  "Statement": [
    {
      "Sid": "Stmt1469200763880",
      "Action": [
        "iam:AttachRolePolicy",
        "iam:CreateRole"
      ],
      "Effect": "Allow",
      "Resource": "*"
    }
  ]
}

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM