I’m not sure if this post goes against this community rules. Please take this off if this goes against it.
I’m an ex-AWS employee worked in premium support. I started posting on this channel mainly to gain confidence while speaking and being better at it. Since CDK and CloudFormation was something that I worked on for past 3 years, it was easy to get started for me. I intend to upload once or twice per week and be consistent at it.
No pressure to subscribe, but feedbacks are welcome or if you’d like to see some topics being discussed.
I’ve never been keen on looking into cloud formation closely since I usually do it all through terraform. However I might give it a shot to understand what the hell is actually happening behind the scenes. Thanks!
CDK uses programmatic patterns to build infrastructure. This gives you advanced programming language concepts to define infrastructure. CDK synthesizes a cloudformation template (stack) to deploy.
Terraform is declarative. It does have some power on loops and local functions, but isn’t as powerful as a native language. It creates a plan with dependency order, then makes API calls to create the resources.
What’s the point of having the full power of Typescript that in the end still just generates down to Cloud Formation so it is still limited by its deficits.
CFN doesn’t even have data sources without having to deploy a whole lambda to obtain the needed info.
In fact Terraform does everything better:
you have data sources
fixing drift is trivial
runs faster
is easier to read
Good luck forming a team of people to support IaC written in CDK … Learning curve is much higher, documentatuon is worse, performance is slower, drift resolution is abysmal, features are lacking? It’s even limited to AWS only. This is a glorified yaml generator!
And the tech behind it is so terrible when compared to anything else that I genuinely believe in AWS when people do something bad they are assigned to the Cfn / CDK team as punishment.
Why would one use that?
Is this a Plato cave situation?
recommend you to have a video on how and why using resources that you create have different capabilities than using resources that you import. This limitation concept always has confused me.
I generally agree that cloudformation is a much more constrained approach. But there’s a significant amount of pros/cons to it. For example some people actually prefer the approach to handling drift and the defected way in your perception is actually a nice feature. I could go into detail on this but I’m too lazy
I really want to know what pros there are in Cfn compared to Terraform (other than that one where you don’t have to create a bucket for a state yourself since Cfn creates a bucket under the hood)!
About drift remediation I will compare using the following trivial example.
Imagine a code where an s3 bucket is defined with versioning = true but someone turned it off from AWS Console.
Fixing the situation in terraform:
(optional) if you want to preserve the external change change the code to have versioning = false; otherwise don’t do anything and go to step 2.
I just watched two of them - I found what you chose to talk about out interesting and you communicated it well. Well done!
Do you know whether resource handlers autogenerated or does a fair bit of implementation go into them?
Also, why can I only add one GSI at a time to a DybamoDB table after initial create? (I realise this is probably a dynamo thing not a CF thing but boy is it painful generating multiple change sets when I need to add multiple GSIs for a new feature).
Actually don’t know, resource handlers are not generic (like more logic goes into it than CRUDL) maybe some limitations when the resource was being modelled or a bottleneck for rollback that prevented.
Ah the lookups, those wont import or bring that resource into your stack like CloudFormation does. When CFN manages the resource it can query and get the data which you can refer in GetAtt and Ref’s, but this was like a placeholder and some resources had implemented the lookups (like VPC, it does an API call to your account, queries the subnets and classified them into private or public).
i used to do the second approach with cdk (no one is really talking about CF outside of it being generated by cdk) but then i started separating my stacks and don’t deal with this issue at all really.
my biggest con for terraform is that i don’t get cloud formation to manage and review may stack and I’m not sure terraform has a way for me to visualize my resources like CF console