amazon-web-services - 无法放置任务,因为没有容器实例满足其所有要求

标签 amazon-web-services amazon-ecs

我正在使用适用于 Windows ECS 集群的最新 ECS 代理 v1.22.0。我想尝试一下新功能https://docs.aws.amazon.com/AmazonECS/latest/developerguide/specifying-sensitive-data.html?shortFooter=true但出现以下失败错误消息:

service XXX was unable to place a task because no container instance met
all of its requirements. The closest matching container-instance YYY is
missing an attribute required by your task.

ECS 代理日志似乎没有显示任何错误。我的任务具有以下属性:

"requiresAttributes": [
    {
      "targetId": null,
      "targetType": null,
      "value": null,
      "name": "com.amazonaws.ecs.capability.docker-remote-api.1.28"
    },
    {
      "targetId": null,
      "targetType": null,
      "value": null,
      "name": "ecs.capability.execution-role-ecr-pull"
    },
    {
      "targetId": null,
      "targetType": null,
      "value": null,
      "name": "com.amazonaws.ecs.capability.ecr-auth"
    },
    {
      "targetId": null,
      "targetType": null,
      "value": null,
      "name": "com.amazonaws.ecs.capability.task-iam-role"
    },
    {
      "targetId": null,
      "targetType": null,
      "value": null,
      "name": "ecs.capability.execution-role-awslogs"
    },
    {
      "targetId": null,
      "targetType": null,
      "value": null,
      "name": "com.amazonaws.ecs.capability.logging-driver.awslogs"
    },
    {
      "targetId": null,
      "targetType": null,
      "value": null,
      "name": "ecs.capability.secrets.ssm.environment-variables"
    },
    {
      "targetId": null,
      "targetType": null,
      "value": null,
      "name": "com.amazonaws.ecs.capability.docker-remote-api.1.19"
    }
  ]

最佳答案

fwiw Windows 说明似乎包含一个陷阱:

For Windows tasks that are configured to use the awslogs logging driver, you must also set the ECS_ENABLE_AWSLOGS_EXECUTIONROLE_OVERRIDE environment variable on your container instance. This can be done with User Data using the following syntax:

参见the instructions here

关于amazon-web-services - 无法放置任务,因为没有容器实例满足其所有要求,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53396032/

相关文章:

scala - 使用 spark 和 scala 将文件写入 S3 非常慢。有什么更好的方法来优化它?

amazon-web-services - 用户注册后如何在 aws cognito 中自动验证电子邮件。稍后状态后在 Cognito 中验证电子邮件

c# - 在 AWS 的单个 EC2 实例上部署多个 asp.net 应用程序

amazon-web-services - 在 aws ECS 集群中显示 docker 容器日志

amazon-web-services - 谁停止和启动 ECS 任务?并通知 ECS 服务

java - 当我在 aws elastic beanstalk 中部署 Spring Boot 项目时,如何压缩 Spring Boot 中的 MultipartFie[] 大小?

amazon-web-services - Cloudformation 可以在创建每个资源后触发事件吗?

amazon-web-services - 部署指定修订版是空文件,但提供的修订版是 zip 文件

amazon-s3 - 在任务启动期间从安全位置检索应用程序配置

amazon-ecs - 在ECS上将RDS密码获取到Docker容器的最佳实践