Loading AI tools
Open-source software development framework developed by Amazon Web Services From Wikipedia, the free encyclopedia
The AWS Cloud Development Kit (AWS CDK) is an open-source[1] software development framework developed by Amazon Web Services (AWS) for defining and provisioning cloud infrastructure resources using familiar programming languages.[2] 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.[3]
Developer(s) | Amazon Web Services |
---|---|
Operating system | Cross-platform |
Type | Cloud computing, Infrastructure as Code |
License | Apache License 2.0 |
Website | aws |
AWS CDK[4] allows developers to model and provision cloud infrastructure resources using programming languages such as TypeScript, JavaScript, Python, Java, Go, and C#.[5][6] 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.[7]
AWS CDK includes a library of constructs,[8] which are pre-built components that encapsulate one or more AWS resources and their configurations.[9] 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.[10]
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.[17] 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.
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
});
}
}
Seamless Wikipedia browsing. On steroids.
Every time you click a link to Wikipedia, Wiktionary or Wikiquote in your browser's search results, it will show the modern Wikiwand interface.
Wikiwand extension is a five stars, simple, with minimum permission required to keep your browsing private, safe and transparent.