Skip to content

v0.0.1

Compare
Choose a tag to compare
@dhmacs dhmacs released this 28 May 13:52
· 17 commits to master since this release

Install

npm i -g aws-next

Usage

Build your Next.js app (e.g. next build), then navigate to the root of your Next.js project and run:

$ aws-next

This will output the build artifacts under .aws-next folder. The artifacts are meant to be deployed using AWS CDK.

Artifacts

  • s3: contains static assets to be deployed to AWS S3
  • default-lambda: contains the lambda@edge code to handle all page and assets requests
  • api-lambda: contains the lambda@edge code to handle all api requests

Inject environment variables

Lambda@edge does not support environment variables. To overcome this you can bundle your enviroment variables into your Next.js deploy. Alternatively, this CLI injects into process.env custom headers defined from the Cloudfront distribution that starts with X-ENV-.