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

相关推荐
咕噜企业分发小米9 小时前
阿里云与华为云基因测序数据分析安全性如何?
阿里云·华为云·云计算
咕噜企业分发小米9 小时前
阿里云与华为云基因测序数据分析可用性如何?
阿里云·华为云·云计算
翼龙云_cloud9 小时前
阿里云GPU卡顿、掉线如何处理?
运维·服务器·阿里云·云计算
@HNUSTer11 小时前
基于 GEE 的 Landsat C02 Level-2 数据集实现黄河入海口变化监测:支持年度影像切换与动态监测结果下载的完整解决方案
云计算·数据集·遥感大数据·gee·云平台·landsat·变化监测
Elastic 中国社区官方博客11 小时前
使用 Elasticsearch Agent Builder 构建对话式费用助手,结合 Telegram, n8n 和 AWS Bedrock
大数据·数据库·人工智能·elasticsearch·搜索引擎·ai·aws
孤岛悬城12 小时前
45 Docker网络管理
云计算
孤岛悬城1 天前
42 Ansible-Playbooks 自动化剧本
云计算
孤岛悬城1 天前
41 Ansible 自动化
云计算
孤岛悬城1 天前
44 Docker:安装与容器管理
docker·容器·云计算