CDK Service Deep Dive

Use this as a fast expert note. CDK is not a replacement for CloudFormation thinking. It is a higher-level way to express infrastructure, but the underlying stack and deployment behavior still matter.

1. Service Identity

FieldNotes
Service nameCDK
FamilyDevOps and Infrastructure
Primary purposeDefine infrastructure in general-purpose languages and synthesize to CloudFormation
Abstraction modelCode-defined IaC abstraction layer
Management modelManaged synthesis workflow plus CloudFormation runtime
State modelSource code plus synthesized stack definitions
ScopeWorks across AWS environments through generated stacks
Closest AWS alternativesCloudFormation, Terraform, Pulumi-like models

2. Default Fit And Non-Fit

  • Right default when teams want reusable, composable infrastructure expressed in code.
  • Strong fit for teams already comfortable with software abstractions and shared platform patterns.
  • Dangerous default when teams hide infrastructure complexity behind abstractions they no longer understand.
  • Wrong default when very simple raw templates or a non-AWS IaC standard fit the org better.

3. Key Design Drivers

  • abstraction discipline
  • synthesis visibility
  • reusable construct ownership
  • reviewability of generated infrastructure
  • dependence on CloudFormation behavior

4. Failure And Cost Notes

  • Main failure mode: clever abstractions reduce transparency and increase surprise during deploys.
  • Main cost driver: abstraction misuse and debugging overhead, not service price.
  • Main anti-pattern: using CDK without understanding the CloudFormation it produces.

5. Expert Warnings

  • Do not let CDK hide infrastructure semantics.
  • Do not create framework-like construct libraries without ownership.
  • Do not skip synthesized template review.
  • Do not choose CDK only for developer comfort if ops clarity gets worse.