Q: What is AWS CDK?
The AWS Cloud Development Kit (AWS CDK) is an open-source software development framework for defining cloud infrastructure as code with modern programming languages and deploying it through AWS CloudFormation.
Q: What can I do with the AWS CDK CLI?
You can use the AWS CDK Command Line Interface (CLI) to interact with your CDK applications. CDK CLI allows you to list the stacks defined in your CDK app, synthesize the stacks into CloudFormation templates, determine the differences between running stack instances and the stacks defined in your CDK code, and deploy stacks to any public AWS Region.
Q: How does AWS CDK work?
Use the AWS CDK framework to author AWS CDK projects, which are executed to generate CloudFormation templates. AWS CDK projects can be executed using the AWS CDK command line or in a continuous delivery system.
Q: How do I get started with AWS CDK?
The best way to get started with AWS CDK is to work through the Getting Started section of the AWS CDK Developer Guide. Within minutes, you can define and deploy your first AWS CDK application. For a more in-depth guided tutorial, check out https://CDKworkshop.com.
Q: Are there sample AWS CDK applications that I can use as a starting point?
Yes, you can find a number of AWS CDK examples, in multiple programming languages, at https://github.com/aws-samples/aws-cdk-examples. The AWS Developer Guide also includes examples at https://docs.aws.amazon.com/cdk/latest/guide/examples.html.
Q: Where can I find the AWS CDK source code?
The AWS CDK code is open-source, available through GitHub at https://github.com/awslabs/aws-cdk.
Q: How do I migrate CDK applications from version 1 to version 2?
To migrate your app to AWS CDK v2, first update the feature flags in cdk.json. Then update your app's dependencies and imports as necessary for its programming language. You can learn more at: https://docs.aws.amazon.com/cdk/latest/guide/work-with-cdk-v2.html
Q: How can I contribute?
We are developing AWS CDK in the open, and we welcome any who want to contribute to our code base. You can learn more at https://github.com/awslabs/aws-cdk/blob/master/CONTRIBUTING.md.
Q: What programming languages does AWS CDK support?
Q: In which regions can I use AWS CDK?
AWS CDK is available to define and deploy AWS resources in all public regions. Since AWS CDK leverages the CloudFormation service, refer to Regional Products and Services for details about specific resource availability per AWS Region.
Q: Are there any resource limits or restrictions applied to AWS CDK?
Since AWS CDK leverages CloudFormation, AWS CDK applications are subject to the same limits imposed by the CloudFormation service.
Q: What is the relationship between AWS CDK and AWS Solutions Constructs?
AWS Solutions Constructs is an open-source library extension of AWS CDK. AWS Solutions Constructs provides you with a collection of vetted, multi-service architecture patterns built using the best practices established by the AWS Well-Architected Framework. AWS Solutions Constructs requires installation of the AWS CDK as a prerequisite. For instructions how to add AWS Solutions Constructs to your AWS CDK environment, please see our development guide.
AWS Construct Library
Q: What is the AWS Construct Library?
AWS CDK constructs are delivered through the AWS Construct Library, and represent abstractions of cloud infrastructure logic packaged for reuse. Constructs can be defined locally or published to package managers such as npm, Maven, NuGet, or PyPI for sharing across organizations.
Q: Which services are available in the AWS Construct Library?
We have coverage for many common AWS services and features with rich, high-level constructs, and complete coverage of the lower-level CloudFormation resources, including new resources shortly after they are available. We keep the AWS Construct Library up to date by autogenerating the resource-level APIs every time the CloudFormation specification changes. On top of these autogenerated APIs, we provide handcrafted, higher-level abstractions that make it even easier to work with each service. We do not have this high-level, convenient abstraction for every AWS service yet, but are adding new features all the time with a focus on services most used in modern cloud applications. Visit the AWS Construct Library API reference to learn more.
Q: How long will I have to wait for AWS CDK to support new features that are added to CloudFormation?
We keep the AWS Construct Library in sync with the CloudFormation resource specification by adding new CloudFormation features to AWS CDK shortly after their publication.
Q: How do I share and manage AWS CDK constructs with my team?
AWS CDK construct libraries are just like any other library. They are consumed through the package manager of the programming language you use; keeping those libraries up to date is part of your normal workflow. All packages support semantic versioning, allowing you to make conscious choices about when to migrate to new infrastructure models.
CloudFormation and SAM
Q: What is the relationship between AWS CDK and CloudFormation?
Think of the AWS CDK as a developer-centric toolkit leveraging the full power of modern programming languages to define your AWS infrastructure as code. When AWS CDK applications are run, they compile down to fully formed CloudFormation JSON/YAML templates that are then submitted to the CloudFormation service for provisioning. Because the AWS CDK leverages CloudFormation, you still enjoy all the benefits CloudFormation provides such as safe deployment, automatic rollback, and drift detection.
Q: What is the relationship between AWS CDK and AWS SAM?
AWS Serverless Application Model and AWS CDK both abstract AWS infrastructure as code making it easier for you to define your cloud infrastructure. AWS SAM is specifically focused on serverless use cases and architectures and allows you to define your infrastructure in compact, declarative JSON/YAML templates. AWS CDK offers broad coverage across all of AWS services and allows you to define cloud infrastructure in modern programming languages like TypeScript, Python, C#, and Java. Both AWS SAM and AWS CDK leverage CloudFormation as the provisioning engine for your infrastructure stacks.
If you prefer defining your serverless infrastructure in concise declarative templates, SAM is the better fit. If you want to define your AWS infrastructure in a familiar programming language, we encourage you to try out AWS CDK. In either case, you can rely on repeatable, safe infrastructure deployment through CloudFormation.
Q: Can I use the AWS SAM CLI to locally test Lambda functions defined with AWS CDK?
Yes, you can locally synthesize your AWS CDK application into a CloudFormation template and then reference the generated AWS Lambda handler ID in the SAM CLI. See the SAM CLI section in the CDK Developer Guide for more details.
Q: How much does AWS CDK cost?
There is no additional charge for AWS CDK. You pay for AWS resources (such as Amazon EC2 instances or Elastic Load Balancing load balancers) created using AWS CDK in the same way as if you created them manually. You only pay for what you use, as you use it; there are no minimum fees and no required upfront commitments.