Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to use cloudformation to create an ecs cluster?

I would like to use a cloudformation template to create my ecs cluster instead of spinning it up by hand, but I have yet to find a way. Is this simply not implemented yet, where you can create an ecs cluster as a resource in your cloudformation template, seems a bit odd they did not include that.

like image 747
alexfvolk Avatar asked Jun 09 '15 01:06

alexfvolk


People also ask

Does ECS use CloudFormation?

Amazon ECS supports creating clusters, task definitions, services, and task sets in AWS CloudFormation. The following examples demonstrate how to create resources with these templates using the AWS CLI. You can also create these resources using the AWS CloudFormation console.


1 Answers

Looks like there is nothing special about ECS that you should not be able to do via cloudformation.

here is a ECS quick stack cf template: https://s3.amazonaws.com/amazon-ecs-cloudformation/Amazon_ECS_Quickstart.template

Checkout: http://www.cloudtp.com/2015/02/04/getting-started-ec2-container-service-ecs/

The key in the cloud formation template is really the AMI id + ECS_CLUSTER definition in /etc/ecs/ecs.config. If you get that right it's basically a normal EC2 CF build.

Also, looks like there are newer AMIs for ECS. Here are the latest: http://docs.aws.amazon.com/AmazonECS/latest/developerguide/launch_container_instance.html

like image 150
Mircea Avatar answered Sep 20 '22 09:09

Mircea