Skip to content

guardian/cdk

This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Folders and files

NameName
Last commit message
Last commit date
Apr 26, 2022
Apr 13, 2022
Jul 14, 2021
Apr 27, 2022
Apr 13, 2022
May 6, 2022
May 3, 2022
Nov 19, 2020
Nov 19, 2020
Dec 23, 2021
Dec 23, 2021
Nov 4, 2021
Nov 19, 2020
Feb 17, 2022
Mar 28, 2022
Jul 7, 2021
Jul 26, 2021
May 3, 2022
May 3, 2022
Jul 14, 2021
Jul 7, 2021
May 13, 2021
May 24, 2021
Feb 28, 2022

Repository files navigation

Guardian CDK Library

npm CD

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.

@guardian/cdk builds on CDK to provide Guardian-specific patterns and constructs. It is an opinionated and secure-by-default way to describe and provision your AWS resources.

Jump to:

Quickstart

@guardian/cdk expects certain Parameter Store values to be present - for example, VPC IDs, and the location of dist buckets. To check for account readiness and fix any issues, run:

npx @guardian/cdk@latest account-readiness --profile [profile]

Then, instantiate a new CDK app:

npx @guardian/cdk@latest new --app [app] --stack [stack] --stage [stage]

For example, for the app riff-raff we'd do:

npx @guardian/cdk@latest new \
  --app riff-raff \
  --stack deploy \
  --stage CODE \
  --stage PROD

Tip: Migrating an app? See the Migration Guide for more detail.

Tip: New to CDK? The AWS CDK Developer Guide is worth a read.

Patterns and Constructs

Once you have your new app, you can start adding patterns and constructs.

Patterns can be imported from the top level of the library:

import { GuScheduledLambda } from "@guardian/cdk";

We encourage you to use patterns rather than constructs whenever possible.

If you need to use a construct directly, they must be imported from their construct directory:

import { GuAutoScalingGroup } from "@guardian/cdk/lib/constructs/autoscaling";

Our hope is that patterns solve the majority of your use-cases. If they don't, please let us know about your use-case so that we can consider supporting it via a pattern.

Alternatively, PRs are always welcome!

Contributing

We welcome contributions to @guardian/cdk!

To get started, please read our Contribution Guidelines.