gpt4 book ai didi

aws-cloudformation - 不允许使用无关 key [HealthCheck]

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

我有点陷入这个奇怪的错误。我正在使用 CloudFormation 脚本部署 ECS 任务 (Fargate),它可以正常工作并成功部署该任务。但是当设置了 HealthCheck 属性时 Cloudformation 会回复

资源处理程序返回消息:“模型验证失败(#:不允许使用无关 key [HealthCheck])”(RequestToken:xxxxxxx-xxx-xxxx-xxxx-xxxxxxxxxxxx,HandlerErrorCode:InvalidRequest)

我的任务定义是:

  TaskDefinition:
Type: AWS::ECS::TaskDefinition
Properties:
Family: !Sub ${ServiceName}-${EnvironmentName}
Cpu: !Ref 'ContainerCpu'
Memory: !Ref 'ContainerMemory'
NetworkMode: awsvpc
RequiresCompatibilities:
- FARGATE
ExecutionRoleArn: arn:aws:iam::xxxxxxxx:role/some-iam-role
HealthCheck:
Command:
- [ CMD-SHELL,./compose/healthcheck.sh || exit 1 ]
Interval: 10
Retries: 5
StartPeriod: 30
Timeout: 5
TaskRoleArn:
Fn::If:
- 'HasCustomRole'
- !Ref 'Role'
- !Ref "AWS::NoValue"
ContainerDefinitions:
- Name: !Ref 'ServiceName'
Cpu: !Ref 'ContainerCpu'
Memory: !Ref 'ContainerMemory'
Image: !Ref 'ImageUrl'
PortMappings:
- ContainerPort: !Ref 'ContainerPort'
LogConfiguration:
LogDriver: 'awslogs'
Options:
awslogs-group: !Sub ${ServiceName}-service-${EnvironmentName}
awslogs-region: !Ref 'AWS::Region'
awslogs-stream-prefix: !Ref 'ServiceName'
Environment:
- <some other environment that work ok>

最佳答案

关于aws-cloudformation - 不允许使用无关 key [HealthCheck],我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/68006404/

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