@awsless/awsless 0.0.145 → 0.0.147
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 +132 -82
- package/dist/features/cognito-client-secret/bundle.zip +0 -0
- package/dist/features/delete-bucket/bundle.zip +0 -0
- package/dist/features/delete-hosted-zone/bundle.zip +0 -0
- package/dist/features/global-exports/bundle.zip +0 -0
- package/dist/features/invalidate-cache/bundle.zip +0 -0
- package/dist/features/upload-bucket-asset/bundle.zip +0 -0
- package/dist/index.d.ts +2077 -290
- package/dist/json.js +26 -4
- package/dist/stack.json +1 -1
- package/package.json +2 -2
package/dist/bin.js
CHANGED
|
@@ -55,6 +55,9 @@ var flushDebug = () => {
|
|
|
55
55
|
return queue.splice(0, queue.length);
|
|
56
56
|
};
|
|
57
57
|
|
|
58
|
+
// src/formation/resource/lambda/function.ts
|
|
59
|
+
import { constantCase as constantCase3 } from "change-case";
|
|
60
|
+
|
|
58
61
|
// src/formation/asset.ts
|
|
59
62
|
import { paramCase } from "change-case";
|
|
60
63
|
var Asset = class {
|
|
@@ -65,6 +68,43 @@ var Asset = class {
|
|
|
65
68
|
id;
|
|
66
69
|
};
|
|
67
70
|
|
|
71
|
+
// src/formation/property/duration.ts
|
|
72
|
+
var Duration = class _Duration {
|
|
73
|
+
constructor(value) {
|
|
74
|
+
this.value = value;
|
|
75
|
+
}
|
|
76
|
+
static milliseconds(value) {
|
|
77
|
+
return new _Duration(value);
|
|
78
|
+
}
|
|
79
|
+
static seconds(value) {
|
|
80
|
+
return new _Duration(value * 1e3 /* seconds */);
|
|
81
|
+
}
|
|
82
|
+
static minutes(value) {
|
|
83
|
+
return new _Duration(value * 6e4 /* minutes */);
|
|
84
|
+
}
|
|
85
|
+
static hours(value) {
|
|
86
|
+
return new _Duration(value * 36e5 /* hours */);
|
|
87
|
+
}
|
|
88
|
+
static days(value) {
|
|
89
|
+
return new _Duration(value * 864e5 /* days */);
|
|
90
|
+
}
|
|
91
|
+
toMilliseconds() {
|
|
92
|
+
return this.value;
|
|
93
|
+
}
|
|
94
|
+
toSeconds() {
|
|
95
|
+
return Math.floor(this.value / 1e3 /* seconds */);
|
|
96
|
+
}
|
|
97
|
+
toMinutes() {
|
|
98
|
+
return Math.floor(this.value / 6e4 /* minutes */);
|
|
99
|
+
}
|
|
100
|
+
toHours() {
|
|
101
|
+
return Math.floor(this.value / 36e5 /* hours */);
|
|
102
|
+
}
|
|
103
|
+
toDays() {
|
|
104
|
+
return Math.floor(this.value / 864e5 /* days */);
|
|
105
|
+
}
|
|
106
|
+
};
|
|
107
|
+
|
|
68
108
|
// src/formation/util.ts
|
|
69
109
|
import { paramCase as paramCase2, pascalCase } from "change-case";
|
|
70
110
|
var ref = (logicalId) => {
|
|
@@ -303,7 +343,7 @@ var Rule = class extends Resource {
|
|
|
303
343
|
properties() {
|
|
304
344
|
return {
|
|
305
345
|
Name: this.name,
|
|
306
|
-
...this.attr("State", "ENABLED"),
|
|
346
|
+
...this.attr("State", this.props.enabled ? "ENABLED" : "DISABLED"),
|
|
307
347
|
...this.attr("Description", this.props.description),
|
|
308
348
|
...this.attr("ScheduleExpression", this.props.schedule),
|
|
309
349
|
...this.attr("RoleArn", this.props.roleArn),
|
|
@@ -341,11 +381,14 @@ var EventsEventSource = class extends Group {
|
|
|
341
381
|
constructor(id, lambda, props) {
|
|
342
382
|
const rule = new Rule(id, {
|
|
343
383
|
schedule: props.schedule,
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
384
|
+
enabled: props.enabled,
|
|
385
|
+
targets: [
|
|
386
|
+
{
|
|
387
|
+
id,
|
|
388
|
+
arn: lambda.arn,
|
|
389
|
+
input: props.payload
|
|
390
|
+
}
|
|
391
|
+
]
|
|
349
392
|
});
|
|
350
393
|
const permission = new Permission(id, {
|
|
351
394
|
action: "lambda:InvokeFunction",
|
|
@@ -411,11 +454,22 @@ var Function = class extends Resource {
|
|
|
411
454
|
if (this.name.length > 64) {
|
|
412
455
|
throw new TypeError(`Lambda function name length can't be greater then 64. ${this.name}`);
|
|
413
456
|
}
|
|
457
|
+
if (props.log) {
|
|
458
|
+
if (typeof props.log === "boolean") {
|
|
459
|
+
this.enableLogs(Duration.days(7));
|
|
460
|
+
} else if (props.log instanceof Duration) {
|
|
461
|
+
this.enableLogs(props.log);
|
|
462
|
+
} else {
|
|
463
|
+
this.enableLogs(props.log.retention);
|
|
464
|
+
this.logConfig = props.log;
|
|
465
|
+
}
|
|
466
|
+
}
|
|
414
467
|
}
|
|
415
468
|
name;
|
|
416
469
|
role;
|
|
417
470
|
policy;
|
|
418
471
|
environmentVariables;
|
|
472
|
+
logConfig = {};
|
|
419
473
|
enableLogs(retention) {
|
|
420
474
|
const logGroup = new LogGroup(this._logicalId, {
|
|
421
475
|
name: sub("/aws/lambda/${name}", {
|
|
@@ -439,6 +493,7 @@ var Function = class extends Resource {
|
|
|
439
493
|
warmUp(concurrency) {
|
|
440
494
|
const source = new EventsEventSource(`${this._logicalId}-warmer`, this, {
|
|
441
495
|
schedule: "rate(5 minutes)",
|
|
496
|
+
enabled: true,
|
|
442
497
|
payload: {
|
|
443
498
|
warmer: true,
|
|
444
499
|
concurrency
|
|
@@ -497,6 +552,13 @@ var Function = class extends Resource {
|
|
|
497
552
|
EphemeralStorage: {
|
|
498
553
|
Size: this.props.ephemeralStorageSize?.toMegaBytes() ?? 512
|
|
499
554
|
},
|
|
555
|
+
...this.props.log ? {
|
|
556
|
+
LoggingConfig: {
|
|
557
|
+
LogFormat: this.logConfig.format === "text" ? "Text" : "JSON",
|
|
558
|
+
ApplicationLogLevel: constantCase3(this.logConfig.level ?? "error"),
|
|
559
|
+
SystemLogLevel: constantCase3(this.logConfig.system ?? "warn")
|
|
560
|
+
}
|
|
561
|
+
} : {},
|
|
500
562
|
...this.props.vpc ? {
|
|
501
563
|
VpcConfig: {
|
|
502
564
|
SecurityGroupIds: this.props.vpc.securityGroupIds,
|
|
@@ -749,7 +811,7 @@ var fileExist = async (file) => {
|
|
|
749
811
|
|
|
750
812
|
// src/util/type-gen.ts
|
|
751
813
|
import { dirname, join as join2, relative } from "path";
|
|
752
|
-
import { camelCase, constantCase as
|
|
814
|
+
import { camelCase, constantCase as constantCase4 } from "change-case";
|
|
753
815
|
var generateResourceTypes = async (config2) => {
|
|
754
816
|
const files = [];
|
|
755
817
|
await Promise.all(
|
|
@@ -860,7 +922,7 @@ var TypeObject = class {
|
|
|
860
922
|
return this.add(camelCase(name), type);
|
|
861
923
|
}
|
|
862
924
|
addConst(name, type) {
|
|
863
|
-
return this.add(
|
|
925
|
+
return this.add(constantCase4(name), type);
|
|
864
926
|
}
|
|
865
927
|
toString() {
|
|
866
928
|
if (!this.types.size) {
|
|
@@ -883,43 +945,6 @@ var TypeObject = class {
|
|
|
883
945
|
}
|
|
884
946
|
};
|
|
885
947
|
|
|
886
|
-
// src/formation/property/duration.ts
|
|
887
|
-
var Duration = class _Duration {
|
|
888
|
-
constructor(value) {
|
|
889
|
-
this.value = value;
|
|
890
|
-
}
|
|
891
|
-
static milliseconds(value) {
|
|
892
|
-
return new _Duration(value);
|
|
893
|
-
}
|
|
894
|
-
static seconds(value) {
|
|
895
|
-
return new _Duration(value * 1e3 /* seconds */);
|
|
896
|
-
}
|
|
897
|
-
static minutes(value) {
|
|
898
|
-
return new _Duration(value * 6e4 /* minutes */);
|
|
899
|
-
}
|
|
900
|
-
static hours(value) {
|
|
901
|
-
return new _Duration(value * 36e5 /* hours */);
|
|
902
|
-
}
|
|
903
|
-
static days(value) {
|
|
904
|
-
return new _Duration(value * 864e5 /* days */);
|
|
905
|
-
}
|
|
906
|
-
toMilliseconds() {
|
|
907
|
-
return this.value;
|
|
908
|
-
}
|
|
909
|
-
toSeconds() {
|
|
910
|
-
return Math.floor(this.value / 1e3 /* seconds */);
|
|
911
|
-
}
|
|
912
|
-
toMinutes() {
|
|
913
|
-
return Math.floor(this.value / 6e4 /* minutes */);
|
|
914
|
-
}
|
|
915
|
-
toHours() {
|
|
916
|
-
return Math.floor(this.value / 36e5 /* hours */);
|
|
917
|
-
}
|
|
918
|
-
toDays() {
|
|
919
|
-
return Math.floor(this.value / 864e5 /* days */);
|
|
920
|
-
}
|
|
921
|
-
};
|
|
922
|
-
|
|
923
948
|
// src/util/byte-size.ts
|
|
924
949
|
import { filesize } from "filesize";
|
|
925
950
|
var formatByteSize = (size) => {
|
|
@@ -1415,9 +1440,6 @@ var toLambdaFunction = (ctx, id, fileOrProps) => {
|
|
|
1415
1440
|
lambda.addPermissions(fileOrProps.permissions);
|
|
1416
1441
|
}
|
|
1417
1442
|
lambda.addEnvironment("APP", config2.app.name).addEnvironment("STAGE", config2.app.stage).addEnvironment("STACK", stack.name);
|
|
1418
|
-
if (props.log) {
|
|
1419
|
-
lambda.enableLogs(props.log instanceof Duration ? props.log : void 0);
|
|
1420
|
-
}
|
|
1421
1443
|
if (props.warm) {
|
|
1422
1444
|
lambda.warmUp(props.warm);
|
|
1423
1445
|
}
|
|
@@ -1444,7 +1466,7 @@ var toLambdaFunction = (ctx, id, fileOrProps) => {
|
|
|
1444
1466
|
};
|
|
1445
1467
|
|
|
1446
1468
|
// src/formation/resource/cognito/user-pool.ts
|
|
1447
|
-
import { constantCase as
|
|
1469
|
+
import { constantCase as constantCase5 } from "change-case";
|
|
1448
1470
|
|
|
1449
1471
|
// src/formation/resource/cognito/user-pool-client.ts
|
|
1450
1472
|
var UserPoolClient = class extends Resource {
|
|
@@ -1683,7 +1705,7 @@ var UserPoolEmail = class _UserPoolEmail {
|
|
|
1683
1705
|
}
|
|
1684
1706
|
toJSON() {
|
|
1685
1707
|
return {
|
|
1686
|
-
...this.props.type ? { EmailSendingAccount:
|
|
1708
|
+
...this.props.type ? { EmailSendingAccount: constantCase5(this.props.type) } : {},
|
|
1687
1709
|
...this.props.from ? { From: this.props.from } : {},
|
|
1688
1710
|
...this.props.replyTo ? { ReplyToEmailAddress: this.props.replyTo } : {},
|
|
1689
1711
|
...this.props.sourceArn ? { SourceArn: this.props.sourceArn } : {}
|
|
@@ -1692,7 +1714,7 @@ var UserPoolEmail = class _UserPoolEmail {
|
|
|
1692
1714
|
};
|
|
1693
1715
|
|
|
1694
1716
|
// src/plugins/auth/index.ts
|
|
1695
|
-
import { constantCase as
|
|
1717
|
+
import { constantCase as constantCase6 } from "change-case";
|
|
1696
1718
|
|
|
1697
1719
|
// src/formation/resource/cloud-formation/custom-resource.ts
|
|
1698
1720
|
var CustomResource = class extends Resource {
|
|
@@ -1727,17 +1749,19 @@ var authPlugin = definePlugin({
|
|
|
1727
1749
|
gen.addInterface("AuthResources", resources);
|
|
1728
1750
|
await write("auth.d.ts", gen, true);
|
|
1729
1751
|
},
|
|
1730
|
-
onStack({ bootstrap: bootstrap2, stackConfig, bind }) {
|
|
1752
|
+
onStack({ config: config2, bootstrap: bootstrap2, stackConfig, bind }) {
|
|
1731
1753
|
for (const [id, props] of Object.entries(stackConfig.auth ?? {})) {
|
|
1732
1754
|
if (props.access) {
|
|
1733
1755
|
const userPoolId = bootstrap2.import(`auth-${id}-user-pool-id`);
|
|
1734
1756
|
const clientId = bootstrap2.import(`auth-${id}-client-id`);
|
|
1735
|
-
const
|
|
1736
|
-
const name = constantCase5(id);
|
|
1757
|
+
const name = constantCase6(id);
|
|
1737
1758
|
bind((lambda) => {
|
|
1738
1759
|
lambda.addEnvironment(`AUTH_${name}_USER_POOL_ID`, userPoolId);
|
|
1739
1760
|
lambda.addEnvironment(`AUTH_${name}_CLIENT_ID`, clientId);
|
|
1740
|
-
|
|
1761
|
+
if (config2.app.defaults.auth?.[id]?.secret) {
|
|
1762
|
+
const clientSecret = bootstrap2.import(`auth-${id}-client-secret`);
|
|
1763
|
+
lambda.addEnvironment(`AUTH_${name}_CLIENT_SECRET`, clientSecret);
|
|
1764
|
+
}
|
|
1741
1765
|
lambda.addPermissions({
|
|
1742
1766
|
actions: ["cognito:*"],
|
|
1743
1767
|
resources: ["*"]
|
|
@@ -1813,14 +1837,17 @@ var authPlugin = definePlugin({
|
|
|
1813
1837
|
const domain = userPool.addDomain({
|
|
1814
1838
|
domain: `${config2.app.name}-${id}`
|
|
1815
1839
|
});
|
|
1816
|
-
|
|
1817
|
-
|
|
1818
|
-
|
|
1819
|
-
|
|
1820
|
-
|
|
1821
|
-
|
|
1822
|
-
|
|
1823
|
-
|
|
1840
|
+
if (props.secret) {
|
|
1841
|
+
const clientSecret = new CustomResource(`${id}-client-secret`, {
|
|
1842
|
+
serviceToken: clientSecretLambda.arn,
|
|
1843
|
+
properties: {
|
|
1844
|
+
userPoolId: userPool.id,
|
|
1845
|
+
clientId: client.id
|
|
1846
|
+
}
|
|
1847
|
+
}).dependsOn(client, userPool);
|
|
1848
|
+
bootstrap2.add(clientSecret).export(`auth-${id}-client-secret`, clientSecret.getAtt("secret"));
|
|
1849
|
+
}
|
|
1850
|
+
bootstrap2.add(userPool).export(`auth-${id}-user-pool-arn`, userPool.arn).export(`auth-${id}-user-pool-id`, userPool.id).export(`auth-${id}-client-id`, client.id).export(`auth-${id}-domain`, domain.domain);
|
|
1824
1851
|
for (const [event, lambda] of functions) {
|
|
1825
1852
|
const permission = new Permission(`auth-${id}-${event}`, {
|
|
1826
1853
|
action: "lambda:InvokeFunction",
|
|
@@ -2037,7 +2064,7 @@ var Port = class _Port {
|
|
|
2037
2064
|
};
|
|
2038
2065
|
|
|
2039
2066
|
// src/plugins/cache/index.ts
|
|
2040
|
-
import { constantCase as
|
|
2067
|
+
import { constantCase as constantCase7 } from "change-case";
|
|
2041
2068
|
var typeGenCode2 = `
|
|
2042
2069
|
import { Cluster, CommandOptions } from '@awsless/redis'
|
|
2043
2070
|
|
|
@@ -2089,8 +2116,8 @@ var cachePlugin = definePlugin({
|
|
|
2089
2116
|
}).dependsOn(subnetGroup, securityGroup);
|
|
2090
2117
|
stack.add(subnetGroup, securityGroup, cluster);
|
|
2091
2118
|
bind((lambda) => {
|
|
2092
|
-
lambda.addEnvironment(`CACHE_${
|
|
2093
|
-
`CACHE_${
|
|
2119
|
+
lambda.addEnvironment(`CACHE_${constantCase7(stack.name)}_${constantCase7(id)}_HOST`, cluster.address).addEnvironment(
|
|
2120
|
+
`CACHE_${constantCase7(stack.name)}_${constantCase7(id)}_PORT`,
|
|
2094
2121
|
props.port.toString()
|
|
2095
2122
|
);
|
|
2096
2123
|
});
|
|
@@ -2242,6 +2269,7 @@ var cronPlugin = definePlugin({
|
|
|
2242
2269
|
const lambda = toLambdaFunction(ctx, id, props.consumer);
|
|
2243
2270
|
const source = new EventsEventSource(id, lambda, {
|
|
2244
2271
|
schedule: props.schedule,
|
|
2272
|
+
enabled: props.enabled,
|
|
2245
2273
|
payload: props.payload
|
|
2246
2274
|
});
|
|
2247
2275
|
stack.add(lambda, source);
|
|
@@ -2371,7 +2399,7 @@ var ConfigurationSet = class extends Resource {
|
|
|
2371
2399
|
};
|
|
2372
2400
|
|
|
2373
2401
|
// src/formation/resource/ses/email-identity.ts
|
|
2374
|
-
import { constantCase as
|
|
2402
|
+
import { constantCase as constantCase8 } from "change-case";
|
|
2375
2403
|
var EmailIdentity = class extends Resource {
|
|
2376
2404
|
constructor(logicalId, props) {
|
|
2377
2405
|
super("AWS::SES::EmailIdentity", logicalId);
|
|
@@ -2432,7 +2460,7 @@ var EmailIdentity = class extends Resource {
|
|
|
2432
2460
|
SigningEnabled: true
|
|
2433
2461
|
},
|
|
2434
2462
|
DkimSigningAttributes: {
|
|
2435
|
-
NextSigningKeyLength:
|
|
2463
|
+
NextSigningKeyLength: constantCase8(this.props.dkim)
|
|
2436
2464
|
}
|
|
2437
2465
|
} : {},
|
|
2438
2466
|
FeedbackAttributes: {
|
|
@@ -3263,7 +3291,7 @@ var LoadBalancer = class extends Resource {
|
|
|
3263
3291
|
};
|
|
3264
3292
|
|
|
3265
3293
|
// src/formation/resource/elb/listener.ts
|
|
3266
|
-
import { constantCase as
|
|
3294
|
+
import { constantCase as constantCase9 } from "change-case";
|
|
3267
3295
|
var Listener = class extends Resource {
|
|
3268
3296
|
constructor(logicalId, props) {
|
|
3269
3297
|
super("AWS::ElasticLoadBalancingV2::Listener", logicalId);
|
|
@@ -3279,7 +3307,7 @@ var Listener = class extends Resource {
|
|
|
3279
3307
|
return {
|
|
3280
3308
|
LoadBalancerArn: this.props.loadBalancerArn,
|
|
3281
3309
|
Port: this.props.port,
|
|
3282
|
-
Protocol:
|
|
3310
|
+
Protocol: constantCase9(this.props.protocol),
|
|
3283
3311
|
Certificates: this.props.certificates.map((arn) => ({
|
|
3284
3312
|
CertificateArn: arn
|
|
3285
3313
|
})),
|
|
@@ -3632,7 +3660,7 @@ var httpPlugin = definePlugin({
|
|
|
3632
3660
|
});
|
|
3633
3661
|
|
|
3634
3662
|
// src/formation/resource/lambda/event-source-mapping.ts
|
|
3635
|
-
import { constantCase as
|
|
3663
|
+
import { constantCase as constantCase10 } from "change-case";
|
|
3636
3664
|
var EventSourceMapping = class extends Resource {
|
|
3637
3665
|
constructor(logicalId, props) {
|
|
3638
3666
|
super("AWS::Lambda::EventSourceMapping", logicalId);
|
|
@@ -3654,7 +3682,7 @@ var EventSourceMapping = class extends Resource {
|
|
|
3654
3682
|
...this.attr("ParallelizationFactor", this.props.parallelizationFactor),
|
|
3655
3683
|
...this.attr("TumblingWindowInSeconds", this.props.tumblingWindow?.toSeconds()),
|
|
3656
3684
|
...this.attr("BisectBatchOnFunctionError", this.props.bisectBatchOnError),
|
|
3657
|
-
...this.attr("StartingPosition", this.props.startingPosition &&
|
|
3685
|
+
...this.attr("StartingPosition", this.props.startingPosition && constantCase10(this.props.startingPosition)),
|
|
3658
3686
|
...this.attr("StartingPositionTimestamp", this.props.startingPositionTimestamp),
|
|
3659
3687
|
...this.props.maxConcurrency ? {
|
|
3660
3688
|
ScalingConfig: {
|
|
@@ -3850,7 +3878,7 @@ var pubsubPlugin = definePlugin({
|
|
|
3850
3878
|
});
|
|
3851
3879
|
|
|
3852
3880
|
// src/plugins/queue/index.ts
|
|
3853
|
-
import { camelCase as camelCase4, constantCase as
|
|
3881
|
+
import { camelCase as camelCase4, constantCase as constantCase11 } from "change-case";
|
|
3854
3882
|
import { relative as relative4 } from "path";
|
|
3855
3883
|
var typeGenCode3 = `
|
|
3856
3884
|
import { SendMessageOptions, SendMessageBatchOptions, BatchItem } from '@awsless/sqs'
|
|
@@ -3919,7 +3947,7 @@ var queuePlugin = definePlugin({
|
|
|
3919
3947
|
stack.add(queue2, lambda, source);
|
|
3920
3948
|
bind((lambda2) => {
|
|
3921
3949
|
lambda2.addPermissions(queue2.permissions);
|
|
3922
|
-
lambda2.addEnvironment(`QUEUE_${
|
|
3950
|
+
lambda2.addEnvironment(`QUEUE_${constantCase11(stack.name)}_${constantCase11(id)}_URL`, queue2.url);
|
|
3923
3951
|
});
|
|
3924
3952
|
}
|
|
3925
3953
|
}
|
|
@@ -4869,7 +4897,7 @@ var storePlugin = definePlugin({
|
|
|
4869
4897
|
});
|
|
4870
4898
|
|
|
4871
4899
|
// src/formation/resource/dynamodb/table.ts
|
|
4872
|
-
import { constantCase as
|
|
4900
|
+
import { constantCase as constantCase12 } from "change-case";
|
|
4873
4901
|
var Table = class extends Resource {
|
|
4874
4902
|
constructor(logicalId, props) {
|
|
4875
4903
|
super("AWS::DynamoDB::Table", logicalId);
|
|
@@ -4954,7 +4982,7 @@ var Table = class extends Resource {
|
|
|
4954
4982
|
return {
|
|
4955
4983
|
TableName: this.name,
|
|
4956
4984
|
BillingMode: "PAY_PER_REQUEST",
|
|
4957
|
-
TableClass:
|
|
4985
|
+
TableClass: constantCase12(this.props.class || "standard"),
|
|
4958
4986
|
PointInTimeRecoverySpecification: {
|
|
4959
4987
|
PointInTimeRecoveryEnabled: this.props.pointInTimeRecovery || false
|
|
4960
4988
|
},
|
|
@@ -4965,7 +4993,7 @@ var Table = class extends Resource {
|
|
|
4965
4993
|
AttributeDefinitions: this.attributeDefinitions(),
|
|
4966
4994
|
...this.props.stream ? {
|
|
4967
4995
|
StreamSpecification: {
|
|
4968
|
-
StreamViewType:
|
|
4996
|
+
StreamViewType: constantCase12(this.props.stream)
|
|
4969
4997
|
}
|
|
4970
4998
|
} : {},
|
|
4971
4999
|
...this.props.timeToLiveAttribute ? {
|
|
@@ -4982,7 +5010,7 @@ var Table = class extends Resource {
|
|
|
4982
5010
|
...props.sort ? [{ KeyType: "RANGE", AttributeName: props.sort }] : []
|
|
4983
5011
|
],
|
|
4984
5012
|
Projection: {
|
|
4985
|
-
ProjectionType:
|
|
5013
|
+
ProjectionType: constantCase12(props.projection || "all")
|
|
4986
5014
|
}
|
|
4987
5015
|
}))
|
|
4988
5016
|
} : {}
|
|
@@ -5721,9 +5749,6 @@ var PermissionSchema = z7.object({
|
|
|
5721
5749
|
resources: z7.string().array()
|
|
5722
5750
|
});
|
|
5723
5751
|
var PermissionsSchema = z7.union([PermissionSchema, PermissionSchema.array()]).describe("Add IAM permissions to your function.");
|
|
5724
|
-
var LogSchema = z7.union([z7.boolean(), DurationSchema.refine(durationMin(Duration.days(1)), "Minimum log retention is 1 day")]).describe(
|
|
5725
|
-
"Enable logging to a CloudWatch log group. Providing a duration value will set the log retention time."
|
|
5726
|
-
);
|
|
5727
5752
|
var WarmSchema = z7.number().int().min(0).max(10).describe(
|
|
5728
5753
|
"Specify how many functions you want to warm up each 5 minutes. You can specify a number from 0 to 10."
|
|
5729
5754
|
);
|
|
@@ -5731,6 +5756,25 @@ var VPCSchema = z7.boolean().describe("Put the function inside your global VPC."
|
|
|
5731
5756
|
var MinifySchema = z7.boolean().describe("Minify the function code.");
|
|
5732
5757
|
var HandlerSchema = z7.string().describe("The name of the exported method within your code that Lambda calls to run your function.");
|
|
5733
5758
|
var FileSchema = LocalFileSchema.describe("The file path of the function code.");
|
|
5759
|
+
var LogRetentionSchema = DurationSchema.refine(durationMin(Duration.days(1)), "Minimum log retention is 1 day");
|
|
5760
|
+
var LogSchema = z7.union([
|
|
5761
|
+
z7.boolean(),
|
|
5762
|
+
LogRetentionSchema,
|
|
5763
|
+
z7.object({
|
|
5764
|
+
retention: LogRetentionSchema.describe("The log retention duration."),
|
|
5765
|
+
format: z7.enum(["text", "json"]).describe(
|
|
5766
|
+
`The format in which Lambda sends your function's application and system logs to CloudWatch. Select between plain text and structured JSON.`
|
|
5767
|
+
).optional(),
|
|
5768
|
+
system: z7.enum(["debug", "info", "warn"]).describe(
|
|
5769
|
+
"Set this property to filter the system logs for your function that Lambda sends to CloudWatch. Lambda only sends system logs at the selected level of detail and lower, where DEBUG is the highest level and WARN is the lowest."
|
|
5770
|
+
).optional(),
|
|
5771
|
+
level: z7.enum(["trace", "debug", "info", "warn", "error", "fatal"]).describe(
|
|
5772
|
+
"Set this property to filter the application logs for your function that Lambda sends to CloudWatch. Lambda only sends application logs at the selected level of detail and lower, where TRACE is the highest level and FATAL is the lowest."
|
|
5773
|
+
).optional()
|
|
5774
|
+
})
|
|
5775
|
+
]).describe(
|
|
5776
|
+
"Enable logging to a CloudWatch log group. Providing a duration value will set the log retention time."
|
|
5777
|
+
);
|
|
5734
5778
|
var FunctionSchema = z7.union([
|
|
5735
5779
|
LocalFileSchema,
|
|
5736
5780
|
z7.object({
|
|
@@ -5757,7 +5801,12 @@ var FunctionDefaultSchema = z7.object({
|
|
|
5757
5801
|
minify: MinifySchema.default(true),
|
|
5758
5802
|
warm: WarmSchema.default(0),
|
|
5759
5803
|
vpc: VPCSchema.default(false),
|
|
5760
|
-
log: LogSchema.default(
|
|
5804
|
+
log: LogSchema.default({
|
|
5805
|
+
retention: "7 days",
|
|
5806
|
+
level: "error",
|
|
5807
|
+
system: "warn",
|
|
5808
|
+
format: "json"
|
|
5809
|
+
}),
|
|
5761
5810
|
timeout: TimeoutSchema.default("10 seconds"),
|
|
5762
5811
|
runtime: RuntimeSchema.default("nodejs20.x"),
|
|
5763
5812
|
memorySize: MemorySizeSchema.default("128 MB"),
|
|
@@ -6073,6 +6122,7 @@ var ScheduleExpressionSchema = RateExpressionSchema.or(CronExpressionSchema);
|
|
|
6073
6122
|
var CronsSchema = z17.record(
|
|
6074
6123
|
ResourceIdSchema,
|
|
6075
6124
|
z17.object({
|
|
6125
|
+
enabled: z17.boolean().default(true).describe("If the cron is enabled."),
|
|
6076
6126
|
consumer: FunctionSchema.describe("The consuming lambda function properties."),
|
|
6077
6127
|
schedule: ScheduleExpressionSchema.describe(
|
|
6078
6128
|
'The scheduling expression.\n\nexample: "0 20 * * ? *"\nexample: "5 minutes"'
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|