/cdk-construct-nextjs

This library provides constructs for hosting Next.JS web applications built using open-next.

Primary LanguageJavaScriptApache License 2.0Apache-2.0

CDK Construct NextJS


cdk-constructs: Experimental

The APIs of higher level constructs in this module are experimental and under active development. They are subject to non-backward compatible changes or removal in any future version. These are not subject to the Semantic Versioning model and breaking changes will be announced in the release notes. This means that while you may use them, you may need to update your source code when upgrading to a newer version of this package.


This library provides constructs for hosting Next.JS web applications built using open-next.

Supports versions: 12 and 13

Install

npm install cdk-construct-nextjs

Usage

import { NextJs } from 'cdk-construct-nextjs';

new NextJs(this, 'handler', {
  path: '../apps/website',
});

Domain names

This construct assumes that the provided domainName is the same as the hostedZoneId.

import { NextJs } from 'cdk-construct-nextjs';

new NextJs(this, 'handler', {
  path: '../apps/website',
  domainName: 'example.com',
});

Existing hosted zones can be provided as an object.

import { NextJs } from 'cdk-construct-nextjs';

new NextJs(this, 'handler', {
  path: '../apps/website',
  domainName: {
    domainName: 'example.com',
    hostedZone: 'existing.com',
  }
});

Acknowledgements

These constructs were inspired by or directly modified from many sources, primarily: