Re:AWS CloudFormation Best Practices
by logicslave on Wednesday March 31, 2021 @01:37PM
(#26650330)
CDK is strictly superior to cfn
[ Parent
| on HN ]
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?
Re:AWS CloudFormation Best Practices
by zoover2020 on Wednesday March 31, 2021 @02:21PM
(#26650971)
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?
Re:AWS CloudFormation Best Practices
by zoover2020 on Wednesday March 31, 2021 @02:23PM
(#26651002)
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.
Re:AWS CloudFormation Best Practices
by zoover2020 on Wednesday March 31, 2021 @03:38PM
(#26652070)
I stand corrected, thanks.
Not at all. I don't think most people really grasp what CloudFormation is.
Re:AWS CloudFormation Best Practices
by logicslave on Wednesday March 31, 2021 @01:48PM
(#26650512)
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 ..
Re:AWS CloudFormation Best Practices
by simlevesque on Wednesday March 31, 2021 @03:35PM
(#26652014)
Or such as CDK...