AWS中使用ECS时ecsTaskExecutionRole缺失

文章目录

问题

在AWS中使用Amazon Elastic Container Service (Amazon ECS) 创建集群,任务,服务和容器时返回ecsTaskExecutionRole的问题,进行解决。

在事件中查看具体报错如下:

===

service Windows-test failed to launch a task with (error ECS was unable to assume the role 'arn:aws:iam::123456789012:role/ecsTaskExecutionRole' 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.).

解决

在AWS IAM中创建ecsTaskExecutionRole这个角色,进行 Add Permissions, Attach policies,将AmazonECSTaskExecutionRolePolicy,添加到ecsTaskExecutionRole,问题解决。

确保Trust relationships中有以下内容:

json 复制代码
{
  "Version": "2012-10-17",
  "Statement": [
    {
      "Sid": "",
      "Effect": "Allow",
      "Principal": {
        "Service": "ecs-tasks.amazonaws.com"
      },
      "Action": "sts:AssumeRole"
    }
  ]
}

参考

AWS ECS Getting started with the console using Windows containers on AWS Fargate
AWS Amazon ECS task execution IAM role

相关推荐
电商API&Tina2 小时前
【电商API接口】开发者一站式电商API接入说明
大数据·数据库·人工智能·云计算·json
亚马逊云开发者7 小时前
🔥 20 行代码搞定 AI Agent!查天气、算数学、读文档全包了
aws
亚马逊云开发者7 小时前
被线上故障电话叫醒后,我花一下午搭了套零人工告警系统
aws
kyle~11 小时前
云端数据存储---阿里云OSS
阿里云·云计算
云算计12 小时前
给太空云计算提出10个问题
云计算
李白你好12 小时前
云安全渗透测试框架 - 支持 AWS、Azure、GCP、阿里云、腾讯云、华为云的综合渗透测试工具和指南
阿里云·azure·aws
※※冰馨※※13 小时前
【C++】通过 Git 访问阿里云 Codeup 仓库
git·阿里云·云计算
摇滚侠13 小时前
JAVA 项目教程《苍穹外卖-番外篇-阿里云对象存储》,微信小程序项目,前后端分离,从开发到部署
阿里云·云计算
小仓桑1 天前
【Agent智能体项目实战一】阿里云通义千问兼容 OpenAI 接口实现 AI 对话
人工智能·阿里云·云计算·agent
AI周红伟1 天前
周红伟:豆包大模型的尽头是直播间,豆包开启AI购物内测 电商平台加码“一句话购物”
人工智能·阿里云·云计算·腾讯云·openclaw