Opinionated AWS CDK codepipeline setup for a serverless-next.js application
Requirements:
- Code repository must be on AWS CodeCommit.
- NextJS 11.
- Peer dependencies (only required to install manually if using npm version below 7):
npm install --save --save-exact @aws-cdk/core@1.118.0 @aws-cdk/aws-codecommit@1.118.0 @aws-cdk/pipelines@1.118.0 @aws-cdk/aws-route53-patterns@1.118.0 @aws-cdk/aws-s3-deployment@1.118.0 @aws-cdk/aws-cloudfront-origins@1.118.0 @aws-cdk/aws-lambda-event-sources@1.118.0 @aws-cdk/aws-lambda-nodejs@1.118.0
AWS Resources created:
-
AWS CodePipeline with n number of stages.
-
Each stage deploys a stack consisting of:
- Resources found in here: https://github.com/serverless-nextjs/serverless-next.js/tree/master/packages/serverless-components/nextjs-cdk-construct
- (Optional) Cloudfront redirect.