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:
Serverless next JS has a construct for this now: serverless-nextjs/serverless-next.js#878
The example page is here - https://d3a8vzm1ccycvj.cloudfront.net/
- 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.
- Deploys to
us-east-1
- Uses cloudformation single stack as resource limit has recently be raised from 200 to 500
export AWS_PROFILE=<your-aws-profile>
yarn cdk bootstrap
yarn build
yarn cdk synth
yarn cdk deploy
export AWS_PROFILE=<your-aws-profile>
yarn cdk destroy