- Source: AWS Cloud Development Kit
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
Familiar programming languages: AWS CDK supports TypeScript, JavaScript, Python, Java, Go, and C#, allowing developers to use their preferred programming languages for defining cloud infrastructure.
Reusable constructs: AWS CDK includes a library of constructs that encapsulate AWS resources, their configurations, and best practices, promoting reusability and reducing boilerplate code.
Higher-level abstractions: Developers can use constructs to create custom, higher-level abstractions, known as patterns, to simplify complex infrastructure patterns and improve maintainability.
Integration with AWS CloudFormation: AWS CDK applications are compiled into AWS CloudFormation templates, ensuring compatibility with existing AWS CloudFormation features and tools.
Modularity and extensibility: AWS CDK promotes modularity and extensibility by allowing developers to create and share custom constructs and patterns.
Release history
2018: AWS CDK was announced as a developer preview at the AWS Summit in New York on July 17, 2018, offering an early version of the framework for developers to test and provide feedback.
2019: AWS CDK reached general availability (GA) on July 11, 2019, with support for TypeScript and Python as the initial programming languages.
2019: Support for Java and C# was added to AWS CDK on November 25, 2019, broadening the range of programming languages available for defining and provisioning cloud infrastructure resources.
2021: AWS CDK v2 is released and consolidates the AWS Construct Library into a single package called aws-cdk-lib, streamlining usage and updates, ensuring stable APIs, and offering developer productivity improvements such as CDK Watch, a refreshed API Reference, and a new assertions library for automated unit testing in all CDK-supported languages.
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.
See also
Terraform
Infrastructure as Code
References
External links
Official website
AWS CDK on GitHub
AWS CDK User Guide
Kata Kunci Pencarian:
- AWS Cloud Development Kit
- AWS CloudFormation
- AWS App Runner
- Cloud computing
- CloudKit
- Yandex Cloud
- Datadog
- Backend as a service
- Planview
- ESP32