Skip to content

An AWS-CDK deployment of NextJS using @sls-next/lambda-at-edge

Notifications You must be signed in to change notification settings

simonireilly/nextjs-aws-cdk

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

An AWS-CDK deployment of NextJS using @sls-next/lambda-at-edge

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published