运行声明一些环境变量的 CloudFormation 脚本时,CloudFormation 会引发以下错误:
CREATE_FAILED AWS::ECS::TaskDefinition ECSTaskDefinition Encountered unsupported property Name
这与 CloudFormation 模板中的以下资源有关
"ECSTaskDefinition": {
"Type": "AWS::ECS::TaskDefinition",
"Properties": {
"Cpu": "256",
"ExecutionRoleArn": {
"Fn::GetAtt": [
"ECSTaskRole",
"Arn"
]
},
"Family": {
"Ref": "AWS::StackName"
},
"Memory": "500",
"NetworkMode": "awsvpc",
"RequiresCompatibilities": [
"FARGATE"
],
"ContainerDefinitions": [
{
"Environment": [
{
"Name": "cloudsearch:search_endpoint",
"Value": {
"Ref": "CloudSearchDomainServiceUrl"
}
}
],
"Essential": true,
"Image": {
"Ref": "ContainerImage"
}
}
]
}
}
我不确定上述有什么问题,因为从文档中正确声明了 Environment 块 - https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecs-taskdefinition-containerdefinitions-environment .html
任何帮助将非常感激。