Hacker News new | ask | show | jobs
by logicslave 1907 days ago
CDK is strictly superior to cfn
5 comments

Reading CDK's introduction page, it seems that, similar to CloudFormation, it uses pre-made components, just at a higher level. Those components are then translated into a CloudFormation template[0]. Is that correct?

Might it be more accurate to state that CDK is a higher level version of CloudFormation, that abstracts away unimportant details?

[0] https://aws.amazon.com/cdk/

Yes, exactly. CDK is the abstraction which compiles down to CloudFormation. You can see CF here as the assembly that gets generated.
As someone who's used CDK for a few months and never handcoded CF, that sounds completely correct. If you're comfortable with Python, here's a simple but non-trivial architecture you can check out: https://github.com/linz/geospatial-data-lake/blob/master/app....
CDK is essentially CFN template generation tool for TypeScript
I couldn't agree more. Cloudformation is a nightmare in my opinion and never should have seen public release. CDK is what Cloudformation always should have been.
CDK is the first time I experienced the benefits of TypeScript. If nothing else it’s a great playground to learn that stack. Testing stacks in the CDK is pretty rad.
What would you flag as the biggest differences between the two?
CDK is managed IaC, allowing compile-time checks and also to debug your infrastructure.

CloudFormation is just JSON or YAML (treated as assembly by CDK, by spitting out a CFN template after synthesis)

This is not correct. CDK is not "managed IaC" - the management is done by CloudFormation. CDK is a generator for the JSON or YAML of CloudFormation, which is fully responsible for the execution and management of provisioning.
I stand corrected, thanks.
Not at all. I don't think most people really grasp what CloudFormation is.
How so? CFN is terrible to write and maintain, cdk abstracts alot of the difficulty and makes reusable components possible. I work at Amazon...
Doing it by hand is certainly painful, but with libraries such as Troposphere it isn't so bad ..
Or such as CDK...