@awsless/awsless 0.0.568 → 0.0.570
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 +13 -36
- package/dist/build-json-schema.js +3 -2
- package/dist/prebuild/icon/HASH +1 -0
- package/dist/prebuild/icon/bundle.zip +0 -0
- package/dist/prebuild/image/HASH +1 -0
- package/dist/prebuild/image/bundle.zip +0 -0
- package/dist/prebuild/rpc/HASH +1 -0
- package/dist/prebuild/rpc/bundle.zip +0 -0
- package/dist/stack.json +1 -1
- package/package.json +9 -9
package/dist/bin.js
CHANGED
|
@@ -1078,7 +1078,7 @@ var QueueDefaultSchema = z19.object({
|
|
|
1078
1078
|
maxBatchingWindow: MaxBatchingWindow.optional()
|
|
1079
1079
|
}).default({});
|
|
1080
1080
|
var QueueSchema = z19.object({
|
|
1081
|
-
consumer: FunctionSchema.describe("The consuming lambda function properties.")
|
|
1081
|
+
consumer: FunctionSchema.describe("The consuming lambda function properties."),
|
|
1082
1082
|
retentionPeriod: RetentionPeriodSchema.optional(),
|
|
1083
1083
|
visibilityTimeout: VisibilityTimeoutSchema.optional(),
|
|
1084
1084
|
deliveryDelay: DeliveryDelaySchema.optional(),
|
|
@@ -1094,7 +1094,8 @@ var QueuesSchema = z19.record(
|
|
|
1094
1094
|
LocalFileSchema.transform((consumer) => ({
|
|
1095
1095
|
consumer
|
|
1096
1096
|
})).pipe(QueueSchema),
|
|
1097
|
-
QueueSchema
|
|
1097
|
+
QueueSchema,
|
|
1098
|
+
z19.literal(true)
|
|
1098
1099
|
])
|
|
1099
1100
|
).optional().describe("Define the queues in your stack.");
|
|
1100
1101
|
|
|
@@ -4164,7 +4165,7 @@ var queueFeature = defineFeature({
|
|
|
4164
4165
|
resourceType: "queue",
|
|
4165
4166
|
resourceName: name
|
|
4166
4167
|
});
|
|
4167
|
-
if (props
|
|
4168
|
+
if (typeof props === "object" && "file" in props.consumer.code) {
|
|
4168
4169
|
const relFile = relative4(directories.types, props.consumer.code.file);
|
|
4169
4170
|
gen.addImport(varName, relFile);
|
|
4170
4171
|
mock.addType(name, `MockBuilder<typeof ${varName}>`);
|
|
@@ -4184,7 +4185,7 @@ var queueFeature = defineFeature({
|
|
|
4184
4185
|
},
|
|
4185
4186
|
onStack(ctx) {
|
|
4186
4187
|
for (const [id, local] of Object.entries(ctx.stackConfig.queues || {})) {
|
|
4187
|
-
const props = deepmerge3(ctx.appConfig.defaults.queue, local);
|
|
4188
|
+
const props = deepmerge3(ctx.appConfig.defaults.queue, typeof local === "object" ? local : {});
|
|
4188
4189
|
const group = new Group10(ctx.stack, "queue", id);
|
|
4189
4190
|
const name = formatLocalResourceName({
|
|
4190
4191
|
appName: ctx.app.name,
|
|
@@ -4207,7 +4208,7 @@ var queueFeature = defineFeature({
|
|
|
4207
4208
|
})
|
|
4208
4209
|
)
|
|
4209
4210
|
});
|
|
4210
|
-
if (local
|
|
4211
|
+
if (typeof local === "object") {
|
|
4211
4212
|
const lambdaConsumer = createLambdaFunction(group, ctx, `queue`, id, local.consumer);
|
|
4212
4213
|
lambdaConsumer.setEnvironment("LOG_VIEWABLE_ERROR", "1");
|
|
4213
4214
|
new $10.aws.lambda.EventSourceMapping(
|
|
@@ -4227,7 +4228,12 @@ var queueFeature = defineFeature({
|
|
|
4227
4228
|
}
|
|
4228
4229
|
);
|
|
4229
4230
|
lambdaConsumer.addPermission({
|
|
4230
|
-
actions: [
|
|
4231
|
+
actions: [
|
|
4232
|
+
//
|
|
4233
|
+
"sqs:ReceiveMessage",
|
|
4234
|
+
"sqs:DeleteMessage",
|
|
4235
|
+
"sqs:GetQueueAttributes"
|
|
4236
|
+
],
|
|
4231
4237
|
resources: [queue2.arn]
|
|
4232
4238
|
});
|
|
4233
4239
|
}
|
|
@@ -4237,6 +4243,7 @@ var queueFeature = defineFeature({
|
|
|
4237
4243
|
"sqs:SendMessage",
|
|
4238
4244
|
"sqs:ReceiveMessage",
|
|
4239
4245
|
"sqs:DeleteMessage",
|
|
4246
|
+
"sqs:ChangeMessageVisibility",
|
|
4240
4247
|
"sqs:GetQueueUrl",
|
|
4241
4248
|
"sqs:GetQueueAttributes"
|
|
4242
4249
|
],
|
|
@@ -7196,15 +7203,6 @@ var createFargateTask = (parentGroup, ctx, ns, id, local) => {
|
|
|
7196
7203
|
revokeRulesOnDelete: true,
|
|
7197
7204
|
tags
|
|
7198
7205
|
});
|
|
7199
|
-
new $25.aws.vpc.SecurityGroupIngressRule(group, "ingress-rule-http", {
|
|
7200
|
-
securityGroupId: securityGroup.id,
|
|
7201
|
-
description: `Allow HTTP traffic on port 80 to the ${name} instance`,
|
|
7202
|
-
fromPort: 80,
|
|
7203
|
-
toPort: 80,
|
|
7204
|
-
ipProtocol: "tcp",
|
|
7205
|
-
cidrIpv4: "0.0.0.0/0",
|
|
7206
|
-
tags
|
|
7207
|
-
});
|
|
7208
7206
|
new $25.aws.vpc.SecurityGroupEgressRule(group, "egress-rule", {
|
|
7209
7207
|
securityGroupId: securityGroup.id,
|
|
7210
7208
|
description: `Allow all outbound traffic from the ${name} instance`,
|
|
@@ -7254,20 +7252,6 @@ var createFargateTask = (parentGroup, ctx, ns, id, local) => {
|
|
|
7254
7252
|
// src/feature/instance/index.ts
|
|
7255
7253
|
var instanceFeature = defineFeature({
|
|
7256
7254
|
name: "instance",
|
|
7257
|
-
async onTypeGen(ctx) {
|
|
7258
|
-
const gen = new TypeFile("@awsless/awsless");
|
|
7259
|
-
const resources2 = new TypeObject(1);
|
|
7260
|
-
for (const stack of ctx.stackConfigs) {
|
|
7261
|
-
const list3 = new TypeObject(2);
|
|
7262
|
-
for (const name of Object.keys(stack.instances ?? {})) {
|
|
7263
|
-
const endpoint = `http://${shortId(`${stack.name}:${name}`)}.${ctx.appConfig.name}`;
|
|
7264
|
-
list3.addType(name, `'${endpoint}'`);
|
|
7265
|
-
}
|
|
7266
|
-
resources2.addType(stack.name, list3);
|
|
7267
|
-
}
|
|
7268
|
-
gen.addInterface("InstanceResources", resources2);
|
|
7269
|
-
await ctx.write("instance.d.ts", gen, true);
|
|
7270
|
-
},
|
|
7271
7255
|
onBefore(ctx) {
|
|
7272
7256
|
const group = new Group26(ctx.base, "instance", "asset");
|
|
7273
7257
|
const bucket = new $26.aws.s3.Bucket(group, "bucket", {
|
|
@@ -7293,13 +7277,6 @@ var instanceFeature = defineFeature({
|
|
|
7293
7277
|
name: ctx.app.name
|
|
7294
7278
|
});
|
|
7295
7279
|
ctx.shared.set("instance", "cluster-arn", cluster.arn);
|
|
7296
|
-
const namespace = new $26.aws.service.DiscoveryPrivateDnsNamespace(group, "namespace", {
|
|
7297
|
-
name: ctx.app.name,
|
|
7298
|
-
vpc: ctx.shared.get("vpc", "id"),
|
|
7299
|
-
description: `Private DNS namespace for ${ctx.app.name}`
|
|
7300
|
-
});
|
|
7301
|
-
ctx.shared.set("instance", "namespace", namespace.name);
|
|
7302
|
-
ctx.shared.set("instance", "namespace-id", namespace.id);
|
|
7303
7280
|
},
|
|
7304
7281
|
onStack(ctx) {
|
|
7305
7282
|
for (const [id, props] of Object.entries(ctx.stackConfig.instances ?? {})) {
|
|
@@ -470,7 +470,7 @@ var QueueDefaultSchema = z16.object({
|
|
|
470
470
|
maxBatchingWindow: MaxBatchingWindow.optional()
|
|
471
471
|
}).default({});
|
|
472
472
|
var QueueSchema = z16.object({
|
|
473
|
-
consumer: FunctionSchema.describe("The consuming lambda function properties.")
|
|
473
|
+
consumer: FunctionSchema.describe("The consuming lambda function properties."),
|
|
474
474
|
retentionPeriod: RetentionPeriodSchema.optional(),
|
|
475
475
|
visibilityTimeout: VisibilityTimeoutSchema.optional(),
|
|
476
476
|
deliveryDelay: DeliveryDelaySchema.optional(),
|
|
@@ -486,7 +486,8 @@ var QueuesSchema = z16.record(
|
|
|
486
486
|
LocalFileSchema.transform((consumer) => ({
|
|
487
487
|
consumer
|
|
488
488
|
})).pipe(QueueSchema),
|
|
489
|
-
QueueSchema
|
|
489
|
+
QueueSchema,
|
|
490
|
+
z16.literal(true)
|
|
490
491
|
])
|
|
491
492
|
).optional().describe("Define the queues in your stack.");
|
|
492
493
|
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
1552a14ad540cc49008ca8b937646894fbbbfc90
|
|
Binary file
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
755eb8fdc436c93b2385d01b2141cdc3f5ada376
|
|
Binary file
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
67cc66902e9b4f4a3b10b94784c0f0f88f247ce1
|
|
Binary file
|