Search code examples
aws-cloudformationamazon-ecs

Name ECS service via CloudFormation


http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecs-service.html

Been trying to work out how to give my ECS service a name to no avail, doesn't look like it's possible from the CloudFormation docs.

At the moment it's auto-generating the service name as:

<stack name>-<logical id>-<seemingly random id>

Not ideal for giving to the app dev teams, also as it's subject to change if we decide to rebuild the service I guess.

Anyone got any suggestions for how they handled this one?

PS. The setup we have is that we have a git repo for Cloudformation templates with a CI job responsible for building the infrastructure. We then hard code the service name into the CI job in the service git repo.


Solution

  • Use the ServiceName property: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecs-service.html#cfn-ecs-service-servicename