@awsless/awsless 0.0.515 → 0.0.517
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/bin.js
CHANGED
|
@@ -1688,7 +1688,15 @@ var IconsSchema = z34.record(
|
|
|
1688
1688
|
})
|
|
1689
1689
|
]).describe(
|
|
1690
1690
|
"Image transformation will be applied from a base image. Base images orginates from a local directory that will be uploaded to S3 or from a lambda function."
|
|
1691
|
-
)
|
|
1691
|
+
),
|
|
1692
|
+
cors: z34.object({
|
|
1693
|
+
override: z34.boolean().default(false),
|
|
1694
|
+
maxAge: DurationSchema.default("365 days"),
|
|
1695
|
+
exposeHeaders: z34.string().array().optional(),
|
|
1696
|
+
credentials: z34.boolean().default(false),
|
|
1697
|
+
headers: z34.string().array().default(["*"]),
|
|
1698
|
+
origins: z34.string().array().default(["*"])
|
|
1699
|
+
}).optional().describe("Specify the cors headers.")
|
|
1692
1700
|
// version: z.number().int().min(1).optional().describe('Version of the icon configuration.'),
|
|
1693
1701
|
})
|
|
1694
1702
|
).optional().describe("Define an icon proxy in your stack. Store, optimize, and deliver icons at scale.");
|
|
@@ -6280,7 +6288,7 @@ import { $ as $23, Group as Group24 } from "@awsless/formation";
|
|
|
6280
6288
|
import { join as join13, dirname as dirname9 } from "path";
|
|
6281
6289
|
import { mebibytes as mebibytes5 } from "@awsless/size";
|
|
6282
6290
|
import { days as days7, seconds as seconds10, toSeconds as toSeconds9 } from "@awsless/duration";
|
|
6283
|
-
import { constantCase as constantCase12 } from "change-case";
|
|
6291
|
+
import { camelCase as camelCase8, constantCase as constantCase12 } from "change-case";
|
|
6284
6292
|
import { fileURLToPath as fileURLToPath3 } from "url";
|
|
6285
6293
|
import { glob as glob4 } from "glob";
|
|
6286
6294
|
var __dirname3 = dirname9(fileURLToPath3(import.meta.url));
|
|
@@ -6323,9 +6331,8 @@ var iconFeature = defineFeature({
|
|
|
6323
6331
|
const serverLambda = createPrebuildLambdaFunction(group, ctx, "icon", id, {
|
|
6324
6332
|
bundleFile: join13(__dirname3, "/prebuild/icon/bundle.zip"),
|
|
6325
6333
|
bundleHash: join13(__dirname3, "/prebuild/icon/HASH"),
|
|
6326
|
-
memorySize: mebibytes5(
|
|
6327
|
-
timeout: seconds10(
|
|
6328
|
-
architecture: "x86_64",
|
|
6334
|
+
memorySize: mebibytes5(512),
|
|
6335
|
+
timeout: seconds10(10),
|
|
6329
6336
|
handler: "index.default",
|
|
6330
6337
|
runtime: "nodejs22.x",
|
|
6331
6338
|
log: props.log
|
|
@@ -6416,6 +6423,33 @@ var iconFeature = defineFeature({
|
|
|
6416
6423
|
name,
|
|
6417
6424
|
defaultTtl: toSeconds9(days7(365))
|
|
6418
6425
|
});
|
|
6426
|
+
const originRequest = new $23.aws.cloudfront.OriginRequestPolicy(group, "request", {
|
|
6427
|
+
name,
|
|
6428
|
+
headersConfig: {
|
|
6429
|
+
headerBehavior: camelCase8("all-except"),
|
|
6430
|
+
headers: {
|
|
6431
|
+
items: ["host", "authorization"]
|
|
6432
|
+
}
|
|
6433
|
+
},
|
|
6434
|
+
cookiesConfig: {
|
|
6435
|
+
cookieBehavior: "all"
|
|
6436
|
+
},
|
|
6437
|
+
queryStringsConfig: {
|
|
6438
|
+
queryStringBehavior: "all"
|
|
6439
|
+
}
|
|
6440
|
+
});
|
|
6441
|
+
const responseHeaders = new $23.aws.cloudfront.ResponseHeadersPolicy(group, "response", {
|
|
6442
|
+
name,
|
|
6443
|
+
corsConfig: {
|
|
6444
|
+
originOverride: props.cors?.override ?? false,
|
|
6445
|
+
accessControlMaxAgeSec: toSeconds9(props.cors?.maxAge ?? days7(365)),
|
|
6446
|
+
accessControlAllowHeaders: { items: props.cors?.headers ?? ["*"] },
|
|
6447
|
+
accessControlAllowMethods: { items: ["GET", "HEAD"] },
|
|
6448
|
+
accessControlAllowOrigins: { items: props.cors?.origins ?? ["*"] },
|
|
6449
|
+
accessControlExposeHeaders: { items: props.cors?.exposeHeaders ?? ["*"] },
|
|
6450
|
+
accessControlAllowCredentials: props.cors?.credentials ?? false
|
|
6451
|
+
}
|
|
6452
|
+
});
|
|
6419
6453
|
const distribution = new $23.aws.cloudfront.Distribution(group, "distribution", {
|
|
6420
6454
|
comment: name,
|
|
6421
6455
|
enabled: true,
|
|
@@ -6472,7 +6506,9 @@ var iconFeature = defineFeature({
|
|
|
6472
6506
|
cachePolicyId: cache.id,
|
|
6473
6507
|
viewerProtocolPolicy: "redirect-to-https",
|
|
6474
6508
|
allowedMethods: ["GET", "HEAD"],
|
|
6475
|
-
cachedMethods: ["GET", "HEAD"]
|
|
6509
|
+
cachedMethods: ["GET", "HEAD"],
|
|
6510
|
+
originRequestPolicyId: originRequest.id,
|
|
6511
|
+
responseHeadersPolicyId: responseHeaders.id
|
|
6476
6512
|
}
|
|
6477
6513
|
});
|
|
6478
6514
|
new $23.aws.s3.BucketPolicy(
|
|
@@ -1090,7 +1090,15 @@ var IconsSchema = z31.record(
|
|
|
1090
1090
|
})
|
|
1091
1091
|
]).describe(
|
|
1092
1092
|
"Image transformation will be applied from a base image. Base images orginates from a local directory that will be uploaded to S3 or from a lambda function."
|
|
1093
|
-
)
|
|
1093
|
+
),
|
|
1094
|
+
cors: z31.object({
|
|
1095
|
+
override: z31.boolean().default(false),
|
|
1096
|
+
maxAge: DurationSchema.default("365 days"),
|
|
1097
|
+
exposeHeaders: z31.string().array().optional(),
|
|
1098
|
+
credentials: z31.boolean().default(false),
|
|
1099
|
+
headers: z31.string().array().default(["*"]),
|
|
1100
|
+
origins: z31.string().array().default(["*"])
|
|
1101
|
+
}).optional().describe("Specify the cors headers.")
|
|
1094
1102
|
// version: z.number().int().min(1).optional().describe('Version of the icon configuration.'),
|
|
1095
1103
|
})
|
|
1096
1104
|
).optional().describe("Define an icon proxy in your stack. Store, optimize, and deliver icons at scale.");
|
|
Binary file
|
|
Binary file
|
|
Binary file
|