1. 26
    Deploy a site with HTTPS support behind a CDN with CDK
    3m 25s

Deploy a site with HTTPS support behind a CDN with CDK

Share this video with your friends

Send Tweet

Deploying a static site to S3 works really well unless we consider the fact that you cannot add HTTPS support to the site directly in S3. In order to do that - a CloudFront distribution is required.

While it is possible to setup CloudFront with CDK on our own, we don't always have to do anything on our own.

Instead, we can use constructs that were created by the community.

In this quick lesson we're going to learn how to use CDK-SPA-Deploy construct in order to deploy our app to S3 (using createBasicSite construct) and deploy it with HTTPS support and behind a CloudFront CDN distribution.

IMPORTANT NOTE: All AWS Construct Library modules used in your project must be the same version.

Matt
Matt
~ 4 years ago

I was getting errors after installing cdk-spa-deploy via yarn and trying to implement SPADeploy in the code. The app wouldn't build. There error I was getting was: "Argument type of 'this' is not assignable to parameter of type 'Construct'"

In order to get it working I had to make sure all aws-cdk packages had matching versions. remove all carets in version numbers (^)... then npm install, npm run build, cdk deploy.

I ended up deleting my npm_modules folder but I'm not sure if that's necessary. No issues have arose at the moment.

Sivaprasad Chidambaram
Sivaprasad Chidambaram
~ 4 years ago

I am getting this error while installing cdk-spa-deploy npm package

Error: 404 Not Found - GET https://registry.npmjs.org/@aws-cdk%2faws-iam - Not found

Tomasz Łakomy
Tomasz Łakomy(instructor)
~ 4 years ago

Hey!

npm was down around 2 hours ago, could you try again? :)

Michael Gregoire
Michael Gregoire
~ 3 years ago

Just heads up, per the documentation to the latest version of cdk-spa-deploy, you need to install dependencies to use it: https://github.com/nideveloper/CDK-SPA-Deploy#installation-and-usage

Muhammad
Muhammad
~ 3 years ago

That's right 👆