sst 2.0.28 → 2.0.29
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/constructs/NextjsSite.js +7 -0
- package/package.json +1 -1
package/constructs/NextjsSite.js
CHANGED
|
@@ -10,6 +10,7 @@ import { SsrFunction } from "./SsrFunction.js";
|
|
|
10
10
|
import { EdgeFunction } from "./EdgeFunction.js";
|
|
11
11
|
import { SsrSite } from "./SsrSite.js";
|
|
12
12
|
import { toCdkSize } from "./util/size.js";
|
|
13
|
+
import { PolicyStatement } from "aws-cdk-lib/aws-iam";
|
|
13
14
|
const __dirname = url.fileURLToPath(new URL(".", import.meta.url));
|
|
14
15
|
/**
|
|
15
16
|
* The `NextjsSite` construct is a higher level CDK construct that makes it easy to create a Next.js app.
|
|
@@ -72,6 +73,12 @@ export class NextjsSite extends SsrSite {
|
|
|
72
73
|
environment: {
|
|
73
74
|
BUCKET_NAME: this.cdk.bucket.bucketName,
|
|
74
75
|
},
|
|
76
|
+
initialPolicy: [
|
|
77
|
+
new PolicyStatement({
|
|
78
|
+
actions: ["s3:GetObject"],
|
|
79
|
+
resources: [this.cdk.bucket.arnForObjects("*")],
|
|
80
|
+
}),
|
|
81
|
+
],
|
|
75
82
|
});
|
|
76
83
|
}
|
|
77
84
|
createMiddlewareEdgeFunctionForRegional() {
|