0
votes

I am trying to setup a cluster via cloud formation. using the aws sample from http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/quickref-ecs.html

I can't figure out how to name my service . we can name the services when we create the cluster via gui but there seems to be no way to do it via cloud formation.

Is there a way to setup the service as part of the cloud formation script with service name?

1

1 Answers

0
votes

The service name that is generated by the cloudformation is a mixture of random strings, cluster name and the logical name of your service resource in cloud formation.

For example a service like this in cloudformation:

  "App":{
     "Type":"AWS::ECS::Service",
     "DependsOn":"ECSInstance1",
     "Properties":{
        "Cluster":{
           "Ref":"ECSClusterARN"
        },
        "DesiredCount":"1",
        "DeploymentConfiguration":{
           "MaximumPercent":"100",
           "MinimumHealthyPercent":"0"
        },
        "TaskDefinition":{
           "Ref":"DefApp"
        }
     }
  },

Would generate a service name like :: clustername-1QI3WFFV55L8A-App-44HWD4EJO5C1

where App is the logical name of the resource above.