4 ms·
Level up CloudFormation with VS Code
- booi 6y agoMost of the time when I see more complication on top of cloudformation, what you really want is terraform.
- strangelove026 6y agoMy preferred tool. A few of the biggest selling points (for me): - It feels like writing code instead of writing yaml. - To the above you can define your own parameter object types in Terraform. To create a list parameter in cloudformation requires `CommaDelimitedList` which can only contain strings. - To the above two points, your Terraform stacks can be DRY'd up a bit which makes them easier to read than a massive 1000 line cloudformation file. - Terraform is run completely in your console which is faster and improves the developer experience. - Resources are never "conditionally" replaced. They either are or are not. Don't know if this is still a thing in Cloudformation land but the resources change diff Terraform gives you is completely clear. That all said I don't mind writing Cloudformation, but (again in my opinion) Terraform is vastly more powerful.
- tracer4201 6y agoI’ll try it out. I’ve been writing CloudFormation and using SAM templates for some recent projects involving Lambda. Defining my general resources is easy enough but having to define through IAM roles and policies turns into a real pain super quick.
- dsteenman 6y agoThat’s an option for sure! For more complicated projects my preference goes to CDK. But for smaller projects CloudFormation is fine enough, especially if you use the extensions I described in the article.
- mxz3000 6y agoCdk is the way to go for pretty much anything. It's so much faster to develop an infrastructure in cdk than it is in cloudformation it's insane
- dsteenman 6y agoThat’s true if you’re familiar with programming and know how CloudFormation works. Adding a framework or abstraction layer requires certainly more skills from your end. This article is more suitable for people who want to deploy small projects quickly and don’t want to invest time to learn a framework.
- jblarneyforward 6y agoCDK is significantly more comprehensible than CloudFormation. Particularly: it has patterns and convenciones baked in that let a few lines of code translate into 100s of lines of CloudFormation
- dsteenman 6y agoYes thats the added value of having an abstraction layer like CDK. If you are familiar with coding then CDK is the way to go off course.
- querulous 6y agoi find cfn has a higher barrier to entry and is more verbose for small projects but scales much better than terraform (which breaks down entirely once you need to manage thousands of resources across more than handful of providers) (yes i've tried terragrunt, it's not an answer)
- dsteenman 6y agoOr if you have to manage 100s of accounts stacksets can be really helpful as well.
- MattHodge 6y agoHere are some additional things you can do: https://hodgkins.io/up-your-cloudformation-game-with-vscode https://hodgkins.io/up-your-cloudformation-game-with-vscode
- dsteenman 6y agoYour post definitely contains some good tips! Thanks for sharing!
- markl42 6y agoShameless plug opportunity! On the topic of "more complication on top of cloudformation", I made a tool that lets you split up cloudformation files with import syntax. https://github.com/magicmark/cf-merge https://github.com/magicmark/cf-merge