4 ms·
How do folks feel about Terraform vs Cloudformation for AWS-only deployments these days? Do we have a clear winner? I remember even a year back there were certa
by akurilin 10y ago
How do folks feel about Terraform vs Cloudformation for AWS-only deployments these days? Do we have a clear winner? I remember even a year back there were certain features of AWS that were being made available through Terraform first before you could configured them in CF, so the choice was somewhat non-obvious.
- typicalrunt 10y agoYou're only going to get anecdotes and opinions. Given the inputs you stated, I am full CF because I don't want to manage state files, and I want some more advanced things like Deletion policies and automatic tagging of resources with the stack info. We use these tags in a lot of lookup scripts when operating on the infrastructure.
- truetuna 10y agoTerraform is great but there are certain things that I still use Cloudformation for (simply because you can't do it right now using Terraform). One example is rolling updates on your ASGs. Last time I checked you can't do it via the aws_autoscaling_group resource.
- webo 10y agoFor this we have been creating the CloudFormation in Terraform itself. CF is a giant mess to work with.
- truetuna 10y agoYeah, agreed. Unfortunately when you inevitably make changes to your CF config, `terraform plan` doesn't help because it's likely you changed something inside the `template_body` and Terraform just knows the string has changed and doesn't tell you what part of the config changed. Parameterising as much as you can helps.
- devonkim 10y agoA lot of people including myself have used tools to generate CF or Heat templates in the absence of a need for cross-cloud compatibility that Terraform offers. You can use Troposphere, Stacker, or anything else that can intelligently generate and manage component information as a JSON or Yaml file and get much of the power of Terraform - perhaps more given the option of a full language rather than an external, declarative DSL. I still haven't found an idiomatic, elegant API that can manage all those template references. The primary advantage Cloudformation has for myself is a lack of need to manage the state that Terraform spends so much effort upon. In fact, Cloudformation does this fairly opaquely but was much more obvious when I tried to deploy a CF stack when S3 was down a while ago - being able to use an alternate state file location would have been handy then.
- akurilin 10y agoIn fact our very own jdreaver wrote a Haskell EDSL for generating CloudFormation templates, this seems to be not uncommon among companies who want to do infrastructure as code with that ecosystem: https://github.com/frontrowed/stratosphere https://github.com/frontrowed/stratosphere
- ubercow 10y agoEver since they introduced the YAML syntax CF has been so much nicer to work with.
- Corrado 10y agoI looked at multi-platform tools initially, but decided that CFN was probably much more suitable for my AWS-only needs. There are several limitations with CFN (especially early on) so I built an engine[0] in NodeJS & Handlebars that allows you to create complex CFN templates from simple JSON "blueprints". Some of the things I like about it are that it allows me to have multiple environments (Prod, Dev, QA, etc.) where each stack can be slightly different but still related. It also has global variables (ie. office IP address) that allow you to change something in one place and have it be updated everywhere. Finally, AWS resources are defined in Handlebars partials it's easy to add new ones or maintain existing ones as AWS adds more functionality. It's still a work in progress and I updated it almost every week. If you like working with NodeJS I'm always looking for help. :) [0] https://www.npmjs.com/package/cfn-builder https://www.npmjs.com/package/cfn-builder