v0.0.1
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 S3default-lambda
: contains the lambda@edge code to handle all page and assets requestsapi-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-
.