Skip to main content

Menu

LEVEL 0
0/5 XP
HomeAboutTopicsPricingMy VaultStats

Categories

πŸ€– Artificial Intelligence
☁️ Cloud and Infrastructure
πŸ’Ύ Data and Databases
πŸ’Ό Professional Skills
🎯 Programming and Development
πŸ”’ Security and Networking
πŸ“š Specialized Topics
HomeAboutTopicsPricingMy VaultStats
LEVEL 0
0/5 XP
GitHub
Β© 2026 CheatGridβ„’. All rights reserved.
Privacy PolicyTerms of UseAboutContact

AWS Cloud Development Kit (CDK) Cheat Sheet

AWS Cloud Development Kit (CDK) Cheat Sheet

Back to DevOps
Updated 2026-05-22
Next Topic: Azure DevOps Cheat Sheet

The AWS Cloud Development Kit (CDK) is an open-source software development framework that lets you define cloud infrastructure using general-purpose programming languages β€” TypeScript, JavaScript, Python, Java, C#, and Go β€” which the CDK then synthesizes into AWS CloudFormation templates for deployment. It sits squarely in the infrastructure-as-code (IaC) space and is AWS's primary answer to the developer-productivity limitations of writing raw YAML or JSON. The key insight that separates CDK from declarative IaC tools is that your infrastructure is real code: you get loops, conditionals, type-checking, unit tests, and package managers to compose and share reusable building blocks called constructs. Because CDK compiles to CloudFormation under the hood, it inherits CloudFormation's change-set model, resource limits (500 per stack), and eventual consistency behavior β€” understanding that contract is what separates smooth CDK users from frustrated ones.

What This Cheat Sheet Covers

This topic spans 18 focused tables and 114 indexed concepts. Below is a complete table-by-table outline of this topic, spanning foundational concepts through advanced details.

Table 1: Construct Levels (L1 / L2 / L3)Table 2: CDK App Project Structure and LifecycleTable 3: CDK BootstrappingTable 4: Supported Languages and jsiiTable 5: Environment-Aware DeploymentsTable 6: Context and LookupsTable 7: Assets and BundlingTable 8: IAM, Permissions, and GrantsTable 9: Aspects and Policy EnforcementTable 10: Escape Hatches and Custom ResourcesTable 11: CDK Pipelines (CI/CD)Table 12: Testing CDK CodeTable 13: Tokens, Lazy Values, and Resource NamingTable 14: Resource Lifecycle and Removal PoliciesTable 15: Cross-Stack References and Stack OrganizationTable 16: Sharing Constructs as Packages (jsii and Construct Hub)Table 17: CDK Toolkit Comparison (CDK vs Terraform vs SAM)Table 18: Common Gotchas and Pitfalls

Table 1: Construct Levels (L1 / L2 / L3)

Constructs are the core abstraction in CDK β€” composable classes that represent one or more AWS resources. They are organized into three abstraction levels, and choosing the right level for each situation is the single most important CDK design decision.

TypeExampleDescription
L1 construct (CFN resource)
new s3.CfnBucket(this, 'Bucket', { bucketName: 'my-bucket' })
β€’ Direct 1-to-1 mapping to a CloudFormation resource
β€’ named Cfn<ResourceType>
β€’ no defaults, full control over every property
L2 construct (curated)
new s3.Bucket(this, 'Bucket', { encryption: BucketEncryption.KMS })
Intent-based API that wraps one CloudFormation resource with sensible defaults, best-practice security policies, and helper methods (grants, metrics, event notifications). Most commonly used level.
L3 construct (pattern)
new ecsPatterns.ApplicationLoadBalancedFargateService(this, 'Svc', { ... })
β€’ Opinionated combination of multiple resources that deliver a complete architecture
β€’ fewest lines of code for the most infrastructure

More in DevOps

  • Ansible Cheat Sheet
  • Azure DevOps Cheat Sheet
  • AI-Powered DevOps Copilots and Agents Cheat Sheet
  • Datadog Observability Platform Cheat Sheet
  • Immutable Infrastructure Cheat Sheet
  • Pulumi Programmatic IaC Cheat Sheet
View all 49 topics in DevOps