AWS Cloud Development Kit

AWS Cloud Development Kit
DeveloperAmazon Web Services
Operating systemCross-platform
TypeCloud computing, Infrastructure as Code
LicenseApache License 2.0
Websiteaws.amazon.com/cdk/

The AWS Cloud Development Kit (AWS CDK) is an open-source software development framework developed by Amazon Web Services (AWS) for defining and provisioning cloud infrastructure resources using familiar programming languages. The AWS CDK aims to improve the experience of working with Infrastructure as Code by providing higher-level, reusable constructs that enable developers to create and manage AWS resources more efficiently and with less boilerplate code compared to traditional configuration files like AWS CloudFormation templates.

Overview

AWS CDK allows developers to model and provision cloud infrastructure resources using programming languages such as TypeScript, JavaScript, Python, Java, Go, and C#. Developers can define their infrastructure using the same programming languages and tools they use for their application code, enabling better integration between application and infrastructure development processes.

AWS CDK includes a library of constructs, which are pre-built components that encapsulate one or more AWS resources and their configurations. Constructs can be used to build higher-level abstractions known as patterns, which simplify common cloud infrastructure patterns and best practices. The AWS Construct Library provides a collection of constructs for various AWS services, such as Amazon S3, Amazon EC2, and AWS Lambda.

Key features

Release history

Launching CDK

To get started with AWS CDK, developers need to install the AWS CDK Toolkit, which provides a command-line interface (CLI) for creating and managing AWS CDK projects. The CLI can be installed using the Node.js package manager (npm) or any compatible package manager. Once the AWS CDK Toolkit is installed, developers can create a new AWS CDK project, define their infrastructure using constructs, and deploy the resulting AWS CloudFormation stack to their AWS account.

Example code

The following is AWS CDK code written in TypeScript that creates an Amazon S3 bucket with public read access. This code imports the necessary AWS CDK libraries to create a new CloudFormation stack with a single Amazon S3 bucket resource. The Bucket constructor is used to create the bucket with the specified properties, including encryption, block public access, public read access, and versioning. The removal policy property specifies that the bucket should be destroyed when the stack is deleted.

import { Construct, Stack, StackProps } from 'aws-cdk-lib';
import { Bucket } from 'aws-cdk-lib/aws-s3';
import { BucketEncryption } from 'aws-cdk-lib/aws-s3';
import { BlockPublicAccess } from 'aws-cdk-lib/aws-s3';

export class MyStack extends Stack {
  constructor(scope: Construct, id: string, props?: StackProps) {
    super(scope, id, props);

    const myBucket = new Bucket(this, 'MyBucket', {
      encryption: BucketEncryption.S3_MANAGED,
      blockPublicAccess: BlockPublicAccess.BLOCK_ALL,
      publicReadAccess: true,
      removalPolicy: RemovalPolicy.DESTROY,
      versioned: true
    });
  }
}

See also

References

  1. ↑ Kocher, Laveesh (2021-12-13). "AWS Announces The Release AWS Cloud Development kit". Open Source For You. Retrieved 2023-03-19.
  2. ↑ "AWS Cloud Development Kit (CDK)". Amazon Web Services, Inc. Retrieved 2023-03-19.
  3. ↑ "AWS Cloud Development Kit (AWS CDK) User Guide". Amazon Web Services, Inc. Retrieved 2023-03-19.
  4. ↑ Steenman, Danny (2022-07-23). "What is the AWS CDK? (A beginners guide)". Towards the Cloud. Retrieved 2023-09-23.
  5. ↑ "AWS Cloud Development Kit (CDK) FAQs". Amazon Web Services, Inc. Retrieved 2023-03-19.
  6. ↑ Ramel, David. "AWS Adds .NET, Java Support in Cloud Development Kit".
  7. ↑ "What's so Cool About AWS CDK?". www.beyondjava.net. Retrieved 2023-03-19.
  8. ↑ "An Introduction To AWS Cloud Development Kit (CDK)". Smashing Magazine. 2022-03-10. Retrieved 2023-03-19.
  9. ↑ "Working with Constructs". Amazon Web Services, Inc. Retrieved 2023-03-19.
  10. ↑ "AWS Construct Library". Amazon Web Services, Inc. Retrieved 2023-03-19.
  11. ↑ Steenman, Danny (2022-05-03). "How to create an AWS CDK Construct". Towards the Cloud. Retrieved 2023-09-23.
  12. ↑ "AWS Cloud Development Kit (CDK) FAQs". Amazon Web Services, Inc. Retrieved 2023-03-19.
  13. ↑ "AWS CDK Developer Preview | AWS Developer Tools Blog". aws.amazon.com. 2018-08-27. Retrieved 2023-03-19.
  14. ↑ Werner Vogels (2019-07-11). "AWS Cloud Development Kit (CDK) – TypeScript and Python are Now Generally Available". Amazon Web Services, Inc. Retrieved 2023-03-19.
  15. ↑ "AWS Cloud Development Kit (CDK) – Java and .NET are Now Generally Available | AWS News Blog". aws.amazon.com. 2019-11-25. Retrieved 2023-03-19.
  16. ↑ "AWS Cloud Development Kit (AWS CDK) v2 is now generally available". Amazon Web Services, Inc. Retrieved 2023-03-19.
  17. ↑ "AWS CDK Toolkit". Amazon Web Services, Inc. Retrieved 2023-03-19.