Skip to content

Instantly share code, notes, and snippets.

@jukkatupamaki
Last active October 19, 2024 15:56
Show Gist options
  • Save jukkatupamaki/fa0013b3a00c1eb3d11cb669fda3afd1 to your computer and use it in GitHub Desktop.
Save jukkatupamaki/fa0013b3a00c1eb3d11cb669fda3afd1 to your computer and use it in GitHub Desktop.
AWS CDK

AWS CDK

Blog posts

https://kvs-vishnu23.medium.com/is-aws-cdk-better-than-terraform-85194e7a42cd

  • A neat explanation of how CDK works compared with Terraform
  • The examples demonstrate well how HCL can be a bit clumsy

https://jsherz.com/aws/cdk/terraform/2023/04/29/terraform-vs-cdk.html

  • Biggest concern regarding CDK seems to be state management and people changing managed infrastructure manually in AWS Console leading to CDK not knowing the truth
  • Mentions https://github.com/cdklabs/cdk-nag that should be part of CDK

https://betterdev.blog/aws-cdk-pros-and-cons/

  • Constructs seen as productivity boosters
  • Using a programming language can get out of hand; should be treated as any other code (who would have thought..)
  • Concurrency used to be a problem; a related issue was merged in 2022 that allows concurrent runs

Videos

https://www.youtube.com/watch?v=D4Asp5g4fp8 - AWS CDK Crash Course for Beginners

  • A decent hands-on introduction to Cloud Development Kit (CDK)
  • Useful CDK CLI commands
    • cdk init for starting a project
    • cdk deploy for deployments – local example shown
    • cdk synth produces a CloudFormation template from CDK app & stacks
    • cdk bootstrap must be run if the AWS account has not used CDK yet
    • cdk watch updates changes to a live environment in AWS - this looks a bit sketchy
  • About constructs
    • Low-level L1 constructs start with Cfn* e.g. CfnBucket
    • Higher-level L2 constructs are the ones that should be used most of the time

https://www.youtube.com/watch?v=T-H4nJQyMig - AWS Cloud Development Kit (CDK) Crash Course

  • An easy to follow introduction to CDK, a bit more theoretical
  • Highlights
    • L1 constructs equal to CloudFormation declarations
    • L2 constructs offer sensible defaults for L1 constructs
    • L3 constructs combine multiple other constructs
    • cdk bootstrap deploys a CDKToolkit CloudFormation stack

Other resources

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment