Skip to content

Commit 527ca96

Browse files
feat: assetImageCodeProps override on NextjsFunctions (#213)
Adds ability to override build args for functions --------- Signed-off-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
1 parent e84754b commit 527ca96

File tree

2 files changed

+15
-0
lines changed

2 files changed

+15
-0
lines changed

API.md

Lines changed: 11 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/nextjs-compute/nextjs-functions.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import { join as joinPosix } from "node:path/posix";
44
import { Duration } from "aws-cdk-lib";
55
import { ServicePrincipal } from "aws-cdk-lib/aws-iam";
66
import {
7+
AssetImageCodeProps,
78
DockerImageCode,
89
DockerImageFunction,
910
DockerImageFunctionProps,
@@ -21,6 +22,7 @@ import { getLambdaArchitecture } from "../utils/get-architecture";
2122
export interface NextjsFunctionsOverrides {
2223
readonly dockerImageFunctionProps?: OptionalDockerImageFunctionProps;
2324
readonly functionUrlProps?: OptionalFunctionUrlProps;
25+
readonly assetImageCodeProps?: AssetImageCodeProps;
2426
}
2527

2628
export interface NextjsFunctionsProps extends NextjsComputeBaseProps {
@@ -104,7 +106,9 @@ export class NextjsFunctions extends Construct {
104106
cmd: ["node", relativeEntrypointPath],
105107
buildArgs: {
106108
RELATIVE_PATH_TO_PACKAGE: this.props.relativePathToPackage || ".",
109+
...this.props.overrides?.assetImageCodeProps?.buildArgs,
107110
},
111+
...this.props.overrides?.assetImageCodeProps,
108112
});
109113
}
110114

0 commit comments

Comments
 (0)