Skip to content
This repository has been archived by the owner on Jan 28, 2025. It is now read-only.

Allow to set custom handler #2409

Merged
merged 1 commit into from
Apr 20, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ export class NextJSLambdaEdge extends Construct {
this.defaultNextLambda = new lambda.Function(this, "NextLambda", {
functionName: toLambdaOption("defaultLambda", props.name),
description: `Default Lambda@Edge for Next CloudFront distribution`,
handler: "index.handler",
handler: props.handler || "index.handler",
currentVersionOptions: {
removalPolicy: RemovalPolicy.DESTROY // destroy old versions
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,11 @@ export interface Props extends StackProps {
imageCache?: string;
lambdaCache?: string;
};
/**
* If you use a custom handler with `.build()`, you can set the handler here.
*/
handler?: string;

/**
* Enable logging on the cloudfront distribution
*/
Expand Down