gpt4 book ai didi

amazon-web-services - Amazon ECS LogConfiguration 返回 "unsupported property logConfiguration"

转载 作者:行者123 更新时间:2023-12-03 07:13:43 25 4
gpt4 key购买 nike

我正在尝试让 LogConfiguration 用于特定的任务定义。但 CloudFormation 一直提示它 遇到不支持的属性 logConfiguration

根据文档应该可以使用。

http://docs.aws.amazon.com/AmazonECS/latest/developerguide/task_definition_parameters.html#container_definition_storage

"ContainerDefinitions" : [
{
"Name": "foo",
"PortMappings": [ ... code omitted ... ],
"logConfiguration" : {
"logDriver" : "fluentd",
"options" : {
"fluentd-address" : "foo:24224",
"tag" : "foobar"
}
},
}
]

知道我缺少什么吗?

最佳答案

我不确定在提出此问题时 CloudFormation 中是否不提供 LogConfiguration,但现在可以了。

它也区分大小写,因此您需要将 logConfiguration 更改为 LogConfiguration,将 logDriver 更改为 LogDriver > 和选项选项。就像这样:

"ContainerDefinitions" : [
{
"Name": "foo",
"PortMappings": [ ... code omitted ... ],
"LogConfiguration" : {
"LogDriver" : "fluentd",
"Options" : {
"fluentd-address" : "foo:24224",
"tag" : "foobar"
}
}
}
]

我尚未使用 Fluentd 进行测试,但我知道使用 awslogs 驱动程序进行此配置可以正常工作:

"ContainerDefinitions": [
{
"Name": { "Ref": "ContainerName" },
"PortMappings": [ ... code omitted ... ],
"LogConfiguration": {
"LogDriver": "awslogs",
"Options": {
"awslogs-group": { "Ref": "LogGroupName" },
"awslogs-region": { "Ref": "AWS::Region" },
"awslogs-stream-prefix": { "Ref": "ContainerName" }
}
}
}
]

关于amazon-web-services - Amazon ECS LogConfiguration 返回 "unsupported property logConfiguration",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36140806/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com