aws-cdk README

The project's README from github.com/aws/aws-cdk. As one markdown file: README.md.

AWS Cloud Development Kit (AWS CDK)

Build Status Gitpod Ready-to-Code NPM version PyPI version NuGet version Maven Central Go Reference

View on Construct Hub

The AWS Cloud Development Kit (AWS CDK) is an open-source software development framework to define cloud infrastructure in code and provision it through AWS CloudFormation.

It offers a high-level object-oriented abstraction to define AWS resources imperatively using the power of modern programming languages. Using the CDK’s library of infrastructure constructs, you can easily encapsulate AWS best practices in your infrastructure definition and share it without worrying about boilerplate logic.

The CDK is available in the following languages:

Third-party Language Deprecation: language version is only supported until its EOL (End Of Life) shared by the vendor or community and is subject to change with prior notice.


Jump To: Developer Guide | API Reference | Getting Started | Getting Help | Contributing | RFCs | Roadmap | More Resources


Developers use the CDK framework in one of the supported programming languages to define reusable cloud components called constructs, which are composed together into stacks, forming a "CDK app".

They then use the AWS CDK CLI to interact with their CDK app. The CLI allows 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 use AWS. The AWS Construct Library aims to reduce the complexity and glue-logic required when integrating various AWS services to achieve your goals on AWS.

Modules in the AWS Construct Library are designated Experimental while we build them; experimental modules may have breaking API changes in any release. After a module is designated Stable, it adheres to semantic versioning, and only major releases can have breaking changes. Each module's stability designation is available on its Overview page in the AWS CDK API Reference. For more information, see Versioning in the CDK Developer Guide.

Getting Started

For a detailed walkthrough, see the tutorial in the AWS CDK Developer Guide.

At a glance

Install or update the AWS CDK CLI from npm (requires Node.js ≥ 14.15.0). We recommend using a version in Active LTS

npm i -g aws-cdk

(See Manual Installation for installing the CDK from a signed .zip file).

Initialize a project:

mkdir hello-cdk
cd hello-cdk
cdk init sample-app --language=typescript

This creates a sample project looking like this:

export class HelloCdkStack extends cdk.Stack {
  constructor(scope: cdk.App, id: string, props?: cdk.StackProps) {
    super(scope, id, props);

    const queue = new sqs.Queue(this, 'HelloCdkQueue', {
      visibilityTimeout: cdk.Duration.seconds(300)
    });

    const topic = new sns.Topic(this, 'HelloCdkTopic');

    topic.addSubscription(new subs.SqsSubscription(queue));
  }
}

Deploy this to your account:

cdk deploy

Use the cdk command-line toolkit to interact with your project:

Getting Help

The best way to interact with our team is through GitHub. You can open an issue and choose from one of our templates for bug reports, feature requests, documentation issues, or guidance.

If you have a support plan with AWS Support, you can also create a new support case.

You may also find help on these community resources:

Roadmap

The AWS CDK Roadmap lets developers know about our upcoming features and priorities to help them plan how to best leverage the CDK and identify opportunities to contribute to the project. See ROADMAP.md for more information and FAQs.

Contributing

We welcome community contributions and pull requests. See CONTRIBUTING.md for information on how to set up a development environment and submit code.

Metrics collection

This solution collects anonymous operational metrics to help AWS improve the quality and features of the CDK. For more information, including how to disable this capability, please see the developer guide.

More Resources

aws-cdk (aws/aws-cdk)

Searching Database…

12.9K ·GitHub
这是什么?AWS CDK 是一个开源框架,让你可以用真正的编程语言(TypeScript、Python、Java、.NET、Go)定义 AWS 云基础设施,而不必手写原始模板,然后通过 AWS CloudFormation 进行部署。
这是框架、命令行工具,还是两者都是?两者都是:它是一个框架,提供一套可复用的“构造”库用于定义 AWS 资源,同时还有 'cdk' 命令行工具,用于合成 CloudFormation 模板,并部署和比对你的堆栈。
我该如何开始一个 CDK 项目?从 npm 安装 CDK 命令行工具,运行 'cdk init' 用你选择的语言生成一个示例项目,然后使用 'cdk synth' 生成 CloudFormation 模板,再用 'cdk deploy' 将其部署到你的 AWS 账户。
使用 CDK 之前需要准备什么?你需要 Node.js(推荐 ≥20.x)来运行命令行工具,还需要你所选语言对应的运行时环境(Python ≥3.8、Java ≥8 并需安装 Maven、.NET ≥8.0 或 Go ≥1.16.4),以及一个用于部署的 AWS 账户。
所有 AWS 服务的构造稳定性都一样吗?不一样。构造库中的模块一开始处于“实验性”(Experimental)阶段,版本之间可能出现破坏性的 API 变更;直到升级为“稳定版”(Stable)后,才会遵循语义化版本控制。
这个命令行工具能在任何操作系统上运行吗?能。它通过 npm 分发并基于 Node.js 构建,因此 CDK 命令行工具可以在 Windows、macOS 和 Linux 上运行。
CDK 会向 AWS 发送任何数据吗?会。默认情况下,它会收集匿名的运行数据,帮助 AWS 改进 CDK,不过这一功能可以关闭。
CDK 里的“构造”到底是什么?构造是一个可复用的云组件,代表一个或多个 AWS 资源;多个构造组合在一起形成堆栈,堆栈再组成一个 CDK 应用。
为什么要用 CDK,而不是手写 CloudFormation YAML?CDK 可以把 AWS 最佳实践和样板逻辑封装成可复用、带类型的组件,减少把多个 AWS 服务连接在一起所需的胶水代码。
什么是 Construct Hub?它是一个网站,用于查找和使用社区共享的开源 CDK 构造库。
部署前可以预览变更吗?可以。'cdk diff' 会将你本地的应用定义与当前已部署的堆栈进行比较,让你在部署前看到代码改动会带来的影响。
What are similar projects?pulumi, encore, agento11y, terraformer, sst, infracost, serverless, kops
Creator
aws
Size
1.5 GB
Stars
12.9K
Age
9y
Commits · 90 Days