Skip to content

Latest commit

 

History

History
51 lines (31 loc) · 2.02 KB

README.md

File metadata and controls

51 lines (31 loc) · 2.02 KB

NextJS Serverless CDK

A CDK deploy to cloudfront distributions of https://github.com/vercel/next.js using https://github.com/serverless-nextjs/serverless-next.js for AWS compatibility.

This is a spike of an Application, not a construct.

There are no defined caching strategies and all s3 assets are purged for every deploy

Experimental AWS-CDK constructs have been used, see:

Official Support

Serverless next JS has a construct for this now: serverless-nextjs/serverless-next.js#878

Example

The example page is here - https://d3a8vzm1ccycvj.cloudfront.net/

Features

  • CDK Synth builds nextJS application using @sls-next/lambda-at-edge
  • Support for API pages using @sls-next/lambda-at-edge
  • Deploys Lambda at edge and S3 Assets using AWS-CDK.
  • Routing and caching configuration is extensible through AWS-CDK cloudfront behaviors.

Deploy

export AWS_PROFILE=<your-aws-profile>

yarn cdk bootstrap

yarn build

yarn cdk synth

yarn cdk deploy

Removing

export AWS_PROFILE=<your-aws-profile>

yarn cdk destroy