Hacker Newsnew | past | comments | ask | show | jobs | submitlogin
Level up CloudFormation with VS Code (dannys.space)
26 points by dsteenman on April 25, 2020 | hide | past | favorite | 13 comments


Most of the time when I see more complication on top of cloudformation, what you really want is terraform.


My 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.


I’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.


That’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.


Cdk 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


That’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.


CDK 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


Yes 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.


i 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)


Or if you have to manage 100s of accounts stacksets can be really helpful as well.


Shameless 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


Here are some additional things you can do: https://hodgkins.io/up-your-cloudformation-game-with-vscode


Your post definitely contains some good tips! Thanks for sharing!




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: