The AWS Cloud Development Kit is a framework for defining cloud infrastructure in code
Clone or download
rix0rrr fix(aws-cdk): Improvements to IAM diff rendering (#1542)
Contains the following changes:

- Print table to STDOUT instead of STDERR. This ensures the diff output and the "confirm (y/n)" prompt that follows it don't interleave on the terminal, degrading readability.
- Control table width to not exceed the terminal width, so that it doesn't wrap and lead to a mess of lines.
- Switch back to the new version of the `table` library (instead of `cli-table`) which now has in-cell newline support, to get rid of the rendering bugs in `cli-table` that would occasionally eat newlines.
- Render resource `replace` impact as red instead of yellow, to indicate that data loss will be happening here (fixes #1458).
- Change replacement diffing in order to not trigger IAM changes dialog (fixes #1495).
- Print a message instead of an empty table if 'cdk context' has no information in it (fixes #1549).

Explanation: 

We used to modify the new target template in place, causing changes to
the logical ids of replaced resources, which would trigger downstream
changes, which would further trigger potential downstream replacements, etc. 

This would properly calculate the set of impacted resources, but would also lead to the modified logical ID popping up in the IAM diff, which was not desirable.

In this change, we do the same processing but we throw away the
template after all changes have been propagated, and only copy
the resultant property *statuses* onto the diff object that gets
returned to the user. This leads to the same displayed result
without the changes to the template actually propagating.

In the course of this modification, the diff classes have been changed
to also have objects in places of resources and properties that
didn't actually change (so that they could be modified in-place),
and diff objects have a boolean telling whether they are actual
changes or not.
Latest commit 3270b47 Jan 16, 2019
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.github chore: improve formatting of PR template Dec 24, 2018
design feat(cdk): transparently use constructs from another stack Jan 9, 2019
docs feat: cloudformation condition chaining (#1494) Jan 8, 2019
examples v0.22.0 (#1518) Jan 11, 2019
packages fix(aws-cdk): Improvements to IAM diff rendering (#1542) Jan 16, 2019
scripts chore(scripts): Add Jetbrains node_modules exclusion script (#1507) Jan 13, 2019
tools v0.22.0 (#1518) Jan 11, 2019
.gitallowed feat(toolkit): add 'cdk context' command (#1169) Nov 15, 2018
.gitattributes chore: tell git that images are binary (#1082) Nov 5, 2018
.gitignore Allow v8 to allocate more heap (#1336) Dec 20, 2018
.travis.yml feat(aws-s3-deployment): bucket deployments (#971) Oct 19, 2018
CHANGELOG.md v0.22.0 (#1518) Jan 11, 2019
CONTRIBUTING.md chore(scripts): Add Jetbrains node_modules exclusion script (#1507) Jan 13, 2019
LICENSE Change license to Apache-2.0 (#428) Jul 30, 2018
MANUAL_INSTALLATION.md Update README (#433) Jul 31, 2018
NOTICE Change license to Apache-2.0 (#428) Jul 30, 2018
README.md docs: Added logos for supported languages (#1066) Nov 2, 2018
build-docs.sh add packages.txt to github pages (#1520) Jan 11, 2019
build.sh chore: enable project references in build (#1466) Jan 3, 2019
buildspec.yaml chore: prepare aws-cdk for auto-publish (#710) Sep 13, 2018
bump.sh Allow v8 to allocate more heap (#1336) Dec 20, 2018
fetch-dotnet-snk.sh build: fix usage of "-z" in fetch-dotnet-snk.sh (#1010) Oct 25, 2018
git-secrets-scan.sh Add git-secrets check to build Jul 31, 2018
install.sh Allow v8 to allocate more heap (#1336) Dec 20, 2018
lerna.json v0.22.0 (#1518) Jan 11, 2019
link-all.sh link-all: remove existing node_modules (#511) Aug 6, 2018
pack.sh Allow v8 to allocate more heap (#1336) Dec 20, 2018
package-lock.json chore: enable project references in build (#1466) Jan 3, 2019
package.json chore: enable project references in build (#1466) Jan 3, 2019
screencast.gif Update README (#433) Jul 31, 2018
tslint.yaml chore: update jsii to 0.7.4 (#687) Sep 10, 2018

README.md

AWS Cloud Development Kit (AWS CDK)

Build Status Build Status Version Gitter chat

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. The CDK integrates fully with AWS services and offers a higher level object-oriented abstraction to define AWS resources imperatively. 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 improves the end-to-end development experience because you get to use the power of modern programming languages to define your AWS infrastructure in a predictable and efficient manner.

The following languages are currently supported:

  • Java
  • JavaScript, TypeScript
  • .NET

The CDK is currently in developer preview and we look forward to community feedback and collaboration!

User Guide | Getting Started | API Reference | Getting Help

Example usage of CDK

Developers can use one of the supported programming languages to define reusable cloud components called constructs, which are composed together into stacks and apps.

The AWS CDK Toolkit is a command-line tool for interacting with CDK apps. It 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.

Getting Started

Install or update the AWS CDK Toolkit from npm (requires Node.js ≥ 8.11.x):

$ npm i -g aws-cdk

Initialize a project:

$ mkdir hello-cdk
$ cd hello-cdk
$ cdk init app --language=typescript
# or
$ cdk init app --language=java
# more languages (coming soon)...

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

  • cdk deploy: deploys your app into an AWS account
  • cdk synth: synthesizes an AWS CloudFormation template for your app
  • cdk diff: compares your app with the deployed stack

Read the docs:

$ cdk docs

Getting Help

Please use these community resources for getting help. We use the GitHub issues for tracking bugs and feature requests.

  • Ask a question on Stack Overflow and tag it with aws-cdk
  • Come join the AWS CDK community on Gitter
  • Open a support ticket with AWS Support
  • If it turns out that you may have found a bug, please open an issue

Contributing

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

License

The AWS CDK is distributed under the Apache License, Version 2.0.

See LICENSE and NOTICE for more information.