YouTube channel focused CDK and CloudFormation (for now)

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.

channel link: https://www.youtube.com/@mrlikrsh


Related discussions:

CloudFormation ALB Redirect support?
CloudFormation now supports SSM Secure String Parameters
Pinpoint availablility in CloudFormation?
CfTransform - Converting/Cleaning CloudFormation between JSON/YAML
CloudFormation Drift Detection now available
AWS Transfer for SFTP cloudformation template
CloudFormation String Help
How and Why to use CloudFormation Macros
Questions on CloudFormation and enterprise use
Cloudformation NACL entry repalaces the other rules?
Show Reddit: CloudFormation Checklist
Delete AWS Access Keys as Soon as They are Created
AWS CloudFormation updates for Amazon API Gateway, AWS CodePipeline, Amazon S3, AWS IAM, Amazon ECS, Amazon RDS, Amazon ES, AWS Lambda and more
Cloudformation Package, Nested Stacks and Lambda local source folders
Is anyone using Firewall manager, and if so, what has your experience with it been?
`puppet apply` in EC2 User Data?
Anyway to tag nodes in ASG set differently in CloudFormation?
AWS Landing zone 2.4.0
CloudFormation: Import S3 Bucket Resource into another Stack
Just created my first stack with CloudFormation. It works, but I'm afraid my security groups/routes are permissive.
New for AWS CloudFormation – Quickly Retry Stack Operations from the Point of Failure
Docker without ECS an antipattern?
Configuring CloudFormation to ignore failing health checks
What's the best practice for integrating CI/CD for ECS applications in the context of a stack managed by CDK?
Unit testing Cloudformation templates just got a lot easier!
How to incorporate CloudFormation to my existing Github Action CI/CD to deploy a dockerize application to EC2?
[rant] CDK for new AWS products
Reverse Terraform for existing AWS Infra
How did you build stronger AWS design instincts while still doing mostly ops work?
If the purpose of CloudFormation Outputs is to export the values why is the Exports property of Outputs optional?
Tips for engineering a multi-region site?
Please make Cloudformation faster!
Troposphere
CloudFormation Updates - 2017-07-05
Autobuild DR site
Looks like S3 buckets' default encryption can be enabled through CloudFormation, now!
Show Reddit: Typeformation: Type Cloudformation templates with pleasure!
Is it a big deal to spin up an ec2 instance in a VPC where all other resources have been created using CloudFormation?
Trouble migrating an existing Elastic Beanstalk app with a Classic ELB to an ALB

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!

Thank you for your videos, explains a lot

I always thought terraform used the sdk to create resources

it does, most stuff isn’t cloudformation under the hood

It does.

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.

oh yeah. I’m a cdk fan boi for sure

Baaah :smiley:

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?

:+1: 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 :face_with_tongue:

In CDK right?

Thank you

Oh no please indulge me!

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:

  1. (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.
  2. run terraform apply

Fixing the situation in cloud formation:

Whole article about it: https://aws.amazon.com/blogs/mt/remediate-drift-via-resource-import-with-aws-cloudformation/

TL;DR:

  1. Change the code - add DeletionPolicy: Retain to the bucket resource
  2. Update the stack to apply it
  3. Change the code - remove the bucket resource
  4. Update the stack again to apply it
  5. Change the code - re-add the bucket resource but with the adjusted value
  6. Update the stack again using the Import Resources action and follow the wizard

btw all this is ClickOps so when you do IaC via CI/CD yo have more problems :slight_smile:

Are you really arguing that there are people out there that prefer the second workflow?

Yeah CDK. I imagine the roots of its limitations is something with cloudformation (as usual)

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

Not just a fair bit, extensive stuff go into them for resource handlers. There was a mirror in Github up until last month - https://github.com/aws-cloudformation/resource-providers-list (had plans to include this but dropped).

Its archived now - https://github.com/aws-cloudformation/aws-cloudformation-resource-providers-rds/tree/database-insights-mode/aws-rds-dbcluster/src/main/java/software/amazon/rds/dbcluster

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

Now, lookups are implemented with cloud control API, and it would get better for most resources.
VPC - https://github.com/aws/aws-cdk/blob/04061f290ac747cf366837a7870335b54a9f70bf/packages/aws-cdk-lib/aws-ec2/lib/vpc.ts#L1336

Can see a lot of commit with lookups using CcApi context provider

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

what does stack separation has to do with drift handling?

what do you mean by manage and review?
so you need the infrastructure composer for visualization purposes?