@awsless/awsless 0.0.442 → 0.0.443
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/dist/app.json +1 -1
- package/dist/bin.js +16 -13
- package/dist/build-json-schema.js +596 -593
- package/dist/prebuild/rpc/bundle.zip +0 -0
- package/dist/stack.json +1 -1
- package/package.json +13 -13
package/dist/bin.js
CHANGED
|
@@ -10803,7 +10803,7 @@ var createLambdaFunction = (group, ctx, ns, id, local2) => {
|
|
|
10803
10803
|
file: fileCode.file,
|
|
10804
10804
|
external: [
|
|
10805
10805
|
...fileCode.external ?? [],
|
|
10806
|
-
...props.layers
|
|
10806
|
+
...(props.layers ?? []).flatMap((id2) => ctx.shared.get(`layer-${id2}-packages`))
|
|
10807
10807
|
],
|
|
10808
10808
|
minify: fileCode.minify,
|
|
10809
10809
|
nativeDir: temp.path
|
|
@@ -13159,23 +13159,23 @@ var siteFeature = defineFeature({
|
|
|
13159
13159
|
ctx.onBind((name2, value) => {
|
|
13160
13160
|
lambda.addEnvironment(name2, value);
|
|
13161
13161
|
});
|
|
13162
|
+
new aws19.lambda.Permission(group, "ssr-permission", {
|
|
13163
|
+
principal: "cloudfront.amazonaws.com",
|
|
13164
|
+
action: "lambda:InvokeFunctionUrl",
|
|
13165
|
+
functionArn: lambda.arn,
|
|
13166
|
+
urlAuthType: "aws-iam",
|
|
13167
|
+
sourceArn: `arn:aws:cloudfront::${ctx.accountId}:distribution/*`
|
|
13168
|
+
});
|
|
13162
13169
|
const url = new aws19.lambda.Url(group, "url", {
|
|
13163
13170
|
targetArn: lambda.arn,
|
|
13164
13171
|
authType: "aws-iam"
|
|
13165
13172
|
});
|
|
13166
|
-
const ssrAccessControl = new aws19.cloudFront.OriginAccessControl(group,
|
|
13167
|
-
name
|
|
13173
|
+
const ssrAccessControl = new aws19.cloudFront.OriginAccessControl(group, "ssr-access", {
|
|
13174
|
+
name: `${name}-ssr`,
|
|
13168
13175
|
type: "lambda",
|
|
13169
13176
|
behavior: "always",
|
|
13170
13177
|
protocol: "sigv4"
|
|
13171
13178
|
});
|
|
13172
|
-
new aws19.lambda.Permission(group, "ssr-permission", {
|
|
13173
|
-
principal: "cloudfront.amazonaws.com",
|
|
13174
|
-
action: "lambda:InvokeFunctionUrl",
|
|
13175
|
-
functionArn: lambda.arn,
|
|
13176
|
-
urlAuthType: "aws-iam",
|
|
13177
|
-
sourceArn: `arn:aws:cloudfront::${ctx.accountId}:distribution/*`
|
|
13178
|
-
});
|
|
13179
13179
|
ssrAccessControl.deletionPolicy = "after-deployment";
|
|
13180
13180
|
origins.push({
|
|
13181
13181
|
id: "ssr",
|
|
@@ -13211,13 +13211,13 @@ var siteFeature = defineFeature({
|
|
|
13211
13211
|
policy.addStatement(bucket.permissions);
|
|
13212
13212
|
});
|
|
13213
13213
|
bucket.deletionPolicy = "after-deployment";
|
|
13214
|
-
const
|
|
13214
|
+
const accessControl = new aws19.cloudFront.OriginAccessControl(group, `access`, {
|
|
13215
13215
|
name,
|
|
13216
13216
|
type: "s3",
|
|
13217
13217
|
behavior: "always",
|
|
13218
13218
|
protocol: "sigv4"
|
|
13219
13219
|
});
|
|
13220
|
-
|
|
13220
|
+
accessControl.deletionPolicy = "after-deployment";
|
|
13221
13221
|
if (typeof props.static === "string") {
|
|
13222
13222
|
const files = glob2.sync("**", {
|
|
13223
13223
|
cwd: props.static,
|
|
@@ -13238,7 +13238,9 @@ var siteFeature = defineFeature({
|
|
|
13238
13238
|
origins.push({
|
|
13239
13239
|
id: "static",
|
|
13240
13240
|
domainName: bucket.regionalDomainName,
|
|
13241
|
-
originAccessControlId:
|
|
13241
|
+
originAccessControlId: accessControl.id,
|
|
13242
|
+
originAccessIdentityId: ""
|
|
13243
|
+
// is required to have an value for s3 origins when using origin access control
|
|
13242
13244
|
});
|
|
13243
13245
|
}
|
|
13244
13246
|
if (props.ssr && props.static) {
|
|
@@ -14614,6 +14616,7 @@ var buildAssets = async (builders, stackFilters, showResult = false) => {
|
|
|
14614
14616
|
});
|
|
14615
14617
|
results.push({ ...builder, result });
|
|
14616
14618
|
} catch (error) {
|
|
14619
|
+
console.log(error);
|
|
14617
14620
|
logError(new Error(`Build failed for: ${builder.type} ${builder.name}`));
|
|
14618
14621
|
throw error;
|
|
14619
14622
|
}
|