Skip to main content
Cloud / AWS / Products / AWS CDK: Infrastructure as Code in Programming Languages

AWS CDK: Infrastructure as Code in Programming Languages

The AWS Cloud Development Kit defines infrastructure in TypeScript, Python, Java, C#, or Go and provisions it through AWS CloudFormation.

Developer Tools
Pricing Model Per the FAQ there is no additional charge for the AWS CDK; you pay for the AWS resources you create with it
Availability Locally installed open source tool with no Region binding; deployment happens through AWS CloudFormation into the AWS Region you choose
Data Sovereignty Determined by the target Region of the CloudFormation deployment
Reliability N/A (open source framework without its own SLA) SLA

What is the AWS CDK?

The AWS Cloud Development Kit (AWS CDK) is an open-source framework for describing cloud infrastructure in a programming language and provisioning it through AWS CloudFormation. Instead of maintaining templates, you use language features such as parameters, conditionals, loops, composition, and inheritance.

The CDK has two primary parts: the AWS CDK Construct Library, a collection of pre-written modular and reusable constructs, and the AWS CDK Toolkit with the CDK CLI and the CDK Toolkit Library. Running a CDK application produces complete CloudFormation templates that are submitted to CloudFormation.

A note on versions: this documentation describes CDK v2. Per the documentation, CDK v1 entered maintenance on June 1, 2022 and ended support on June 1, 2023.

Core Features

  • Infrastructure in your own language: TypeScript, JavaScript, Python, Java, C#/.NET, and Go (per the FAQ in developer preview)
  • Constructs: Low-level constructs define individual CloudFormation resources, high-level constructs define larger application components with sensible, secure defaults
  • Stacks and apps: Constructs are composed into stacks and apps and deployed together
  • Provisioning through CloudFormation: Predictable, repeatable deployments with rollback on error
  • CDK Toolkit: Synthesis and deployment through the CDK CLI or programmatically through the CDK Toolkit Library
  • Construct Hub: Public registry of open-source CDK libraries at constructs.dev
  • Construct Programming Model: The same model is also available for Terraform (CDKtf), Kubernetes (CDK8s), and project configuration (Projen)
  • Open source: Apache License, Version 2.0, developed in the aws/aws-cdk GitHub repository

Typical Use Cases

Version infrastructure and application code together: Infrastructure, application code, and configuration live in one place, so you have a complete, cloud-deployable system at every milestone.

Enforce your own standards: Teams build their own constructs with secure defaults and share them across the organization or publicly.

Software engineering practices for infrastructure: Code reviews, unit tests, and source control apply to the infrastructure definition.

Deploy complex platforms: Per the documentation, a few lines of CDK code can produce a CloudFormation template of more than 500 lines and dozens of resources — for example an ECS service on AWS Fargate behind a load balancer.

Benefits

  • Familiar programming languages with IDE support such as syntax highlighting and code completion
  • Less code for the same infrastructure thanks to high-level constructs
  • Deployment through CloudFormation, therefore predictable and with rollback
  • Reusable building blocks for consistent security and compliance requirements
  • No additional charge for the framework itself
  • Open source under Apache 2.0

Integration with innFactory

As an AWS Reseller, innFactory supports you with the AWS CDK: setting up a CDK project structure with apps, stacks, and custom constructs, migrating existing CloudFormation templates, establishing tests and reviews for infrastructure code, and integrating the CDK CLI into your CI/CD pipelines.

Typical Use Cases

Infrastructure as code in your own programming language
Reusable infrastructure building blocks
Rolling out serverless and container platforms
Organization-wide standards as constructs

Technical Specifications

Components AWS CDK Construct Library and the AWS CDK Toolkit consisting of the CDK CLI and the CDK Toolkit Library
Deployment CDK applications compile down to CloudFormation templates (JSON/YAML) and are provisioned through CloudFormation
Ecosystem Construct Hub (constructs.dev) and the Construct Programming Model with CDK for Terraform, CDK for Kubernetes, and Projen
Languages TypeScript, JavaScript, Python, Java, C#/.NET and Go (per the FAQ in developer preview)
License Apache License, Version 2.0; source code in the aws/aws-cdk GitHub repository
Model Constructs are composed into stacks and apps

Frequently Asked Questions

What is the AWS CDK?

Per the documentation, the AWS Cloud Development Kit (AWS CDK) is an open-source software development framework for defining cloud infrastructure in code and provisioning it through AWS CloudFormation. It consists of the AWS CDK Construct Library and the AWS CDK Toolkit, which includes a command line tool (CDK CLI) and a programmatic library (CDK Toolkit Library).

Which programming languages are supported?

Per the documentation, the AWS CDK supports TypeScript, JavaScript, Python, Java, C#/.NET, and Go. The FAQ lists Go as being in developer preview.

What are constructs, stacks, and apps?

Constructs are reusable cloud components. Low-level constructs define individual CloudFormation resources and their properties; high-level constructs define larger components of your application with sensible, secure defaults. You compose constructs into stacks and stacks into apps, which are then deployed through CloudFormation.

How does the CDK relate to AWS CloudFormation?

Per the FAQ, when CDK applications are run they compile down to fully formed CloudFormation JSON/YAML templates that are then submitted to the CloudFormation service for provisioning. Per the documentation, if you already know CloudFormation you do not have to learn a new IaC management service.

What does the AWS CDK cost?

Per the FAQ there is no additional charge for the AWS CDK. You pay for the AWS resources created with the CDK in the same way as if you had created them manually. The CDK is distributed under the Apache License, Version 2.0.

Where can I find ready-made constructs?

Per the documentation, the Construct Hub at constructs.dev is an online registry where you can find, publish, and share open-source AWS CDK libraries. AWS Solutions Constructs additionally provide vetted patterns.

Note: All product information on this page has been compiled with care, but is provided without guarantee and may be outdated or incomplete. Cloud services evolve rapidly — features, pricing, SLAs, and availability change frequently. Authoritative and up-to-date information can only be found on the official product page of AWS (official documentation). This page does not represent an offer by AWS.

AWS Cloud Expertise

innFactory is an AWS Reseller with certified cloud architects. We provide consulting, implementation, and managed services for AWS.

Ready to start with AWS CDK: Infrastructure as Code in Programming Languages?

Our certified AWS experts help you with architecture, integration, and optimization.

Schedule Consultation