AWS CDK

Resource Plane
IaC
Source
Open
What is AWS CDK?
AWS Cloud Development Kit (AWS CDK) is an open-source development framework for defining cloud infrastructure and application resources in familiar programming languages. It helps teams define infrastructure as code and accelerate development on AWS.

Profile

AWS Cloud Development Kit (CDK) is an open-source infrastructure as code framework that enables developers to define cloud resources using familiar programming languages including TypeScript, JavaScript, Python, Java, C#/.Net, and Go. Developed and maintained by Amazon Web Services, CDK synthesizes imperative code into AWS CloudFormation templates, combining the expressive power of general-purpose programming languages with CloudFormation's proven state management capabilities. The framework provides multiple abstraction levels through its construct library, from low-level CloudFormation resource mappings to high-level multi-service patterns that implement AWS best practices by default. As a mature, actively maintained project with weekly releases, CDK has become essential infrastructure for organizations seeking to leverage programming language features like loops, conditionals, and inheritance when defining cloud infrastructure.

Focus

AWS CDK addresses the complexity gap between low-level infrastructure configuration and high-level application development by enabling developers to define cloud resources using the same programming languages they use for application code. The framework eliminates the need to manually write or maintain lengthy JSON or YAML templates while retaining CloudFormation's robustness. Organizations use CDK to capture infrastructure patterns as reusable constructs that enforce governance, compliance, and quality standards across projects. Platform engineers and DevOps teams benefit from treating infrastructure definitions with the same rigor as application code, including version control, testing, and composition patterns. Development teams leverage CDK to standardize deployments, reduce repetition through programmatic abstractions, and accelerate infrastructure provisioning without becoming experts in every AWS service's configuration details.

Background

AWS CDK originated as an Amazon Web Services initiative to provide developers with a more productive alternative to writing CloudFormation templates directly. The framework is developed and maintained by AWS as an open-source project hosted on GitHub under the Apache License 2.0, with active community contributions managed through a structured process. AWS CDK v1 entered maintenance mode in June 2022 and ended support in June 2023, with development efforts focused on v2, which incorporates architectural improvements and lessons learned from the initial version. The project maintains comprehensive documentation through the AWS CDK Developer Guide and publishes reference implementations in the aws-cdk-examples repository. The Construct Hub serves as an online registry where developers discover, publish, and share both official AWS constructs and community-created libraries.

Main features

Multi-level construct abstraction system

AWS CDK provides three construct levels serving distinct infrastructure development purposes. L1 constructs map directly to CloudFormation resources with no additional abstraction, named with a "Cfn" prefix and automatically generated from CloudFormation specifications. L2 constructs offer curated, intent-based APIs with sensible defaults, best practice security policies, and helper methods that simplify property definition and permission configuration. L3 constructs represent complete architectural patterns combining multiple services configured according to AWS best practices. This hierarchy enables developers to choose appropriate abstraction levels, from fine-grained control over resource properties to deploying entire multi-service architectures with single construct instantiations, supporting both detailed customization and rapid deployment scenarios.

Infrastructure testing with standard frameworks

The framework enables comprehensive infrastructure code testing using standard testing frameworks like Jest for TypeScript/JavaScript or Pytest for Python. Fine-grained assertions verify specific aspects of synthesized CloudFormation templates, testing that resources with expected properties exist and providing excellent regression detection for infrastructure changes. Snapshot tests compare entire synthesized templates against previously stored baselines, enabling confident refactoring while detecting unintended modifications. This testing approach treats infrastructure definitions as code requiring the same rigor as application code, with tests synthesized from CDK applications creating predictable, reproducible validation processes. Organizations implement test-driven development practices for infrastructure, ensuring changes maintain expected behavior across environments.

Accelerated development with hot swapping

CDK Watch monitors code and assets for changes, automatically performing optimal deployments without manual intervention. The feature intelligently determines deployment strategies, using hotswap deployments that bypass CloudFormation's full deployment process when possible. For CDK assets like Lambda handler code, ECS container images, or Step Functions state machines, the CLI uses AWS service APIs to directly apply changes, dramatically accelerating feedback loops during development. When changes require full CloudFormation deployments, the framework automatically falls back to standard processes. This dual-mode approach enables developers to choose between rapid iteration during development and robust validation for production deployments, significantly reducing the time between code changes and deployed infrastructure.

Abstract pattern of purple and black halftone dots forming a wave-like shape on a black background.