@awsless/awsless 0.0.659 → 0.0.661
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/app.stage.json +1 -1
- package/dist/bin.js +132 -134
- package/dist/build-json-schema.js +131 -133
- package/dist/prebuild/icon/bundle.zip +0 -0
- package/dist/prebuild/image/bundle.zip +0 -0
- package/dist/prebuild/on-error-log/bundle.zip +0 -0
- package/dist/prebuild/on-failure/bundle.zip +0 -0
- package/dist/prebuild/rpc/bundle.zip +0 -0
- package/package.json +12 -12
package/dist/bin.js
CHANGED
|
@@ -1304,24 +1304,41 @@ var LayerSchema = z17.record(
|
|
|
1304
1304
|
])
|
|
1305
1305
|
).optional().describe("Define the lambda layers in your stack.");
|
|
1306
1306
|
|
|
1307
|
+
// src/feature/task/schema.ts
|
|
1308
|
+
import { z as z18 } from "zod";
|
|
1309
|
+
var RetryAttemptsSchema = z18.number().int().min(0).max(2).describe(
|
|
1310
|
+
"The maximum number of times to retry when the function returns an error. You can specify a number from 0 to 2."
|
|
1311
|
+
);
|
|
1312
|
+
var TaskSchema = z18.union([
|
|
1313
|
+
FunctionSchema.transform((consumer) => ({
|
|
1314
|
+
consumer,
|
|
1315
|
+
retryAttempts: 2
|
|
1316
|
+
})),
|
|
1317
|
+
z18.object({
|
|
1318
|
+
consumer: FunctionSchema,
|
|
1319
|
+
retryAttempts: RetryAttemptsSchema.default(2)
|
|
1320
|
+
})
|
|
1321
|
+
]);
|
|
1322
|
+
var TasksSchema = z18.record(ResourceIdSchema, TaskSchema).optional().describe("Define the tasks in your stack.");
|
|
1323
|
+
|
|
1307
1324
|
// src/feature/on-error-log/schema.ts
|
|
1308
|
-
var OnErrorLogDefaultSchema =
|
|
1325
|
+
var OnErrorLogDefaultSchema = TaskSchema.optional().describe(
|
|
1309
1326
|
"Define a subscription on all Lambda functions logs."
|
|
1310
1327
|
);
|
|
1311
1328
|
|
|
1312
1329
|
// src/feature/on-failure/schema.ts
|
|
1313
|
-
import { z as
|
|
1314
|
-
var NotifySchema =
|
|
1330
|
+
import { z as z19 } from "zod";
|
|
1331
|
+
var NotifySchema = z19.union([
|
|
1315
1332
|
//
|
|
1316
1333
|
EmailSchema.transform((v) => [v]),
|
|
1317
1334
|
EmailSchema.array()
|
|
1318
1335
|
]).describe("Receive an email notification when consuming failure entries goes wrong.");
|
|
1319
|
-
var OnFailureDefaultSchema =
|
|
1336
|
+
var OnFailureDefaultSchema = z19.union([
|
|
1320
1337
|
FunctionSchema.transform((consumer) => ({
|
|
1321
1338
|
consumer,
|
|
1322
1339
|
notify: []
|
|
1323
1340
|
})),
|
|
1324
|
-
|
|
1341
|
+
z19.object({
|
|
1325
1342
|
consumer: FunctionSchema,
|
|
1326
1343
|
notify: NotifySchema.optional()
|
|
1327
1344
|
})
|
|
@@ -1338,14 +1355,14 @@ var OnFailureDefaultSchema = z18.union([
|
|
|
1338
1355
|
);
|
|
1339
1356
|
|
|
1340
1357
|
// src/feature/pubsub/schema.ts
|
|
1341
|
-
import { z as
|
|
1358
|
+
import { z as z20 } from "zod";
|
|
1342
1359
|
var DomainSchema = ResourceIdSchema.describe("The domain id to link your Pubsub API with.");
|
|
1343
|
-
var PubSubDefaultSchema =
|
|
1360
|
+
var PubSubDefaultSchema = z20.record(
|
|
1344
1361
|
ResourceIdSchema,
|
|
1345
|
-
|
|
1362
|
+
z20.object({
|
|
1346
1363
|
auth: FunctionSchema,
|
|
1347
1364
|
domain: DomainSchema.optional(),
|
|
1348
|
-
subDomain:
|
|
1365
|
+
subDomain: z20.string().optional()
|
|
1349
1366
|
// auth: z.union([
|
|
1350
1367
|
// ResourceIdSchema,
|
|
1351
1368
|
// z.object({
|
|
@@ -1361,23 +1378,23 @@ var PubSubDefaultSchema = z19.record(
|
|
|
1361
1378
|
// .optional(),
|
|
1362
1379
|
})
|
|
1363
1380
|
).optional().describe("Define the pubsub subscriber in your stack.");
|
|
1364
|
-
var
|
|
1381
|
+
var RetryAttemptsSchema2 = z20.number().int().min(0).max(2).describe(
|
|
1365
1382
|
"The maximum number of times to retry when the function returns an error. You can specify a number from 0 to 2."
|
|
1366
1383
|
);
|
|
1367
|
-
var PubSubSchema =
|
|
1384
|
+
var PubSubSchema = z20.record(
|
|
1368
1385
|
ResourceIdSchema,
|
|
1369
|
-
|
|
1370
|
-
sql:
|
|
1371
|
-
sqlVersion:
|
|
1386
|
+
z20.object({
|
|
1387
|
+
sql: z20.string().describe("The SQL statement used to query the IOT topic."),
|
|
1388
|
+
sqlVersion: z20.enum(["2015-10-08", "2016-03-23", "beta"]).default("2016-03-23").describe("The version of the SQL rules engine to use when evaluating the rule."),
|
|
1372
1389
|
consumer: FunctionSchema.describe("The consuming lambda function properties."),
|
|
1373
|
-
retryAttempts:
|
|
1390
|
+
retryAttempts: RetryAttemptsSchema2.default(2)
|
|
1374
1391
|
})
|
|
1375
1392
|
).optional().describe("Define the pubsub subscriber in your stack.");
|
|
1376
1393
|
|
|
1377
1394
|
// src/feature/queue/schema.ts
|
|
1378
1395
|
import { days as days2, hours, minutes as minutes2, seconds as seconds2 } from "@awsless/duration";
|
|
1379
1396
|
import { kibibytes } from "@awsless/size";
|
|
1380
|
-
import { z as
|
|
1397
|
+
import { z as z21 } from "zod";
|
|
1381
1398
|
var RetentionPeriodSchema = DurationSchema.refine(
|
|
1382
1399
|
durationMin(minutes2(1)),
|
|
1383
1400
|
"Minimum retention period is 1 minute"
|
|
@@ -1405,10 +1422,10 @@ var ReceiveMessageWaitTimeSchema = DurationSchema.refine(
|
|
|
1405
1422
|
var MaxMessageSizeSchema = SizeSchema.refine(sizeMin(kibibytes(1)), "Minimum max message size is 1 KB").refine(sizeMax(kibibytes(256)), "Maximum max message size is 256 KB").describe(
|
|
1406
1423
|
"The limit of how many bytes that a message can contain before Amazon SQS rejects it. You can specify an size from 1 KB to 256 KB."
|
|
1407
1424
|
);
|
|
1408
|
-
var BatchSizeSchema =
|
|
1425
|
+
var BatchSizeSchema = z21.number().int().min(1, "Minimum batch size is 1").max(1e4, "Maximum batch size is 10000").describe(
|
|
1409
1426
|
"The maximum number of records in each batch that Lambda pulls from your queue and sends to your function. Lambda passes all of the records in the batch to the function in a single call, up to the payload limit for synchronous invocation (6 MB). You can specify an integer from 1 to 10000."
|
|
1410
1427
|
);
|
|
1411
|
-
var MaxConcurrencySchema =
|
|
1428
|
+
var MaxConcurrencySchema = z21.number().int().min(2, "Minimum max concurrency is 2").max(1e3, "Maximum max concurrency is 1000").describe(
|
|
1412
1429
|
"Limits the number of concurrent instances that the queue worker can invoke. You can specify an integer from 2 to 1000."
|
|
1413
1430
|
);
|
|
1414
1431
|
var MaxBatchingWindow = DurationSchema.refine(
|
|
@@ -1417,10 +1434,10 @@ var MaxBatchingWindow = DurationSchema.refine(
|
|
|
1417
1434
|
).describe(
|
|
1418
1435
|
"The maximum amount of time, that Lambda spends gathering records before invoking the function. You can specify an duration from 0 seconds to 5 minutes."
|
|
1419
1436
|
);
|
|
1420
|
-
var
|
|
1437
|
+
var RetryAttemptsSchema3 = z21.number().int().min(0).max(999).describe(
|
|
1421
1438
|
"The maximum number of times to retry when the function returns an error. You can specify a number from 0 to 999."
|
|
1422
1439
|
);
|
|
1423
|
-
var QueueDefaultSchema =
|
|
1440
|
+
var QueueDefaultSchema = z21.object({
|
|
1424
1441
|
retentionPeriod: RetentionPeriodSchema.default("7 days"),
|
|
1425
1442
|
visibilityTimeout: VisibilityTimeoutSchema.default("30 seconds"),
|
|
1426
1443
|
deliveryDelay: DeliveryDelaySchema.default("0 seconds"),
|
|
@@ -1429,9 +1446,9 @@ var QueueDefaultSchema = z20.object({
|
|
|
1429
1446
|
batchSize: BatchSizeSchema.default(10),
|
|
1430
1447
|
maxConcurrency: MaxConcurrencySchema.optional(),
|
|
1431
1448
|
maxBatchingWindow: MaxBatchingWindow.optional(),
|
|
1432
|
-
retryAttempts:
|
|
1449
|
+
retryAttempts: RetryAttemptsSchema3.default(2)
|
|
1433
1450
|
}).default({});
|
|
1434
|
-
var QueueSchema =
|
|
1451
|
+
var QueueSchema = z21.object({
|
|
1435
1452
|
consumer: FunctionSchema.optional().describe("The consuming lambda function properties."),
|
|
1436
1453
|
retentionPeriod: RetentionPeriodSchema.optional(),
|
|
1437
1454
|
visibilityTimeout: VisibilityTimeoutSchema.optional(),
|
|
@@ -1441,11 +1458,11 @@ var QueueSchema = z20.object({
|
|
|
1441
1458
|
batchSize: BatchSizeSchema.optional(),
|
|
1442
1459
|
maxConcurrency: MaxConcurrencySchema.optional(),
|
|
1443
1460
|
maxBatchingWindow: MaxBatchingWindow.optional(),
|
|
1444
|
-
retryAttempts:
|
|
1461
|
+
retryAttempts: RetryAttemptsSchema3.optional()
|
|
1445
1462
|
});
|
|
1446
|
-
var QueuesSchema =
|
|
1463
|
+
var QueuesSchema = z21.record(
|
|
1447
1464
|
ResourceIdSchema,
|
|
1448
|
-
|
|
1465
|
+
z21.union([
|
|
1449
1466
|
LocalFileSchema.transform((consumer) => ({
|
|
1450
1467
|
consumer
|
|
1451
1468
|
})).pipe(QueueSchema),
|
|
@@ -1454,26 +1471,26 @@ var QueuesSchema = z20.record(
|
|
|
1454
1471
|
).optional().describe("Define the queues in your stack.");
|
|
1455
1472
|
|
|
1456
1473
|
// src/feature/rest/schema.ts
|
|
1457
|
-
import { z as
|
|
1474
|
+
import { z as z23 } from "zod";
|
|
1458
1475
|
|
|
1459
1476
|
// src/config/schema/route.ts
|
|
1460
|
-
import { z as
|
|
1461
|
-
var RouteSchema =
|
|
1462
|
-
|
|
1463
|
-
|
|
1477
|
+
import { z as z22 } from "zod";
|
|
1478
|
+
var RouteSchema = z22.union([
|
|
1479
|
+
z22.string().regex(/^(POST|GET|PUT|DELETE|HEAD|OPTIONS|ANY)(\s\/[a-z0-9\+\_\-\/\{\}]*)$/gi, "Invalid route"),
|
|
1480
|
+
z22.literal("$default")
|
|
1464
1481
|
]);
|
|
1465
1482
|
|
|
1466
1483
|
// src/feature/rest/schema.ts
|
|
1467
|
-
var RestDefaultSchema =
|
|
1484
|
+
var RestDefaultSchema = z23.record(
|
|
1468
1485
|
ResourceIdSchema,
|
|
1469
|
-
|
|
1486
|
+
z23.object({
|
|
1470
1487
|
domain: ResourceIdSchema.describe("The domain id to link your API with.").optional(),
|
|
1471
|
-
subDomain:
|
|
1488
|
+
subDomain: z23.string().optional()
|
|
1472
1489
|
})
|
|
1473
1490
|
).optional().describe("Define your global REST API's.");
|
|
1474
|
-
var RestSchema =
|
|
1491
|
+
var RestSchema = z23.record(
|
|
1475
1492
|
ResourceIdSchema,
|
|
1476
|
-
|
|
1493
|
+
z23.record(
|
|
1477
1494
|
RouteSchema.describe(
|
|
1478
1495
|
[
|
|
1479
1496
|
"The REST API route that is comprised by the http method and http path.",
|
|
@@ -1487,19 +1504,19 @@ var RestSchema = z22.record(
|
|
|
1487
1504
|
|
|
1488
1505
|
// src/feature/rpc/schema.ts
|
|
1489
1506
|
import { minutes as minutes4, seconds as seconds3 } from "@awsless/duration";
|
|
1490
|
-
import { z as
|
|
1507
|
+
import { z as z25 } from "zod";
|
|
1491
1508
|
|
|
1492
1509
|
// src/feature/router/schema.ts
|
|
1493
1510
|
import { days as days3, minutes as minutes3, parse as parse3 } from "@awsless/duration";
|
|
1494
|
-
import { z as
|
|
1495
|
-
var ErrorResponsePathSchema =
|
|
1511
|
+
import { z as z24 } from "zod";
|
|
1512
|
+
var ErrorResponsePathSchema = z24.string().describe(
|
|
1496
1513
|
[
|
|
1497
1514
|
"The path to the custom error page that you want to return to the viewer when your origin returns the HTTP status code specified.",
|
|
1498
1515
|
"- We recommend that you store custom error pages in an Amazon S3 bucket.",
|
|
1499
1516
|
"If you store custom error pages on an HTTP server and the server starts to return 5xx errors, CloudFront can't get the files that you want to return to viewers because the origin server is unavailable."
|
|
1500
1517
|
].join("\n")
|
|
1501
1518
|
);
|
|
1502
|
-
var StatusCodeSchema =
|
|
1519
|
+
var StatusCodeSchema = z24.number().int().positive().optional().describe(
|
|
1503
1520
|
[
|
|
1504
1521
|
"The HTTP status code that you want CloudFront to return to the viewer along with the custom error page.",
|
|
1505
1522
|
"There are a variety of reasons that you might want CloudFront to return a status code different from the status code that your origin returned to CloudFront, for example:",
|
|
@@ -1512,26 +1529,26 @@ var StatusCodeSchema = z23.number().int().positive().optional().describe(
|
|
|
1512
1529
|
var MinTTLSchema = DurationSchema.describe(
|
|
1513
1530
|
"The minimum amount of time, that you want to cache the error response. When this time period has elapsed, CloudFront queries your origin to see whether the problem that caused the error has been resolved and the requested object is now available."
|
|
1514
1531
|
);
|
|
1515
|
-
var ErrorResponseSchema =
|
|
1532
|
+
var ErrorResponseSchema = z24.union([
|
|
1516
1533
|
ErrorResponsePathSchema,
|
|
1517
|
-
|
|
1534
|
+
z24.object({
|
|
1518
1535
|
path: ErrorResponsePathSchema,
|
|
1519
1536
|
statusCode: StatusCodeSchema.optional(),
|
|
1520
1537
|
minTTL: MinTTLSchema.optional()
|
|
1521
1538
|
})
|
|
1522
1539
|
]).optional();
|
|
1523
|
-
var RouteSchema2 =
|
|
1524
|
-
var VisibilitySchema =
|
|
1525
|
-
var WafSettingsSchema =
|
|
1526
|
-
rateLimiter:
|
|
1527
|
-
limit:
|
|
1540
|
+
var RouteSchema2 = z24.string().regex(/^\//, "Route must start with a slash (/)");
|
|
1541
|
+
var VisibilitySchema = z24.boolean().default(false).describe("Whether to enable CloudWatch metrics for the WAF rule.");
|
|
1542
|
+
var WafSettingsSchema = z24.object({
|
|
1543
|
+
rateLimiter: z24.object({
|
|
1544
|
+
limit: z24.number().min(10).max(2e9).default(10).describe(
|
|
1528
1545
|
"The limit on requests during the specified evaluation window for a single aggregation instance for the rate-based rule."
|
|
1529
1546
|
),
|
|
1530
|
-
window:
|
|
1531
|
-
|
|
1532
|
-
|
|
1533
|
-
|
|
1534
|
-
|
|
1547
|
+
window: z24.union([
|
|
1548
|
+
z24.literal("1 minute"),
|
|
1549
|
+
z24.literal("2 minutes"),
|
|
1550
|
+
z24.literal("5 minutes"),
|
|
1551
|
+
z24.literal("10 minutes")
|
|
1535
1552
|
]).default("5 minutes").transform((v) => parse3(v)).describe(
|
|
1536
1553
|
"The amount of time, in seconds, that AWS WAF should include in its request counts, looking back from the current time."
|
|
1537
1554
|
),
|
|
@@ -1539,18 +1556,18 @@ var WafSettingsSchema = z23.object({
|
|
|
1539
1556
|
}).optional().describe(
|
|
1540
1557
|
"A rate-based rule counts incoming requests and rate limits requests when they are coming at too fast a rate."
|
|
1541
1558
|
),
|
|
1542
|
-
ddosProtection:
|
|
1543
|
-
sensitivity:
|
|
1544
|
-
challenge:
|
|
1545
|
-
block:
|
|
1559
|
+
ddosProtection: z24.object({
|
|
1560
|
+
sensitivity: z24.object({
|
|
1561
|
+
challenge: z24.enum(["low", "medium", "high"]).default("low").transform((v) => v.toUpperCase()).describe("The sensitivity level for challenge requests."),
|
|
1562
|
+
block: z24.enum(["low", "medium", "high"]).default("low").transform((v) => v.toUpperCase()).describe("The sensitivity level for block requests.")
|
|
1546
1563
|
}),
|
|
1547
|
-
exemptUriRegex:
|
|
1564
|
+
exemptUriRegex: z24.string().default("^$"),
|
|
1548
1565
|
visibility: VisibilitySchema
|
|
1549
1566
|
}).optional().describe(
|
|
1550
1567
|
"Provides protection against DDoS attacks targeting the application layer, also known as Layer 7 attacks. Uses 50 WCU."
|
|
1551
1568
|
),
|
|
1552
|
-
botProtection:
|
|
1553
|
-
inspectionLevel:
|
|
1569
|
+
botProtection: z24.object({
|
|
1570
|
+
inspectionLevel: z24.enum(["common", "targeted"]).default("common").transform((v) => v.toUpperCase()),
|
|
1554
1571
|
visibility: VisibilitySchema
|
|
1555
1572
|
}).optional().describe(
|
|
1556
1573
|
"Provides protection against automated bots that can consume excess resources, skew business metrics, cause downtime, or perform malicious activities. Bot Control provides additional visibility through Amazon CloudWatch and generates labels that you can use to control bot traffic to your applications. Uses 50 WCU."
|
|
@@ -1564,14 +1581,14 @@ var WafSettingsSchema = z23.object({
|
|
|
1564
1581
|
}).describe(
|
|
1565
1582
|
"WAF settings for the router. Each rule consumes Web ACL capacity units (WCUs). The total WCUs for a web ACL can't exceed 5000. Using over 1500 WCUs affects your costs."
|
|
1566
1583
|
);
|
|
1567
|
-
var RouterDefaultSchema =
|
|
1584
|
+
var RouterDefaultSchema = z24.record(
|
|
1568
1585
|
ResourceIdSchema,
|
|
1569
|
-
|
|
1586
|
+
z24.object({
|
|
1570
1587
|
domain: ResourceIdSchema.describe("The domain id to link your Router.").optional(),
|
|
1571
|
-
subDomain:
|
|
1588
|
+
subDomain: z24.string().optional(),
|
|
1572
1589
|
waf: WafSettingsSchema.optional(),
|
|
1573
|
-
geoRestrictions:
|
|
1574
|
-
errors:
|
|
1590
|
+
geoRestrictions: z24.array(z24.string().length(2).toUpperCase()).default([]).describe("Specifies a blacklist of countries that should be blocked."),
|
|
1591
|
+
errors: z24.object({
|
|
1575
1592
|
400: ErrorResponseSchema.describe("Customize a `400 Bad Request` response."),
|
|
1576
1593
|
403: ErrorResponseSchema.describe("Customize a `403 Forbidden` response."),
|
|
1577
1594
|
404: ErrorResponseSchema.describe("Customize a `404 Not Found` response."),
|
|
@@ -1584,21 +1601,21 @@ var RouterDefaultSchema = z23.record(
|
|
|
1584
1601
|
503: ErrorResponseSchema.describe("Customize a `503 Service Unavailable` response."),
|
|
1585
1602
|
504: ErrorResponseSchema.describe("Customize a `504 Gateway Timeout` response.")
|
|
1586
1603
|
}).optional().describe("Customize the error responses for specific HTTP status codes."),
|
|
1587
|
-
cors:
|
|
1588
|
-
override:
|
|
1604
|
+
cors: z24.object({
|
|
1605
|
+
override: z24.boolean().default(false),
|
|
1589
1606
|
maxAge: DurationSchema.default("365 days"),
|
|
1590
|
-
exposeHeaders:
|
|
1591
|
-
credentials:
|
|
1592
|
-
headers:
|
|
1593
|
-
origins:
|
|
1594
|
-
methods:
|
|
1607
|
+
exposeHeaders: z24.string().array().optional(),
|
|
1608
|
+
credentials: z24.boolean().default(false),
|
|
1609
|
+
headers: z24.string().array().default(["*"]),
|
|
1610
|
+
origins: z24.string().array().default(["*"]),
|
|
1611
|
+
methods: z24.enum(["GET", "DELETE", "HEAD", "OPTIONS", "PATCH", "POST", "PUT", "ALL"]).array().default(["ALL"])
|
|
1595
1612
|
}).optional().describe("Specify the cors headers."),
|
|
1596
|
-
passwordAuth:
|
|
1597
|
-
password:
|
|
1613
|
+
passwordAuth: z24.object({
|
|
1614
|
+
password: z24.string().describe("Password.")
|
|
1598
1615
|
}).optional().describe("Enable password authentication for the router."),
|
|
1599
|
-
basicAuth:
|
|
1600
|
-
username:
|
|
1601
|
-
password:
|
|
1616
|
+
basicAuth: z24.object({
|
|
1617
|
+
username: z24.string().describe("Basic auth username."),
|
|
1618
|
+
password: z24.string().describe("Basic auth password.")
|
|
1602
1619
|
}).optional().describe("Enable basic authentication for the router."),
|
|
1603
1620
|
// security: z
|
|
1604
1621
|
// .object({
|
|
@@ -1645,10 +1662,10 @@ var RouterDefaultSchema = z23.record(
|
|
|
1645
1662
|
// })
|
|
1646
1663
|
// .optional()
|
|
1647
1664
|
// .describe('Specify the security policy.'),
|
|
1648
|
-
cache:
|
|
1649
|
-
cookies:
|
|
1650
|
-
headers:
|
|
1651
|
-
queries:
|
|
1665
|
+
cache: z24.object({
|
|
1666
|
+
cookies: z24.string().array().optional().describe("Specifies the cookies that CloudFront includes in the cache key."),
|
|
1667
|
+
headers: z24.string().array().optional().describe("Specifies the headers that CloudFront includes in the cache key."),
|
|
1668
|
+
queries: z24.string().array().optional().describe("Specifies the query values that CloudFront includes in the cache key.")
|
|
1652
1669
|
}).optional().describe(
|
|
1653
1670
|
"Specifies the cookies, headers, and query values that CloudFront includes in the cache key."
|
|
1654
1671
|
)
|
|
@@ -1663,9 +1680,9 @@ var TimeoutSchema2 = DurationSchema.refine(durationMin(seconds3(10)), "Minimum t
|
|
|
1663
1680
|
"The timeouts of all inner RPC functions will be capped at 80% of this timeout."
|
|
1664
1681
|
].join(" ")
|
|
1665
1682
|
);
|
|
1666
|
-
var RpcDefaultSchema =
|
|
1683
|
+
var RpcDefaultSchema = z25.record(
|
|
1667
1684
|
ResourceIdSchema,
|
|
1668
|
-
|
|
1685
|
+
z25.object({
|
|
1669
1686
|
// domain: ResourceIdSchema.describe('The domain id to link your RPC API with.').optional(),
|
|
1670
1687
|
// subDomain: z.string().optional(),
|
|
1671
1688
|
//
|
|
@@ -1676,18 +1693,18 @@ var RpcDefaultSchema = z24.record(
|
|
|
1676
1693
|
timeout: TimeoutSchema2.default("1 minutes")
|
|
1677
1694
|
})
|
|
1678
1695
|
).describe(`Define the global RPC API's.`).optional();
|
|
1679
|
-
var RpcSchema =
|
|
1696
|
+
var RpcSchema = z25.record(
|
|
1680
1697
|
ResourceIdSchema,
|
|
1681
|
-
|
|
1682
|
-
|
|
1683
|
-
|
|
1698
|
+
z25.record(
|
|
1699
|
+
z25.string(),
|
|
1700
|
+
z25.union([
|
|
1684
1701
|
FunctionSchema.transform((f) => ({
|
|
1685
1702
|
function: f,
|
|
1686
1703
|
lock: false
|
|
1687
1704
|
})),
|
|
1688
|
-
|
|
1705
|
+
z25.object({
|
|
1689
1706
|
function: FunctionSchema.describe("The RPC function to execute."),
|
|
1690
|
-
lock:
|
|
1707
|
+
lock: z25.boolean().describe(
|
|
1691
1708
|
[
|
|
1692
1709
|
"Specify if the function should be locked on the `lockKey` returned from the auth function.",
|
|
1693
1710
|
"An example would be returning the user ID as `lockKey`."
|
|
@@ -1701,8 +1718,8 @@ var RpcSchema = z24.record(
|
|
|
1701
1718
|
// src/feature/instance/schema.ts
|
|
1702
1719
|
import { days as days4, toDays as toDays2 } from "@awsless/duration";
|
|
1703
1720
|
import { toMebibytes } from "@awsless/size";
|
|
1704
|
-
import { z as
|
|
1705
|
-
var CpuSchema =
|
|
1721
|
+
import { z as z26 } from "zod";
|
|
1722
|
+
var CpuSchema = z26.union([z26.literal(0.25), z26.literal(0.5), z26.literal(1), z26.literal(2), z26.literal(4), z26.literal(8), z26.literal(16)]).transform((v) => `${v} vCPU`).describe(
|
|
1706
1723
|
"The number of virtual CPU units (vCPU) used by the instance. Valid values: 0.25, 0.5, 1, 2, 4, 8, 16 vCPU."
|
|
1707
1724
|
);
|
|
1708
1725
|
var validMemorySize = [
|
|
@@ -1742,10 +1759,10 @@ var MemorySizeSchema2 = SizeSchema.refine(
|
|
|
1742
1759
|
(s) => validMemorySize.includes(toMebibytes(s)),
|
|
1743
1760
|
`Invalid memory size. Allowed sizes: ${validMemorySize.join(", ")} MiB`
|
|
1744
1761
|
).describe("The amount of memory (in MiB) used by the instance. Valid memory values depend on the CPU configuration.");
|
|
1745
|
-
var HealthCheckSchema =
|
|
1746
|
-
path:
|
|
1762
|
+
var HealthCheckSchema = z26.object({
|
|
1763
|
+
path: z26.string().describe("The path that the container runs to determine if it is healthy."),
|
|
1747
1764
|
interval: DurationSchema.describe("The time period in seconds between each health check execution."),
|
|
1748
|
-
retries:
|
|
1765
|
+
retries: z26.number().int().min(1).max(10).describe(
|
|
1749
1766
|
"The number of times to retry a failed health check before the container is considered unhealthy."
|
|
1750
1767
|
),
|
|
1751
1768
|
startPeriod: DurationSchema.describe(
|
|
@@ -1755,22 +1772,22 @@ var HealthCheckSchema = z25.object({
|
|
|
1755
1772
|
"The time period in seconds to wait for a health check to succeed before it is considered a failure."
|
|
1756
1773
|
)
|
|
1757
1774
|
}).describe("The health check command and associated configuration parameters for the container.");
|
|
1758
|
-
var EnvironmentSchema2 =
|
|
1759
|
-
var ArchitectureSchema3 =
|
|
1760
|
-
var ActionSchema2 =
|
|
1761
|
-
var ActionsSchema2 =
|
|
1762
|
-
var ArnSchema2 =
|
|
1763
|
-
var WildcardSchema2 =
|
|
1764
|
-
var ResourceSchema2 =
|
|
1765
|
-
var ResourcesSchema2 =
|
|
1766
|
-
var PermissionSchema2 =
|
|
1767
|
-
effect:
|
|
1775
|
+
var EnvironmentSchema2 = z26.record(z26.string(), z26.string()).optional().describe("Environment variable key-value pairs.");
|
|
1776
|
+
var ArchitectureSchema3 = z26.enum(["x86_64", "arm64"]).describe("The instruction set architecture that the instance supports.");
|
|
1777
|
+
var ActionSchema2 = z26.string();
|
|
1778
|
+
var ActionsSchema2 = z26.union([ActionSchema2.transform((v) => [v]), ActionSchema2.array()]);
|
|
1779
|
+
var ArnSchema2 = z26.string().startsWith("arn:");
|
|
1780
|
+
var WildcardSchema2 = z26.literal("*");
|
|
1781
|
+
var ResourceSchema2 = z26.union([ArnSchema2, WildcardSchema2]);
|
|
1782
|
+
var ResourcesSchema2 = z26.union([ResourceSchema2.transform((v) => [v]), ResourceSchema2.array()]);
|
|
1783
|
+
var PermissionSchema2 = z26.object({
|
|
1784
|
+
effect: z26.enum(["allow", "deny"]).default("allow"),
|
|
1768
1785
|
actions: ActionsSchema2,
|
|
1769
1786
|
resources: ResourcesSchema2
|
|
1770
1787
|
});
|
|
1771
|
-
var PermissionsSchema2 =
|
|
1772
|
-
var DescriptionSchema2 =
|
|
1773
|
-
var ImageSchema =
|
|
1788
|
+
var PermissionsSchema2 = z26.union([PermissionSchema2.transform((v) => [v]), PermissionSchema2.array()]).describe("Add IAM permissions to your instance.");
|
|
1789
|
+
var DescriptionSchema2 = z26.string().describe("A description of the instance.");
|
|
1790
|
+
var ImageSchema = z26.string().optional().describe("The URL of the container image to use.");
|
|
1774
1791
|
var validLogRetentionDays2 = [
|
|
1775
1792
|
...[1, 3, 5, 7, 14, 30, 60, 90, 120, 150],
|
|
1776
1793
|
...[180, 365, 400, 545, 731, 1096, 1827, 2192],
|
|
@@ -1785,23 +1802,23 @@ var LogRetentionSchema2 = DurationSchema.refine(
|
|
|
1785
1802
|
},
|
|
1786
1803
|
`Invalid log retention. Valid days are: ${validLogRetentionDays2.map((days9) => `${days9}`).join(", ")}`
|
|
1787
1804
|
).describe("The log retention duration.");
|
|
1788
|
-
var LogSchema2 =
|
|
1789
|
-
|
|
1805
|
+
var LogSchema2 = z26.union([
|
|
1806
|
+
z26.boolean().transform((enabled) => ({ retention: enabled ? days4(7) : days4(0) })),
|
|
1790
1807
|
LogRetentionSchema2.transform((retention) => ({ retention })),
|
|
1791
|
-
|
|
1808
|
+
z26.object({
|
|
1792
1809
|
retention: LogRetentionSchema2.optional()
|
|
1793
1810
|
})
|
|
1794
1811
|
]).describe("Enable logging to a CloudWatch log group. Providing a duration value will set the log retention time.");
|
|
1795
|
-
var FileCodeSchema2 =
|
|
1812
|
+
var FileCodeSchema2 = z26.object({
|
|
1796
1813
|
file: LocalFileSchema.describe("The file path of the instance code.")
|
|
1797
1814
|
});
|
|
1798
|
-
var CodeSchema2 =
|
|
1815
|
+
var CodeSchema2 = z26.union([
|
|
1799
1816
|
LocalFileSchema.transform((file) => ({
|
|
1800
1817
|
file
|
|
1801
1818
|
})).pipe(FileCodeSchema2),
|
|
1802
1819
|
FileCodeSchema2
|
|
1803
1820
|
]).describe("Specify the code of your instance.");
|
|
1804
|
-
var ISchema =
|
|
1821
|
+
var ISchema = z26.object({
|
|
1805
1822
|
code: CodeSchema2,
|
|
1806
1823
|
description: DescriptionSchema2.optional(),
|
|
1807
1824
|
image: ImageSchema.optional(),
|
|
@@ -1814,14 +1831,14 @@ var ISchema = z25.object({
|
|
|
1814
1831
|
healthCheck: HealthCheckSchema.optional()
|
|
1815
1832
|
// restartPolicy: RestartPolicySchema.optional(),
|
|
1816
1833
|
});
|
|
1817
|
-
var InstanceSchema =
|
|
1834
|
+
var InstanceSchema = z26.union([
|
|
1818
1835
|
LocalFileSchema.transform((code) => ({
|
|
1819
1836
|
code
|
|
1820
1837
|
})).pipe(ISchema),
|
|
1821
1838
|
ISchema
|
|
1822
1839
|
]);
|
|
1823
|
-
var InstancesSchema =
|
|
1824
|
-
var InstanceDefaultSchema =
|
|
1840
|
+
var InstancesSchema = z26.record(ResourceIdSchema, InstanceSchema).optional().describe("Define the instances in your stack.");
|
|
1841
|
+
var InstanceDefaultSchema = z26.object({
|
|
1825
1842
|
image: ImageSchema.optional(),
|
|
1826
1843
|
cpu: CpuSchema.default(0.25),
|
|
1827
1844
|
memorySize: MemorySizeSchema2.default("512 MB"),
|
|
@@ -1838,25 +1855,6 @@ var InstanceDefaultSchema = z25.object({
|
|
|
1838
1855
|
// src/feature/topic/schema.ts
|
|
1839
1856
|
import { kebabCase as kebabCase3 } from "change-case";
|
|
1840
1857
|
import { z as z27 } from "zod";
|
|
1841
|
-
|
|
1842
|
-
// src/feature/task/schema.ts
|
|
1843
|
-
import { z as z26 } from "zod";
|
|
1844
|
-
var RetryAttemptsSchema3 = z26.number().int().min(0).max(2).describe(
|
|
1845
|
-
"The maximum number of times to retry when the function returns an error. You can specify a number from 0 to 2."
|
|
1846
|
-
);
|
|
1847
|
-
var TaskSchema = z26.union([
|
|
1848
|
-
FunctionSchema.transform((consumer) => ({
|
|
1849
|
-
consumer,
|
|
1850
|
-
retryAttempts: 2
|
|
1851
|
-
})),
|
|
1852
|
-
z26.object({
|
|
1853
|
-
consumer: FunctionSchema,
|
|
1854
|
-
retryAttempts: RetryAttemptsSchema3.default(2)
|
|
1855
|
-
})
|
|
1856
|
-
]);
|
|
1857
|
-
var TasksSchema = z26.record(ResourceIdSchema, TaskSchema).optional().describe("Define the tasks in your stack.");
|
|
1858
|
-
|
|
1859
|
-
// src/feature/topic/schema.ts
|
|
1860
1858
|
var TopicNameSchema = z27.string().min(3).max(256).regex(/^[a-z0-9\-]+$/i, "Invalid topic name").transform((value) => kebabCase3(value)).describe("Define event topic name.");
|
|
1861
1859
|
var TopicsDefaultSchema = z27.array(TopicNameSchema).refine((topics) => {
|
|
1862
1860
|
return topics.length === new Set(topics).size;
|
|
@@ -4681,7 +4679,6 @@ var onErrorLogFeature = defineFeature({
|
|
|
4681
4679
|
}
|
|
4682
4680
|
}
|
|
4683
4681
|
});
|
|
4684
|
-
ctx.shared.set("on-error-log", "subscriber-arn", prebuild.lambda.arn);
|
|
4685
4682
|
new aws9.lambda.Permission(group, "permission", {
|
|
4686
4683
|
action: "lambda:InvokeFunction",
|
|
4687
4684
|
principal: "logs.amazonaws.com",
|
|
@@ -4698,6 +4695,7 @@ var onErrorLogFeature = defineFeature({
|
|
|
4698
4695
|
);
|
|
4699
4696
|
prebuild.setEnvironment("CONSUMER", consumer.name);
|
|
4700
4697
|
}
|
|
4698
|
+
ctx.shared.set("on-error-log", "subscriber-arn", prebuild.lambda.arn);
|
|
4701
4699
|
}
|
|
4702
4700
|
});
|
|
4703
4701
|
|