This template code provisions a Cloudformation stack that deploys a Lume site to S3 and Cloudfront. It uses the AWS CDK to define the infrastructure as code in TypeScript.
This template will provision the following resources:
- An S3 bucket to store the Lume site files
- A CloudFront distribution to serve the Lume site
- A Route 53 record set to point a custom domain to the CloudFront distribution
The cdk.json
file tells the CDK Toolkit how to execute your app.
- AWS CLI installed and configured with your AWS credentials (with a profile for Blueprint account)
- AWS CDK installed
- Node.js & npm installed
- A public Route 53 Hosted Zone created in your AWS account for the domain you want to use (e.g. example.com)
- An SSL/TLS certificate created in AWS Certificate Manager (ACM) for the domain you want to use (e.g. example.com). The certificate must be in the same region as the CloudFront distribution (e.g. us-east-1).
-
Make a Fork of this Repository
Create a fork of this repository to your own GitHub account. This is because your configuration file could contain sensitive information regarding your project/AWS account. -
Install Dependencies
Run the following command to install the required dependencies:
npm install
-
Configure the Stack
Fill out theconfig/config.yaml
file with the relevant development and production information. -
Synthesize the Stack
Before deploying, you can synthesize the stack to ensure it is valid:
cdk synth
-
Deploy the Stack
Deploy the stack to your AWS account and region:
cdk deploy --profile <aws_profile>
npm run build
compile typescript to jsnpm run watch
watch for changes and compilenpm run test
perform the jest unit testsnpx cdk deploy
deploy this stack to your default AWS account/regionnpx cdk diff
compare deployed stack with current statenpx cdk synth
emits the synthesized CloudFormation template