Make a static website with React and deploy it with a single command using cdk.
Run npm ci
to get setup.
Have a look at the React code in ./src
. Maybe change the content in App.tsx
.
To view your React app locally, run npm start
and open the printed URL in a browser.
Once you are happy, deploy your app with npx cdk deploy
. If you haven't used the CDK in your account before, you will have bootstrap the account first (typically by running npx cdk bootstrap
) and sort out permissions. Please refer to the official AWS CDK documentation to get started.
As part of the deployment, a URL will be displayed. Open it to view your deployed website!
Don't forget to tear everything down with npx cdk destroy
- otherwise you will incur costs.
Additionally, Amazon CloudWatch Synthetics creates a number of dependent resources that are not automatically removed when you destroy the stack. These are documented in this AWS blog post.
npm install
start with thisnpm test
perform the jest unit testsnpm start
serve the website on localhostnpx cdk bootstrap
setup your AWS environmentnpx cdk deploy
deploy this stack to your default AWS account/regionnpx cdk destroy
destroy this stack to ensure you don't incur any costsnpx cdk diff
compare deployed stack with current statenpx cdk synth
emits the synthesized CloudFormation template