@awsless/awsless 0.0.569 → 0.0.571
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 +16 -36
- package/dist/build-json-schema.js +3 -2
- package/dist/prebuild/icon/bundle.zip +0 -0
- package/dist/prebuild/image/bundle.zip +0 -0
- package/dist/prebuild/rpc/bundle.zip +0 -0
- package/dist/stack.json +1 -1
- package/package.json +11 -11
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,12 +4165,15 @@ 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}>`);
|
|
4171
4172
|
resource.addType(name, `Send<'${queueName}', typeof ${varName}>`);
|
|
4172
4173
|
mockResponse.addType(name, `MockObject<typeof ${varName}>`);
|
|
4174
|
+
} else {
|
|
4175
|
+
mock.addType(name, `MockBuilder<typeof ${varName}>`);
|
|
4176
|
+
resource.addType(name, `Send<'${queueName}', typeof ${varName}>`);
|
|
4173
4177
|
}
|
|
4174
4178
|
}
|
|
4175
4179
|
mocks.addType(stack.name, mock);
|
|
@@ -4184,7 +4188,7 @@ var queueFeature = defineFeature({
|
|
|
4184
4188
|
},
|
|
4185
4189
|
onStack(ctx) {
|
|
4186
4190
|
for (const [id, local] of Object.entries(ctx.stackConfig.queues || {})) {
|
|
4187
|
-
const props = deepmerge3(ctx.appConfig.defaults.queue, local);
|
|
4191
|
+
const props = deepmerge3(ctx.appConfig.defaults.queue, typeof local === "object" ? local : {});
|
|
4188
4192
|
const group = new Group10(ctx.stack, "queue", id);
|
|
4189
4193
|
const name = formatLocalResourceName({
|
|
4190
4194
|
appName: ctx.app.name,
|
|
@@ -4207,7 +4211,7 @@ var queueFeature = defineFeature({
|
|
|
4207
4211
|
})
|
|
4208
4212
|
)
|
|
4209
4213
|
});
|
|
4210
|
-
if (local
|
|
4214
|
+
if (typeof local === "object") {
|
|
4211
4215
|
const lambdaConsumer = createLambdaFunction(group, ctx, `queue`, id, local.consumer);
|
|
4212
4216
|
lambdaConsumer.setEnvironment("LOG_VIEWABLE_ERROR", "1");
|
|
4213
4217
|
new $10.aws.lambda.EventSourceMapping(
|
|
@@ -4227,7 +4231,12 @@ var queueFeature = defineFeature({
|
|
|
4227
4231
|
}
|
|
4228
4232
|
);
|
|
4229
4233
|
lambdaConsumer.addPermission({
|
|
4230
|
-
actions: [
|
|
4234
|
+
actions: [
|
|
4235
|
+
//
|
|
4236
|
+
"sqs:ReceiveMessage",
|
|
4237
|
+
"sqs:DeleteMessage",
|
|
4238
|
+
"sqs:GetQueueAttributes"
|
|
4239
|
+
],
|
|
4231
4240
|
resources: [queue2.arn]
|
|
4232
4241
|
});
|
|
4233
4242
|
}
|
|
@@ -4237,6 +4246,7 @@ var queueFeature = defineFeature({
|
|
|
4237
4246
|
"sqs:SendMessage",
|
|
4238
4247
|
"sqs:ReceiveMessage",
|
|
4239
4248
|
"sqs:DeleteMessage",
|
|
4249
|
+
"sqs:ChangeMessageVisibility",
|
|
4240
4250
|
"sqs:GetQueueUrl",
|
|
4241
4251
|
"sqs:GetQueueAttributes"
|
|
4242
4252
|
],
|
|
@@ -7196,15 +7206,6 @@ var createFargateTask = (parentGroup, ctx, ns, id, local) => {
|
|
|
7196
7206
|
revokeRulesOnDelete: true,
|
|
7197
7207
|
tags
|
|
7198
7208
|
});
|
|
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
7209
|
new $25.aws.vpc.SecurityGroupEgressRule(group, "egress-rule", {
|
|
7209
7210
|
securityGroupId: securityGroup.id,
|
|
7210
7211
|
description: `Allow all outbound traffic from the ${name} instance`,
|
|
@@ -7254,20 +7255,6 @@ var createFargateTask = (parentGroup, ctx, ns, id, local) => {
|
|
|
7254
7255
|
// src/feature/instance/index.ts
|
|
7255
7256
|
var instanceFeature = defineFeature({
|
|
7256
7257
|
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
7258
|
onBefore(ctx) {
|
|
7272
7259
|
const group = new Group26(ctx.base, "instance", "asset");
|
|
7273
7260
|
const bucket = new $26.aws.s3.Bucket(group, "bucket", {
|
|
@@ -7293,13 +7280,6 @@ var instanceFeature = defineFeature({
|
|
|
7293
7280
|
name: ctx.app.name
|
|
7294
7281
|
});
|
|
7295
7282
|
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
7283
|
},
|
|
7304
7284
|
onStack(ctx) {
|
|
7305
7285
|
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
|
|
|
Binary file
|
|
Binary file
|
|
Binary file
|