Skip to content

Commit

Permalink
Sync
Browse files Browse the repository at this point in the history
  • Loading branch information
fwang committed Nov 22, 2023
1 parent ec79363 commit a06f89f
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 22 deletions.
18 changes: 9 additions & 9 deletions examples/nextjs/web/pnpm-lock.yaml

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

26 changes: 13 additions & 13 deletions internal/components/src/components/ssr-site.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ export class SsrSite extends pulumi.ComponentResource {

// TODO uncomment build
const now = Date.now();
buildApp();
//buildApp();
console.log(`open-next: ${Date.now() - now}ms`);
const access = createCloudFrontOriginAccessIdentity();
const bucket = createS3Bucket();
Expand Down Expand Up @@ -90,7 +90,7 @@ export class SsrSite extends pulumi.ComponentResource {
function createCloudFrontOriginAccessIdentity() {
return new aws.cloudfront.OriginAccessIdentity(
`${name}-origin-access-identity`,
{},
{}
);
}

Expand All @@ -106,7 +106,7 @@ export class SsrSite extends pulumi.ComponentResource {
return request;
}`,
},
{ parent: _this },
{ parent: _this }
);
}

Expand Down Expand Up @@ -189,7 +189,7 @@ export class SsrSite extends pulumi.ComponentResource {
queryStringBehavior: "all",
},
},
},
}
);

return new aws.cloudfront.Distribution(`${name}-distribution`, {
Expand Down Expand Up @@ -341,7 +341,7 @@ export class SsrSite extends pulumi.ComponentResource {
const bucket = new aws.s3.BucketV2(
`${name}-bucket`,
{},
{ parent: _this },
{ parent: _this }
);
new aws.s3.BucketPublicAccessBlock("exampleBucketPublicAccessBlock", {
bucket: bucket.id,
Expand Down Expand Up @@ -397,7 +397,7 @@ export class SsrSite extends pulumi.ComponentResource {
},
],
})
.then((doc) => doc.json),
.then((doc) => doc.json)
),
},
],
Expand Down Expand Up @@ -429,7 +429,7 @@ export class SsrSite extends pulumi.ComponentResource {
},
],
})
.then((doc) => doc.json),
.then((doc) => doc.json)
),
},
],
Expand All @@ -442,7 +442,7 @@ export class SsrSite extends pulumi.ComponentResource {
description: "Next.js server",
handler: "index.handler",
code: new pulumi.asset.FileArchive(
path.join(sitePath, ".open-next", "image-optimization-function"),
path.join(sitePath, ".open-next", "image-optimization-function")
),
runtime: "nodejs18.x",
memorySize: 1536,
Expand Down Expand Up @@ -482,33 +482,33 @@ export class SsrSite extends pulumi.ComponentResource {
},
],
})
.then((doc) => doc.json),
.then((doc) => doc.json)
),
},
],
managedPolicyArns: [
"arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole",
],
},
}
);
const consumer = new aws.lambda.Function(
`${name}-revalidation-consumer`,
{
handler: "index.handler",
code: new pulumi.asset.FileArchive(
path.join(sitePath, ".open-next", "revalidation-function"),
path.join(sitePath, ".open-next", "revalidation-function")
),
runtime: "nodejs18.x",
timeout: 30,
role: consumerRole.arn,
},
}
);
new aws.lambda.EventSourceMapping(
`${name}-revalidation-consumer-event-source`,
{
functionName: consumer.name,
eventSourceArn: queue.arn,
},
}
);
}
}
Expand Down

0 comments on commit a06f89f

Please sign in to comment.