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
- CDK demo including screencast
- Migrating an existing Cloudformation template
- View the typedocs
- Contributing to
@guardian/cdk
- Best practices
@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.
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!
We welcome contributions to @guardian/cdk
!
To get started, please read our Contribution Guidelines.