gpt4 book ai didi

amazon-web-services - Cloudformation AWS::Batch::JobDefinition 属性验证失败:[在 {/} 中遇到不支持的属性:[LogConfiguration]]

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

AWS::Batch::JobDefinition 的 AWS CloudFormation UserGuide 表示存在 LogConfiguration 属性。但是,当我尝试下面的代码时,它会出现错误。

我的CloudFormation代码:

# AWS Batch Job Definition
BatchProcessingJobDefinition:
Type: AWS::Batch::JobDefinition
Properties:
Type: container
JobDefinitionName:
Fn::Join:
- ''
- - !Ref 'AWS::StackName'
- '-BatchJobDefinition'
ContainerProperties:
Image:
Fn::Join:
- ''
- - Ref: AWS::AccountId
- .dkr.ecr.
- Ref: AWS::Region
- '.amazonaws.com/'
- 'batchjob-ecr'
- ':latest'
Vcpus: 2
Memory: 2000
LogConfiguration:
LogDriver: "awslogs"
Options: {
"awslogs-region": "${MY_AWS_REGION}",
"awslogs-group": "/aws/batch/custom/env-queue"
}
RetryStrategy:
Attempts: 1

属性验证失败:[在 {/} 中遇到不支持的属性:[LogConfiguration]]

最佳答案

LogConfigurationContainerProperties 的一部分。所以看来你的缩进不正确:

  BatchProcessingJobDefinition:
Type: AWS::Batch::JobDefinition
Properties:
Type: container
JobDefinitionName:
Fn::Join:
- ''
- - !Ref 'AWS::StackName'
- '-BatchJobDefinition'
ContainerProperties:
Image:
Fn::Join:
- ''
- - Ref: AWS::AccountId
- .dkr.ecr.
- Ref: AWS::Region
- '.amazonaws.com/'
- 'batchjob-ecr'
- ':latest'
Vcpus: 2
Memory: 2000
LogConfiguration:
LogDriver: "awslogs"
Options: {
"awslogs-region": "${MY_AWS_REGION}",
"awslogs-group": "/aws/batch/custom/env-queue"
}
RetryStrategy:
Attempts: 1

关于amazon-web-services - Cloudformation AWS::Batch::JobDefinition 属性验证失败:[在 {/} 中遇到不支持的属性:[LogConfiguration]],我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/66432110/

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