Deploying Static Websites To AWS S3 + CloudFront + Route53 Using The TypeScript AWS CDK
mkdir step02_hello_website
cd step02_hello_website
cdk init app --language typescript
npm install @aws-cdk/aws-s3 @aws-cdk/aws-s3-deployment @aws-cdk/aws-cloudfront @aws-cdk/aws-cloudfront-origins
npm run build
cdk deploy
The deploy command will give the following output with a different subdomain after completion:
Outputs:
Step02HelloWebsiteStack.DistributionDomainName = d1levdydp6fbqq.cloudfront.net
This is a blank project for TypeScript development with CDK.
The cdk.json
file tells the CDK Toolkit how to execute your app.
npm run build
compile typescript to jsnpm run watch
watch for changes and compilenpm run test
perform the jest unit testscdk deploy
deploy this stack to your default AWS account/regioncdk diff
compare deployed stack with current statecdk synth
emits the synthesized CloudFormation template