简体   繁体   English

AWS ECS Fargate 未创建任务 AmazonECSTaskExecutionRole 错误

[英]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:我正在尝试从 AWS 控制台在 ECS Fargate 环境中启动测试任务,但每次尝试启动它时,都会出现错误:

Execution Role Failed creation of AmazonECSTaskExecutionRole执行角色 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.我认为这是一个权限错误,所以我要求账户所有者(我是另一个账户的 IAM 用户)给我它们,现在我做了,但仍然不起作用。

My current permissions for ECS are:我目前对 ECS 的权限是:

  • AmazonECS_FullAccess AmazonECS_FullAccess
  • AmazonECSTaskExecutionRolePolicy AmazonECSTaskExecutionRolePolicy

The worst thing is that AWS doesn't give any kind of information about this error.最糟糕的是,AWS 没有提供有关此错误的任何信息。 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.我遇到了同样的问题,它与我的权限无关,而是与尝试访问 ECR 图像的任务设置有关。

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.我需要创建一个新的 IAM 角色,让 ECS 任务可以访问我的 ECR 存储库,然后将该角色附加到任务定义的执行角色 ARN。 This fixed it for both CLI and Console creation for me.这为我修复了 CLI 和控制台创建。

The solution is to add the "iam:createRole" permission.解决方案是添加“iam:createRole”权限。 To do that add this policy to your IAM Policies:为此,请将此策略添加到您的 IAM 策略中:

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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