Deploy Next.js as Lambda@Edge.
https://github.com/serverless-nextjs/serverless-next.js#architecture
import { ServerlessNextjs } from '@rayova/cdk-serverless-nextjs'
new ServerlessNextjs(scope: Construct, id: string, props: ServerlessNextjsProps)
- Type:
constructs.Construct
- Type:
string
public readonly cloudFrontConfig: ServerlessNextjsCloudFrontConfig;
import { NextjsArtifactFromBuildOptions } from '@rayova/cdk-serverless-nextjs'
const nextjsArtifactFromBuildOptions: NextjsArtifactFromBuildOptions = { ... }
public readonly buildCommand: string[];
- Type:
string
[]
The command to build nextjs's .next directory.
i.e., ['yarn', 'build'] or ['yarn', 'next', 'build']
public readonly nextjsDirectory: string;
- Type:
string
The directory containing the Next.js project.
CloudFront configuration.
import { ServerlessNextjsCloudFrontConfig } from '@rayova/cdk-serverless-nextjs'
const serverlessNextjsCloudFrontConfig: ServerlessNextjsCloudFrontConfig = { ... }
public readonly additionalBehaviors: {[ key: string ]: BehaviorOptions};
- Type: {[ key: string ]:
aws-cdk-lib.aws_cloudfront.BehaviorOptions
}
Additional behaviors.
public readonly defaultBehavior: BehaviorOptions;
CDN default behavior.
import { ServerlessNextjsProps } from '@rayova/cdk-serverless-nextjs'
const serverlessNextjsProps: ServerlessNextjsProps = { ... }
public readonly nextjsArtifact: NextjsArtifact;
The Next.js artifact.
import { NextjsArtifact } from '@rayova/cdk-serverless-nextjs'
new NextjsArtifact()
import { NextjsArtifact } from '@rayova/cdk-serverless-nextjs'
NextjsArtifact.fromBuild(options: NextjsArtifactFromBuildOptions)