Skip to content

Commit 48e9002

Browse files
authored
fix: inaccessible public assets (#92)
1 parent 7b6d563 commit 48e9002

File tree

6 files changed

+46
-3
lines changed

6 files changed

+46
-3
lines changed

.gitignore

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.mergify.yml

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

.projenrc.ts

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,26 @@ const project = new awscdk.AwsCdkConstructLibrary({
8383
"perf",
8484
]),
8585
githubOptions: {
86+
mergifyOptions: {
87+
rules: [
88+
{
89+
name: "Automatically merge dependency updates",
90+
conditions: [
91+
"author=cdklabs-automation",
92+
"title~=^chore: upgrade dependencies",
93+
"status-success=build",
94+
"status-success=package-js",
95+
],
96+
actions: {
97+
merge: {
98+
method: "squash",
99+
strict: true,
100+
commit_message: "title+body",
101+
},
102+
},
103+
},
104+
],
105+
},
86106
pullRequestLintOptions: {
87107
semanticTitleOptions: {
88108
types: [
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
hi

src/lambdas/assets-deployment/fs-to-s3.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,12 @@ export async function fsToS3(props: FsToS3Action, nextjsType?: NextjsType) {
5050
};
5151
},
5252
);
53-
debug({ putObjectInputs });
53+
debug(
54+
putObjectInputs.map((i) => ({
55+
bucket: i.Bucket,
56+
key: i.ContentType,
57+
})),
58+
);
5459
await Promise.all(
5560
putObjectInputs.map((input) =>
5661
new Upload({ client: s3, params: input }).done(),

src/nextjs-assets-deployment.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -185,6 +185,12 @@ export class NextjsAssetsDeployment extends Construct {
185185
destinationBucketName: this.props.staticAssetsBucket.bucketName,
186186
destinationKeyPrefix: "_next/static",
187187
},
188+
// public directory to s3 for CloudFront -> S3
189+
{
190+
type: "fs-to-s3",
191+
sourcePath: join(root, "public"),
192+
destinationBucketName: this.props.staticAssetsBucket.bucketName,
193+
},
188194
);
189195
}
190196
actions.push(
@@ -214,7 +220,7 @@ export class NextjsAssetsDeployment extends Construct {
214220
FULL_ROUTE_CACHE_DIR,
215221
),
216222
},
217-
// public dir
223+
// public directory to EFS for needed optimizing images in public directory
218224
{
219225
type: "fs-to-fs",
220226
sourcePath: join(root, "public"),

0 commit comments

Comments
 (0)