Skip to content

This is an AWS CDK Construct to make deploying a single page website (Angular/React/Vue) to AWS S3 behind SSL/Cloudfront easier

License

Notifications You must be signed in to change notification settings

telpochyaotl/CDK-SPA-Deploy

 
 

Repository files navigation

CDK-SPA-Deploy

npm Vulnerabilities

This is an AWS CDK Construct to make deploying a single page website (Angular/React/Vue) to AWS S3 behind SSL/Cloudfront as easy as 5 lines of code.

Installation and Usage

Typescript

npm install --save cdk-spa-deploy

cdk-spa-deploy example

Python

pip install cdk-spa-deploy

cdk-spa-deploy python example

Advanced Usage

Auto Deploy From Hosted Zone Name

If you purchased your domain through route 53 and already have a hosted zone then just use the name to deploy your site behind cloudfront. This handles the SSL cert and everything for you.

cdk-spa-deploy alias

Custom Domain and SSL Certificates

You can also pass the ARN for an SSL certification and your alias routes to cloudfront

cdk-spa-deploy alias

Encrypted S3 Bucket

Pass in one boolean to tell SPA Deploy to encrypt your website bucket

cdk-spa-deploy encryption

Restrict Access to Known IPs

Pass in a boolean and an array of IP addresses and your site is locked down!

cdk-spa-deploy ipfilter

Modifying S3 Bucket Created in Construct

An object is now returned containing relevant artifacts created if you need to make any further modifications:

  • The S3 bucket is present for all of the methods
  • When a CloudFront Web distribution is created it will be present in the return object
export interface SPADeployment {
  readonly websiteBucket: s3.Bucket,
}

export interface SPADeploymentWithCloudFront extends SPADeployment {
  readonly distribution: CloudFrontWebDistribution,
}

Issues / Feature Requests

https://github.com/nideveloper/CDK-SPA-Deploy

About

This is an AWS CDK Construct to make deploying a single page website (Angular/React/Vue) to AWS S3 behind SSL/Cloudfront easier

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • TypeScript 99.2%
  • Other 0.8%