Skip to content
forked from aws/aws-cdk

The AWS Cloud Development Kit is a framework for defining cloud infrastructure in code

License

Notifications You must be signed in to change notification settings

neilferreira/aws-cdk

Repository files navigation

AWS Cloud Development Kit (AWS CDK)

The AWS Cloud Development Kit (AWS CDK) is a software development framework for defining cloud infrastructure in code.

Development Environment

This is a monorepo which uses lerna.

The CDK depends on jsii, which is still not published to npm. Therefore, the jsii tarballs are checked-in to this repository under ./local-npm and the install script will install them in the repo-global node_modules directory.

Prerequisites

Since this repo produces artifacts for multiple programming languages using jsii, it relies on the following toolchains:

When building on CodeBuild, these toolchains are all included in the superchain docker image. This image can also be used locally as follows:

docker pull 260708760616.dkr.ecr.us-east-1.amazonaws.com/superchain:latest
docker run --net=host -it -v $PWD:$PWD -w $PWD superchain

This will get you into an interactive docker shell. You can then run ./install.sh and ./build.sh as described below.

Bootstrapping

  1. Clone this repository (or run git clean -fdx to clean up all build artifacts).
  2. Run ./install.sh - this will install all repo-level dependencies, including lerna and the unpublished modules from local-npm.
  3. Run ./build.sh - this will invoke lerna bootstrap and lerna run test. All external dependencies will be installed and internal deps will be cross-linked.

Development Iteration

After you've bootstrapped the repo, you would probably want to work on individual packages.

All packages in the repo have a two useful scripts: prepare and watch. In order to execute these scripts, use lerna run --stream --scope <package> <script>.

The reason you can't use "npm" is because dev tools are installed at the repository level and they are needed in the PATH when executing most of the package scripts.

A useful shell alias would use the directory name as a scope:

# add to your ~/.zshrc or ~/.bashrc
alias lr='lerna run --stream --scope $(basename $PWD)'

# more sugar
alias lw='lr watch &'
alias lp='lr prepare'

Then, you could just go into any of the package directories and use "lr" to run scripts. For example:

cd packages/aws-cdk-s3
lr watch

Package Linter

The pkglint tool normalizes all packages in the repo. It verifies package.json is normalized and adheres to the set of rules. To evaluate (and potentially fix) all package linting issues in the repo, run the following command from the root of the repository (after boostrapping):

npm run pkglint

Updating jsii

Run ./pack.sh in the jsii repository and copy the tarballs to ./local-npm. Make sure all tarballs are defined in the root package.json.

About

The AWS Cloud Development Kit is a framework for defining cloud infrastructure in code

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • TypeScript 97.8%
  • JavaScript 1.3%
  • Python 0.6%
  • Shell 0.3%
  • Go 0.0%
  • Dockerfile 0.0%