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