CDK Service Deep Dive
Categories:
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
| Field | Notes |
|---|---|
| Service name | CDK |
| Family | DevOps and Infrastructure |
| Primary purpose | Define infrastructure in general-purpose languages and synthesize to CloudFormation |
| Abstraction model | Code-defined IaC abstraction layer |
| Management model | Managed synthesis workflow plus CloudFormation runtime |
| State model | Source code plus synthesized stack definitions |
| Scope | Works across AWS environments through generated stacks |
| Closest AWS alternatives | CloudFormation, 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.