Skip to content

Latest commit

 

History

History
52 lines (32 loc) · 1.39 KB

README.md

File metadata and controls

52 lines (32 loc) · 1.39 KB

Second Rate Website

A breakable toy for experimenting with React and AWS CDK

Directory Structure

deployments - AWS CDK TypeScript project resources website/build - default build directory for CDK S3 deployment

Runtime

  • node12 & npm

Deployments

  • @aws-cdk - Infrastructure
  • @aws-sdk - Hit counter update command & Lambda Invoke

Website

The deployment is designed to sync the contents of website/build and expects to find an index.html that acts as the root of the website. A slightly modified create-react-app is included for displaying the hit count.

Set Up

The guide assumes that you have an AWS account and have properly configured permissions for deploying resources using the AWS CDK.

Install deployment dependencies and build Lambda functions:

cd deployments && npm install && npm run build

Install website dependencies and build React application:

cd websites && npm isntall && npm run build

Deploy AWS Resources

cdk deploy MyStack                      \\
  --parameters DomainName=something.com \\
  --parameters HostedZoneId=somezone    \\

Certificate provisioning will take some time to complete. If provisioning fails the deployment will clean itself up thanks to AWS CDK.

TODO

  • use actions for website deployments
  • use pipelines for deployments