Search code examples
amazon-ec2aws-cloudformationamazon-ecs

Not able to add tag on resource AWS::ECS::Service


I have below definition for ECS service:

        "EcsService": {
            "Type": "AWS::ECS::Service",
            "Properties": {
                "Cluster": { "Ref": "EcsCluster" },
                "TaskDefinition": { "Ref": "EcsTaskDefinition" },
                "DesiredCount": 1
            }
        }

for which CloudFormation service gives below message in Events tab:

enter image description here

FYI.. I have defined tags for only two resources:

Tag for ecs container instance "Tags": [ { "Key": "Name", "Value": { "Fn::Join": ["", [ { "Ref": "AWS::StackName"}, "-instance" ] ]} }]

This is another tag for elb security group "Tags": [ { "Key": "Name", "Value": { "Fn::Join": ["", [ { "Ref": "AWS::StackName" }, "-elb-sg" ] ] } } ]


1) What is the meaning of this error? For EcsService

2) How to resolve it?


Solution

  • Basically, in order do tagging in ECS, you need to opt in with new ECS ARN format as mentioned here. It's still under opt-in period till end of this year here.

    Kindly note that above is just warning, it will not stop or fail the cloudformation.