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

相关推荐
翼龙云_cloud1 小时前
阿里云代理商:部署OpenClaw 多 Agent 协同实战指南
运维·人工智能·阿里云·云计算·cloudwatch
Benszen1 小时前
云计算与虚拟化:KVM技术深度解析
开发语言·云计算·perl
人工智能知识库2 小时前
阿里云云计算ACA/ACP题库(26年最新)
阿里云·云计算·题库·acp·aca
菜菜艾11 小时前
基于llama.cpp部署私有大模型
linux·运维·服务器·人工智能·ai·云计算·ai编程
亚马逊云开发者15 小时前
Claude Code Token费用暴涨3倍?SageMaker+LiteLLM动态路由方案帮你省70%
aws
亚马逊云开发者15 小时前
文搜视频、图搜视频、视频搜视频——Nova Multimodal Embeddings 多模态素材搜索实战
aws
亚马逊云开发者15 小时前
3小时从零到生产:用Kiro IDE写Agent + AgentCore一键部署到云端
aws
小夏子_riotous19 小时前
openstack的使用——5. Swift服务的基本使用
linux·运维·开发语言·分布式·云计算·openstack·swift
Gofarlic_OMS19 小时前
Windchill的license合规使用报告自动化生成与审计追踪系统
大数据·运维·人工智能·云原生·自动化·云计算
主机哥哥1 天前
2026年腾讯云优惠券领取攻略:新购/续费/升级可用
云计算·腾讯云