我正在使用Windows ECS群集的最新ECS Agent 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"
}
]
答案 0 :(得分:0)
在Windows指令中,此处似乎包含一个陷阱:
对于配置为使用awslogs日志记录驱动程序的Windows任务,还必须在容器实例上设置ECS_ENABLE_AWSLOGS_EXECUTIONROLE_OVERRIDE环境变量。可以使用以下语法通过“用户数据”完成此操作: