gpt4 book ai didi

amazon-web-services - 日志驱动程序 awslogs 需要选项 : awslogs-region, awslogs-group

转载 作者:行者123 更新时间:2023-12-05 02:52:49 28 4
gpt4 key购买 nike

我有一个 json 文件,其中包含我的 AWS ECS 任务定义,例如:

[
{
"name": "my-name",
"image": "url",
"cpu": 2,
"dnsSearchDomains": null,
"network_configuration":"awsvpc",
"entryPoint": null,
"portMappings": [
{
"hostPort": 8080,
"protocol": "tcp",
"containerPort": 8080
}
],
"command": null,
"linuxParameters": null,
"environment": [],
"resourceRequirements": null,
"ulimits": null,
"dnsServers": null,
"mountPoints": [
{
"readOnly": null,
"containerPath": "/fldr",
"sourceVolume": "fldr"
}
],
"workingDirectory": null,
"secrets": null,
"dockerSecurityOptions": null,
"memoryReservation": 128,
"volumesFrom": [],
"stopTimeout": null,
"startTimeout": null,
"firelensConfiguration": null,
"dependsOn": null,
"disableNetworking": null,
"interactive": null,
"healthCheck": null,
"essential": true,
"links": null,
"hostname": null,
"extraHosts": null,
"pseudoTerminal": null,
"user": null,
"readonlyRootFilesystem": null,
"dockerLabels": null,
"systemControls": null,
"privileged": null,
"logConfiguration": {
"logDriver": "awslogs",
"awslogs-region": "eu-west-1",
"awslogs-group": "my-cw-group"
}
}
]

尽管定义了 awslogs-regionawslogs-group像这样:

"logConfiguration": {
"logDriver": "awslogs",
"awslogs-region": "eu-west-1",
"awslogs-group": "my-cw-group"
}

当我运行 terraform apply 时,它返回:

Error: ClientException: Log driver awslogs requires options: awslogs-region, awslogs-group

我在 StackOverflow 和 Github 中都找不到相关问题。

最佳答案

"logConfiguration": {
"logDriver": "awslogs",
"options": {
"awslogs-region": "eu-west-1",
"awslogs-group": "my-cw-group"
}
}

这些选项需要是 options 的成员,而 optionslogConfiguration 的成员,如上所示。

如果您使用的是 Fargate,您还需要提供 awslogs-stream-prefix,如 Specifying a Log Configuration in your Task Definition 中所述在文档中。

关于amazon-web-services - 日志驱动程序 awslogs 需要选项 : awslogs-region, awslogs-group,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/62490095/

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