When running a CloudFormation Script that declares some environment variables the following error is raised with CloudFormation:
CREATE_FAILED AWS::ECS::TaskDefinition ECSTaskDefinition Encountered unsupported property Name
Which relates to the following resource within the CloudFormation template
"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"
}
}
]
}
}
I'm not sure what's wrong with the above as from the documentation the Environment block is declared correctly -https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecs-taskdefinition-containerdefinitions-environment.html
Any help would be much appreciated.