Skip to content
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
1 change: 1 addition & 0 deletions .gitignore

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 8 additions & 1 deletion .projenrc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,14 @@ const project = new awscdk.AwsCdkConstructLibrary({
awsSdkConnectionReuse: false, // doesn't exist in AWS SDK JS v3
},
projenCommand: "pnpm dlx projen",
gitignore: [".idea", ".DS_Store", "*.drawio.bkp", "ash_output", "~$*.xlsx"],
gitignore: [
".idea",
".DS_Store",
"*.drawio.bkp",
"ash_output",
"~$*.xlsx",
".kiro",
],
projenrcTs: true,
eslintOptions: {
prettier: true,
Expand Down
6 changes: 4 additions & 2 deletions src/lambdas/assets-deployment/fs-to-s3.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,10 @@ export async function fsToS3(props: FsToS3Props) {
});
let body: string | ReadStream;
if (
path.includes(".next/static/chunks/main-app-") &&
nextjsType === NextjsType.GLOBAL_FUNCTIONS
path.includes(".next/static/chunks/main-app-") ||
(path.startsWith("turbopack-") &&
path.endsWith(".js") &&
nextjsType === NextjsType.GLOBAL_FUNCTIONS)
) {
// see src/lambdas/assets-deployment/patch-fetch.js for why this is needed
const mainAppFileContent = readFileSync(path);
Expand Down
4 changes: 4 additions & 0 deletions src/nextjs-compute/nextjs-functions.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { join } from "path/posix";
import { Duration } from "aws-cdk-lib";
import { ServicePrincipal } from "aws-cdk-lib/aws-iam";
import {
DockerImageCode,
DockerImageFunction,
Expand Down Expand Up @@ -46,6 +47,9 @@ export class NextjsFunctions extends Construct {
this.props = props;
this.function = this.createFunction();
if (props.nextjsType === NextjsType.GLOBAL_FUNCTIONS) {
this.function.grantInvoke(
new ServicePrincipal("cloudfront.amazonaws.com"),
);
this.functionUrl = this.function.addFunctionUrl({
authType: FunctionUrlAuthType.AWS_IAM,
invokeMode: InvokeMode.RESPONSE_STREAM,
Expand Down
Loading