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

相关推荐
yunlaodacom2 小时前
AWS亚马逊云代理商:WAF登录接口请求洪泛,限速阈值怎么设置?
云计算·aws
长不大的杨瑞杰2 小时前
OpenCode v2 配置工程实战:Config 优先级、JSONC、变量替换与多环境治理
人工智能·安全·云计算·软件工程·devops
longzhizhui9263 小时前
Ubuntu 全版本 CVE-2026-98432 内核安全升级操作手册
ubuntu·网络安全·云计算·bash
yunlaodacom8 小时前
做异地灾备,华为云国际站 OBS 跨地域复制该怎么配置?
安全·华为云·云计算
Elastic 中国社区官方博客9 小时前
AgentHack Shanghai|基于阿里云AI搜索 Elasticsearch x Qoder 构建AI Agent应用
大数据·人工智能·elasticsearch·搜索引擎·阿里云·云计算·全文检索
知已难寻21 小时前
03 · OpenStack的计算管理 Nova
运维·服务器·开发语言·云原生·云计算·openstack·开源软件
会议咨询1 天前
2027年云计算、机电一体化与电子通信国际会议(CMEC 2027)
云计算·机电一体化·电子通信
云老大-阿里云国际站代理商1 天前
阿里云国际站服务代理商:CDN出现404,ECS源站正常怎么排查?
阿里云·云计算
tg_xianheyun1 天前
腾讯云国际账号注册代充值服务商怎么选?重点核对哪些信息
云计算·腾讯云
rich_Chan.2 天前
【2026 实操】bl video edit 教程:已拍素材改风格换颜色全流程,含输出规格、角标自查
人工智能·ai·云计算·aigc