What is the AWS CDK?
Welcome to the AWS Cloud Development Kit (AWS CDK) Developer Guide. This document provides information about the AWS CDK, which is a software development framework for defining cloud infrastructure in code and provisioning it through AWS CloudFormation.
AWS CloudFormation enables you to:
-
Create and provision AWS infrastructure deployments predictably and repeatedly.
-
Leverage AWS products such as Amazon EC2, Amazon Elastic Block Store, Amazon SNS, Elastic Load Balancing, and Auto Scaling.
-
Build highly reliable, highly scalable, cost-effective applications in the cloud without worrying about creating and configuring the underlying AWS infrastructure.
-
Use a template file to create and delete a collection of resources together as a single unit (a stack).
Use the AWS CDK to define your cloud resources in a familiar programming language. The AWS CDK supports TypeScript, JavaScript, Python, Java, and C#/.Net.
Developers can use one of the supported programming languages to define reusable cloud components known as Constructs. You compose these together into Stacks and Apps.

Why use the AWS CDK?
Let's look at the power of the AWS CDK. Here is some code in an AWS CDK project to create an Amazon ECS service with AWS Fargate launch type (this is the code we use in the Creating an AWS Fargate service using the AWS CDK).
This class produces an AWS CloudFormation template of more than 500 lines
Other advantages of the AWS CDK include:
-
Use logic (if statements, for-loops, etc) when defining your infrastructure
-
Use object-oriented techniques to create a model of your system
-
Define high level abstractions, share them, and publish them to your team, company, or community
-
Organize your project into logical modules
-
Share and reuse your infrastructure as a library
-
Testing your infrastructure code using industry-standard protocols
-
Use your existing code review workflow
-
Code completion within your IDE
Developing with the AWS CDK
Code snippets and longer examples are available in the AWS CDK's supported programming languages: TypeScript, JavaScript, Python, Java, and C#. See AWS CDK examples for a list of the examples.
The AWS CDK Toolkit is a command line tool for interacting with CDK apps. It enables developers to synthesize artifacts such as AWS CloudFormation templates, deploy stacks to development AWS accounts, and diff against a deployed stack to understand the impact of a code change.
The AWS Construct Library includes a module for each AWS service with constructs that offer rich APIs that encapsulate the details of how to create resources for an Amazon or AWS service. The aim of the AWS Construct Library is to reduce the complexity and glue logic required when integrating various AWS services to achieve your goals on AWS.
There is no charge for using the AWS CDK, but you might incur AWS charges for creating
or
using AWS chargeable resources, such
as running Amazon EC2 instances or using Amazon S3 storage. Use the AWS Pricing Calculator
Contributing to the AWS CDK
Because the AWS CDK is open source, the team encourages you to contribute to make
it an even
better tool. For details, see Contributing
Additional documentation and resources
In addition to this guide, the following are other resources available to AWS CDK users:
-
cdk.dev
community hub, including a Slack channel -
AWS Developer Blog
CDK category
About Amazon Web Services
Amazon Web Services (AWS) is a collection of digital infrastructure services that developers can use when developing their applications. The services include computing, storage, database, and application synchronization (messaging and queueing).
AWS uses a pay-as-you-go service model. You are charged only for the services that you — or your applications — use. Also, to make AWS useful as a platform for prototyping and experimentation, AWS offers a free usage tier, in which services are free below a certain level of usage. For more information about AWS costs and the free usage tier, see Test-Driving AWS in the Free Usage Tier.
To obtain an AWS account, go to aws.amazon.com