DEV Community

Discussion on: How to deploy a service to Amazon Elastic Container Service with CloudFormation?

Collapse
 
sambenskin profile image
Sam Benskin

Interesting article, I shall have to give this a try. Have you looked into Terraform from Hashicorp? It's an easy way to define infrastructure for docker containers much like you've done but it can be used across different platforms. I looked how it can work out what you've got and what you want and only make changes that it needs to to make the target match your definition, bringing them in sync.

Collapse
 
miensol profile image
Piotr Mionskowski

I'm glad you found the article interesting.

I did look at Terraform a while back but I remember that I wasn't sure if:

  • if the additional abstraction layer of AWS will not make things harder to configure
  • it is and is kept up to date with latest AWS and other platform offerings
  • I will be able to configure all the bells and whistles that sometimes are required Perhaps you could share some thoughts, links on these points?

The truth is that we use mostly AWS for hosting solutions we build for our clients so we're it's the most familiar platform to us.

The cloudform aim is to use fully-fledged programming language to build the template. There are Transforms too but I find it somewhat easier to use cloudform to reduce the size of infrastructure configuration file.

Collapse
 
sambenskin profile image
Sam Benskin

When we looked into a solution, we didn't particularly want to be tied to amazon, although the implementation you make in terraform is quite specific. From memory, it seemed easier to use and kept everything in sync well so that's our reasons for choosing it.

I haven't checked recently, but terraform seemed to be right up to date with the latest AWS features, so there weren't any causes for concern there for us, but that might have changed (hopefully not!).

Collapse
 
jillesvangurp profile image
Jilles van Gurp

Terraform is a more sane way to drive cloudformation essentially (when you run it on aws). Cloudformation has gotten slightly better over the years with yaml support but it is still quite messy to deal with.

I find cloudformation gets rather unwieldly and it is rather unforgiving if you have a tiny mistake in your thousands of lines of templates. Add to that the lengthy edit, deploy, wait for it, oh shit that didn't work either cycles and you are looking at hell. I seem to get stuck with doing relatively simple changes quite often because of this. I sort of dread having to change anything because I know it is going to suck up hours of my time when I sit down and do it.

For this reason, I try to minimize the scope of what cloudformation does. Anti patterns here are having lots of software provisioning driven by cloudformation, running it every time you need to deploy a docker container, copy pasting large bits of yaml between stacks (this is where terraform provides better tooling), excessive polling happening either in aws or in your custom templates waiting for stuff to come up, etc.

Collapse
 
miensol profile image
Piotr Mionskowski

You might like cloudform.