stacktape 3.5.8 → 3.6.0

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.
Files changed (123) hide show
  1. package/.tsconfig.bun-build.json +1 -0
  2. package/ai-docs/cli-ref/aws-profile-create.md +22 -0
  3. package/ai-docs/cli-ref/aws-profile-delete.md +22 -0
  4. package/ai-docs/cli-ref/aws-profile-list.md +20 -0
  5. package/ai-docs/cli-ref/aws-profile-update.md +22 -0
  6. package/ai-docs/cli-ref/bastion-session.md +29 -0
  7. package/ai-docs/cli-ref/bastion-tunnel.md +30 -0
  8. package/ai-docs/cli-ref/bucket-sync.md +30 -0
  9. package/ai-docs/cli-ref/cf-module-update.md +26 -0
  10. package/ai-docs/cli-ref/cf-rollback.md +28 -0
  11. package/ai-docs/cli-ref/codebuild-deploy.md +34 -0
  12. package/ai-docs/cli-ref/compile-template.md +25 -0
  13. package/ai-docs/cli-ref/container-session.md +30 -0
  14. package/ai-docs/cli-ref/debug-alarms.md +28 -0
  15. package/ai-docs/cli-ref/debug-aws-sdk.md +33 -0
  16. package/ai-docs/cli-ref/debug-container-exec.md +36 -0
  17. package/ai-docs/cli-ref/debug-dynamodb.md +35 -0
  18. package/ai-docs/cli-ref/debug-logs.md +34 -0
  19. package/ai-docs/cli-ref/debug-metrics.md +33 -0
  20. package/ai-docs/cli-ref/debug-opensearch.md +35 -0
  21. package/ai-docs/cli-ref/debug-redis.md +36 -0
  22. package/ai-docs/cli-ref/debug-sql.md +35 -0
  23. package/ai-docs/cli-ref/defaults-configure.md +29 -0
  24. package/ai-docs/cli-ref/defaults-list.md +20 -0
  25. package/ai-docs/cli-ref/delete.md +24 -0
  26. package/ai-docs/cli-ref/deploy.md +25 -0
  27. package/ai-docs/cli-ref/deployment-script-run.md +28 -0
  28. package/ai-docs/cli-ref/dev-stop.md +26 -0
  29. package/ai-docs/cli-ref/dev.md +45 -0
  30. package/ai-docs/cli-ref/domain-add.md +26 -0
  31. package/ai-docs/cli-ref/help.md +18 -0
  32. package/ai-docs/cli-ref/info-operations.md +22 -0
  33. package/ai-docs/cli-ref/info-stack.md +30 -0
  34. package/ai-docs/cli-ref/info-stacks.md +26 -0
  35. package/ai-docs/cli-ref/info-whoami.md +22 -0
  36. package/ai-docs/cli-ref/init.md +30 -0
  37. package/ai-docs/cli-ref/login.md +20 -0
  38. package/ai-docs/cli-ref/logout.md +18 -0
  39. package/ai-docs/cli-ref/mcp-add.md +22 -0
  40. package/ai-docs/cli-ref/mcp.md +20 -0
  41. package/ai-docs/cli-ref/org-create.md +24 -0
  42. package/ai-docs/cli-ref/org-delete.md +24 -0
  43. package/ai-docs/cli-ref/org-list.md +22 -0
  44. package/ai-docs/cli-ref/package-workloads.md +25 -0
  45. package/ai-docs/cli-ref/param-get.md +26 -0
  46. package/ai-docs/cli-ref/preview-changes.md +23 -0
  47. package/ai-docs/cli-ref/project-create.md +22 -0
  48. package/ai-docs/cli-ref/projects-list.md +22 -0
  49. package/ai-docs/cli-ref/rollback.md +28 -0
  50. package/ai-docs/cli-ref/script-run.md +29 -0
  51. package/ai-docs/cli-ref/secret-create.md +28 -0
  52. package/ai-docs/cli-ref/secret-delete.md +26 -0
  53. package/ai-docs/cli-ref/secret-get.md +26 -0
  54. package/ai-docs/cli-ref/upgrade.md +20 -0
  55. package/ai-docs/cli-ref/version.md +18 -0
  56. package/ai-docs/concept/connecting-resources.md +369 -0
  57. package/ai-docs/concept/directives.md +371 -0
  58. package/ai-docs/concept/extending-cloudformation.md +315 -0
  59. package/ai-docs/concept/overrides-and-transforms.md +352 -0
  60. package/ai-docs/concept/stages-and-environments.md +347 -0
  61. package/ai-docs/concept/typescript-config.md +447 -0
  62. package/ai-docs/concept/yaml-config.md +338 -0
  63. package/ai-docs/config-ref/_root.md +131 -0
  64. package/ai-docs/config-ref/application-load-balancer.md +1109 -0
  65. package/ai-docs/config-ref/astro-web.md +115 -0
  66. package/ai-docs/config-ref/aws-cdk-construct.md +68 -0
  67. package/ai-docs/config-ref/bastion.md +93 -0
  68. package/ai-docs/config-ref/batch-job.md +179 -0
  69. package/ai-docs/config-ref/bucket.md +348 -0
  70. package/ai-docs/config-ref/cdn.md +496 -0
  71. package/ai-docs/config-ref/custom-resource.md +80 -0
  72. package/ai-docs/config-ref/deployment-script.md +79 -0
  73. package/ai-docs/config-ref/dynamo-db-table.md +202 -0
  74. package/ai-docs/config-ref/edge-lambda-function.md +87 -0
  75. package/ai-docs/config-ref/efs-filesystem.md +72 -0
  76. package/ai-docs/config-ref/event-bus.md +63 -0
  77. package/ai-docs/config-ref/function.md +409 -0
  78. package/ai-docs/config-ref/hosting-bucket.md +171 -0
  79. package/ai-docs/config-ref/http-api-gateway.md +149 -0
  80. package/ai-docs/config-ref/http-endpoint.md +92 -0
  81. package/ai-docs/config-ref/kinesis-stream.md +97 -0
  82. package/ai-docs/config-ref/mongo-db-atlas-cluster.md +254 -0
  83. package/ai-docs/config-ref/multi-container-workload.md +399 -0
  84. package/ai-docs/config-ref/network-load-balancer.md +118 -0
  85. package/ai-docs/config-ref/nextjs-web.md +147 -0
  86. package/ai-docs/config-ref/nuxt-web.md +81 -0
  87. package/ai-docs/config-ref/open-search.md +206 -0
  88. package/ai-docs/config-ref/private-service.md +75 -0
  89. package/ai-docs/config-ref/redis-cluster.md +223 -0
  90. package/ai-docs/config-ref/relational-database.md +525 -0
  91. package/ai-docs/config-ref/remix-web.md +74 -0
  92. package/ai-docs/config-ref/sns-topic.md +69 -0
  93. package/ai-docs/config-ref/solidstart-web.md +75 -0
  94. package/ai-docs/config-ref/sqs-queue-not-empty.md +414 -0
  95. package/ai-docs/config-ref/sqs-queue.md +232 -0
  96. package/ai-docs/config-ref/state-machine.md +235 -0
  97. package/ai-docs/config-ref/sveltekit-web.md +81 -0
  98. package/ai-docs/config-ref/tanstack-web.md +75 -0
  99. package/ai-docs/config-ref/upstash-redis.md +59 -0
  100. package/ai-docs/config-ref/user-auth-pool.md +876 -0
  101. package/ai-docs/config-ref/web-app-firewall.md +212 -0
  102. package/ai-docs/config-ref/web-service.md +178 -0
  103. package/ai-docs/config-ref/worker-service.md +41 -0
  104. package/ai-docs/getting-started/console.md +232 -0
  105. package/ai-docs/getting-started/deployment.md +434 -0
  106. package/ai-docs/getting-started/dev-mode.md +118 -0
  107. package/ai-docs/getting-started/how-it-works.md +119 -0
  108. package/ai-docs/getting-started/intro.md +157 -0
  109. package/ai-docs/getting-started/using-with-ai.md +228 -0
  110. package/ai-docs/getting-started/workflow.md +197 -0
  111. package/ai-docs/index.json +1514 -0
  112. package/ai-docs/recipe/background-jobs.md +183 -0
  113. package/ai-docs/recipe/database-migrations.md +240 -0
  114. package/ai-docs/recipe/graphql-api.md +211 -0
  115. package/ai-docs/recipe/monorepo-setup.md +183 -0
  116. package/ai-docs/recipe/nextjs-full-stack.md +188 -0
  117. package/ai-docs/recipe/rest-api-with-database.md +156 -0
  118. package/ai-docs/recipe/scheduled-tasks.md +186 -0
  119. package/ai-docs/recipe/static-website.md +241 -0
  120. package/ai-docs/troubleshooting/cloudformation-stack-states.md +189 -0
  121. package/bin/stacktape.js +0 -12
  122. package/package.json +1 -1
  123. package/plain.d.ts +372 -111
@@ -0,0 +1,1109 @@
1
+ ---
2
+ docType: config-ref
3
+ title: Container Workload Load Balancer Integration
4
+ resourceType: application-load-balancer
5
+ tags:
6
+ - application-load-balancer
7
+ - alb
8
+ - load-balancer
9
+ source: types/stacktape-config/events.d.ts
10
+ priority: 1
11
+ ---
12
+
13
+ # Container Workload Load Balancer Integration
14
+
15
+ Triggers a container when a request matches the specified conditions on an Application Load Balancer.
16
+
17
+ You can route requests based on HTTP method, path, headers, query parameters, and source IP address.
18
+
19
+ Resource type: `application-load-balancer`
20
+
21
+ ## TypeScript Definition
22
+
23
+ ```typescript
24
+ /**
25
+ * #### Triggers a container when a request matches the specified conditions on an Application Load Balancer.
26
+ *
27
+ * ---
28
+ *
29
+ * You can route requests based on HTTP method, path, headers, query parameters, and source IP address.
30
+ */
31
+ interface ContainerWorkloadLoadBalancerIntegration {
32
+ type: 'application-load-balancer';
33
+ properties: ContainerWorkloadLoadBalancerIntegrationProps;
34
+ }
35
+
36
+ interface ContainerWorkloadLoadBalancerIntegrationProps extends ApplicationLoadBalancerIntegrationProps {
37
+ /**
38
+ * #### The container port that will receive traffic from the load balancer.
39
+ */
40
+ containerPort: number;
41
+ }
42
+
43
+ /**
44
+ * #### Triggers a function when an Application Load Balancer receives a matching HTTP request.
45
+ *
46
+ * ---
47
+ *
48
+ * You can route requests based on HTTP method, path, headers, query parameters, and source IP address.
49
+ */
50
+ interface ApplicationLoadBalancerIntegration {
51
+ /**
52
+ * #### Triggers a function when an Application Load Balancer receives a matching HTTP request.
53
+ *
54
+ * ---
55
+ *
56
+ * You can route requests based on HTTP method, path, headers, query parameters, and source IP address.
57
+ */
58
+ type: 'application-load-balancer';
59
+ properties: ApplicationLoadBalancerIntegrationProps;
60
+ }
61
+
62
+ interface ApplicationLoadBalancerIntegrationProps {
63
+ /**
64
+ * #### The name of the Application Load Balancer.
65
+ *
66
+ * ---
67
+ *
68
+ * This must reference a load balancer defined in your Stacktape configuration.
69
+ */
70
+ loadBalancerName: string;
71
+ /**
72
+ * #### The port of the load balancer listener to attach to.
73
+ *
74
+ * ---
75
+ *
76
+ * You only need to specify this if the load balancer uses custom listeners.
77
+ */
78
+ listenerPort?: number;
79
+ /**
80
+ * #### The priority of this integration rule.
81
+ *
82
+ * ---
83
+ *
84
+ * Load balancer rules are evaluated in order from the lowest priority to the highest.
85
+ * The first rule that matches an incoming request will handle it.
86
+ */
87
+ priority: number;
88
+ /**
89
+ * #### A list of URL paths that will trigger this integration.
90
+ *
91
+ * ---
92
+ *
93
+ * The request will be routed if its path matches any of the paths in this list.
94
+ * The comparison is case-sensitive and supports `*` and `?` wildcards.
95
+ *
96
+ * Example: `/users`, `/articles/*`
97
+ */
98
+ paths?: string[];
99
+ /**
100
+ * #### A list of HTTP methods that will trigger this integration.
101
+ *
102
+ * ---
103
+ *
104
+ * Example: `GET`, `POST`, `DELETE`
105
+ */
106
+ methods?: string[];
107
+ /**
108
+ * #### A list of hostnames that will trigger this integration.
109
+ *
110
+ * ---
111
+ *
112
+ * The hostname is parsed from the `Host` header of the request.
113
+ * Wildcards (`*` and `?`) are supported.
114
+ *
115
+ * Example: `api.example.com`, `*.myapp.com`
116
+ */
117
+ hosts?: string[];
118
+ /**
119
+ * #### A list of header conditions that the request must match.
120
+ *
121
+ * ---
122
+ *
123
+ * All header conditions must be met for the request to be routed.
124
+ */
125
+ headers?: LbHeaderCondition[];
126
+ /**
127
+ * #### A list of query parameter conditions that the request must match.
128
+ *
129
+ * ---
130
+ *
131
+ * All query parameter conditions must be met for the request to be routed.
132
+ */
133
+ queryParams?: LbQueryParamCondition[];
134
+ /**
135
+ * #### A list of source IP addresses (in CIDR format) that are allowed to trigger this integration.
136
+ *
137
+ * ---
138
+ *
139
+ * > **Note:** If the client is behind a proxy, this will be the IP address of the proxy.
140
+ */
141
+ sourceIps?: string[];
142
+ }
143
+
144
+ interface LbHeaderCondition {
145
+ /**
146
+ * #### The name of the HTTP header.
147
+ */
148
+ headerName: string;
149
+ /**
150
+ * #### A list of allowed values for the header.
151
+ *
152
+ * ---
153
+ *
154
+ * The condition is met if the header's value in the incoming request matches any of the values in this list. The comparison is case-insensitive.
155
+ */
156
+ values: string[];
157
+ }
158
+ interface LbQueryParamCondition {
159
+ /**
160
+ * #### The name of the query parameter.
161
+ */
162
+ paramName: string;
163
+ /**
164
+ * #### A list of allowed values for the query parameter.
165
+ *
166
+ * ---
167
+ *
168
+ * The condition is met if the query parameter's value in the incoming request matches any of the values in this list. The comparison is case-insensitive.
169
+ */
170
+ values: string[];
171
+ }
172
+ interface ContainerWorkloadHttpApiIntegrationProps extends HttpApiIntegrationProps {
173
+ /**
174
+ * #### The container port that will receive traffic from the API Gateway.
175
+ */
176
+ containerPort: number;
177
+ }
178
+
179
+ /**
180
+ * #### Triggers a container when an HTTP API Gateway receives a matching request.
181
+ *
182
+ * ---
183
+ *
184
+ * You can route requests based on HTTP method and path.
185
+ */
186
+ interface ContainerWorkloadHttpApiIntegration {
187
+ type: 'http-api-gateway';
188
+ properties: ContainerWorkloadHttpApiIntegrationProps;
189
+ }
190
+
191
+ /**
192
+ * #### Opens a container port for connections from other containers within the same workload.
193
+ */
194
+ interface ContainerWorkloadInternalIntegration {
195
+ type: 'workload-internal';
196
+ properties: ContainerWorkloadInternalIntegrationProps;
197
+ }
198
+
199
+ interface ContainerWorkloadInternalIntegrationProps {
200
+ /**
201
+ * #### The container port to open for internal traffic.
202
+ */
203
+ containerPort: number;
204
+ }
205
+
206
+ /**
207
+ * #### Opens a container port for connections from other compute resources in the same stack.
208
+ */
209
+ interface ContainerWorkloadServiceConnectIntegration {
210
+ type: 'service-connect';
211
+ properties: ContainerWorkloadServiceConnectIntegrationProps;
212
+ }
213
+
214
+ interface ContainerWorkloadServiceConnectIntegrationProps {
215
+ /**
216
+ * #### The container port to open for service-to-service communication.
217
+ */
218
+ containerPort: number;
219
+ /**
220
+ * #### An alias for this service, used for service discovery.
221
+ *
222
+ * ---
223
+ *
224
+ * Other resources in the stack can connect to this service using a URL like `protocol://alias:port` (e.g., `http://my-service:8080`).
225
+ * By default, the alias is derived from the resource and container names (e.g., `my-resource-my-container`).
226
+ */
227
+ alias?: string;
228
+ /**
229
+ * #### The protocol used for service-to-service communication.
230
+ *
231
+ * ---
232
+ *
233
+ * Specifying the protocol allows AWS to capture protocol-specific metrics, such as the number of HTTP 5xx errors.
234
+ */
235
+ protocol?: 'http' | 'http2' | 'grpc';
236
+ }
237
+
238
+ /**
239
+ * #### Triggers a function when new messages are available in a Kafka topic.
240
+ */
241
+ interface KafkaTopicIntegration {
242
+ type: 'kafka-topic';
243
+ properties: KafkaTopicIntegrationProps;
244
+ }
245
+
246
+ interface KafkaTopicIntegrationProps {
247
+ /**
248
+ * #### The details of your Kafka cluster.
249
+ *
250
+ * ---
251
+ *
252
+ * Specifies the bootstrap servers and topic name.
253
+ */
254
+ customKafkaConfiguration?: CustomKafkaEventSource;
255
+ /**
256
+ * #### The maximum number of records to process in a single batch.
257
+ *
258
+ * ---
259
+ *
260
+ * The function will be invoked with up to this many records. Maximum is 10,000.
261
+ *
262
+ * @default 100
263
+ */
264
+ batchSize?: number;
265
+ /**
266
+ * #### The maximum time (in seconds) to wait before invoking the function with a batch of records.
267
+ *
268
+ * ---
269
+ *
270
+ * The function will be triggered when either the `batchSize` is reached or this time window expires.
271
+ * Maximum is 300 seconds.
272
+ *
273
+ * @default 0.5
274
+ */
275
+ maxBatchWindowSeconds?: number;
276
+ }
277
+
278
+ interface CustomKafkaEventSource {
279
+ /**
280
+ * #### A list of `host:port` addresses for your Kafka brokers.
281
+ */
282
+ bootstrapServers: string[];
283
+ /**
284
+ * #### The name of the Kafka topic to consume messages from.
285
+ */
286
+ topicName: string;
287
+ /**
288
+ * #### The authentication method for connecting to the Kafka cluster.
289
+ *
290
+ * ---
291
+ *
292
+ * - `SASL`: Authenticate using a username and password (PLAIN or SCRAM).
293
+ * - `MTLS`: Authenticate using a client-side TLS certificate.
294
+ */
295
+ authentication: KafkaSASLAuth | KafkaMTLSAuth;
296
+ }
297
+
298
+ interface KafkaSASLAuth {
299
+ /**
300
+ * #### The SASL authentication protocol.
301
+ *
302
+ * ---
303
+ *
304
+ * - `BASIC_AUTH`: SASL/PLAIN
305
+ * - `SASL_SCRAM_256_AUTH`: SASL SCRAM-256
306
+ * - `SASL_SCRAM_512_AUTH`: SASL SCRAM-512
307
+ */
308
+ type: 'BASIC_AUTH' | 'SASL_SCRAM_256_AUTH' | 'SASL_SCRAM_512_AUTH';
309
+ /**
310
+ * #### Properties of authentication method
311
+ */
312
+ properties: KafkaSASLAuthProps;
313
+ }
314
+
315
+ interface KafkaSASLAuthProps {
316
+ /**
317
+ * #### The ARN of a secret containing the Kafka credentials.
318
+ *
319
+ * ---
320
+ *
321
+ * The secret must be a JSON object with `username` and `password` keys.
322
+ * You can create secrets using the `stacktape secret:create` command.
323
+ */
324
+ authenticationSecretArn: string;
325
+ }
326
+
327
+ interface KafkaMTLSAuth {
328
+ /**
329
+ * #### The authentication protocol.
330
+ *
331
+ * ---
332
+ *
333
+ * `MTLS`: Mutual TLS authentication.
334
+ */
335
+ type: 'MTLS';
336
+ /**
337
+ * #### Properties of authentication method
338
+ */
339
+ properties: KafkaMTLSAuthProps;
340
+ }
341
+ interface KafkaMTLSAuthProps {
342
+ /**
343
+ * #### The ARN of a secret containing the client certificate.
344
+ *
345
+ * ---
346
+ *
347
+ * This secret should contain the certificate chain (X.509 PEM), private key (PKCS#8 PEM), and an optional private key password.
348
+ * You can create secrets using the `stacktape secret:create` command.
349
+ */
350
+ clientCertificate: string;
351
+ /**
352
+ * #### The ARN of a secret containing the server's root CA certificate.
353
+ *
354
+ * ---
355
+ *
356
+ * You can create secrets using the `stacktape secret:create` command.
357
+ */
358
+ serverRootCaCertificate?: string;
359
+ }
360
+
361
+ /**
362
+ * #### Triggers a function when a new message is published to an SNS topic.
363
+ *
364
+ * ---
365
+ *
366
+ * SNS is a pub/sub messaging service. Reference a topic from your stack's `snsTopics` or use an external ARN.
367
+ */
368
+ interface SnsIntegration {
369
+ type: 'sns';
370
+ properties: SnsIntegrationProps;
371
+ }
372
+
373
+ interface SnsIntegrationProps {
374
+ /**
375
+ * #### The name of an SNS topic defined in your stack's resources.
376
+ *
377
+ * ---
378
+ *
379
+ * You must specify either `snsTopicName` or `snsTopicArn`.
380
+ */
381
+ snsTopicName?: string;
382
+ /**
383
+ * #### The ARN of an existing SNS topic.
384
+ *
385
+ * ---
386
+ *
387
+ * Use this to subscribe to a topic that is not managed by your stack.
388
+ * You must specify either `snsTopicName` or `snsTopicArn`.
389
+ */
390
+ snsTopicArn?: string;
391
+ /**
392
+ * #### Filter messages by attributes so only relevant ones trigger the function.
393
+ *
394
+ * ---
395
+ *
396
+ * Uses SNS subscription filter policy syntax. For content-based filtering, use EventBridge instead.
397
+ */
398
+ filterPolicy?: any;
399
+ /**
400
+ * #### A destination for messages that fail to be delivered to the target.
401
+ *
402
+ * ---
403
+ *
404
+ * In rare cases (e.g., if the target function cannot scale fast enough), a message might fail to be delivered.
405
+ * This property specifies an SQS queue where failed messages will be sent.
406
+ */
407
+ onDeliveryFailure?: SnsOnDeliveryFailure;
408
+ }
409
+
410
+ interface SnsOnDeliveryFailure {
411
+ /**
412
+ * #### The ARN of the SQS queue for failed messages.
413
+ */
414
+ sqsQueueArn?: string;
415
+ /**
416
+ * #### The name of an SQS queue (defined in your Stacktape configuration) for failed messages.
417
+ */
418
+ sqsQueueName?: string;
419
+ }
420
+
421
+ /**
422
+ * #### Triggers a function when new messages are available in an SQS queue.
423
+ *
424
+ * ---
425
+ *
426
+ * Messages are processed in batches. The function fires when `batchSize` is reached,
427
+ * `maxBatchWindowSeconds` expires, or the 6 MB payload limit is hit.
428
+ *
429
+ * **Important:** A single SQS queue should only have one consumer function. For fan-out (multiple
430
+ * consumers for the same message), use an SNS topic or EventBridge event bus instead.
431
+ */
432
+ interface SqsIntegration {
433
+ type: 'sqs';
434
+ properties: SqsIntegrationProps;
435
+ }
436
+
437
+ interface SqsIntegrationProps {
438
+ /**
439
+ * #### The name of an SQS queue defined in your stack's resources.
440
+ *
441
+ * ---
442
+ *
443
+ * You must specify either `sqsQueueName` or `sqsQueueArn`.
444
+ */
445
+ sqsQueueName?: string;
446
+ /**
447
+ * #### The ARN of an existing SQS queue.
448
+ *
449
+ * ---
450
+ *
451
+ * Use this to consume messages from a queue that is not managed by your stack.
452
+ * You must specify either `sqsQueueName` or `sqsQueueArn`.
453
+ */
454
+ sqsQueueArn?: string;
455
+ /**
456
+ * #### The maximum number of records to process in a single batch.
457
+ *
458
+ * ---
459
+ *
460
+ * Maximum is 10,000.
461
+ *
462
+ * @default 10
463
+ */
464
+ batchSize?: number;
465
+ /**
466
+ * #### The maximum time (in seconds) to wait before invoking the function with a batch of records.
467
+ *
468
+ * ---
469
+ *
470
+ * Maximum is 300 seconds. If not set, the function is invoked as soon as messages are available.
471
+ */
472
+ maxBatchWindowSeconds?: number;
473
+ }
474
+
475
+ /**
476
+ * #### Triggers a function when new records are available in a Kinesis Data Stream.
477
+ *
478
+ * ---
479
+ *
480
+ * Records are processed in batches. Two consumption modes:
481
+ * - **Direct**: Polls each shard ~1/sec, throughput shared with other consumers.
482
+ * - **Stream Consumer** (`autoCreateConsumer`): Dedicated connection per shard — higher throughput, lower latency.
483
+ */
484
+ interface KinesisIntegration {
485
+ type: 'kinesis-stream';
486
+ properties: KinesisIntegrationProps;
487
+ }
488
+
489
+ interface KinesisIntegrationProps {
490
+ /**
491
+ * #### The name of a Kinesis stream defined in your stack's resources.
492
+ *
493
+ * ---
494
+ *
495
+ * You must specify either `kinesisStreamName` or `streamArn`.
496
+ */
497
+ kinesisStreamName?: string;
498
+ /**
499
+ * #### The ARN of an existing Kinesis stream to consume records from.
500
+ *
501
+ * ---
502
+ *
503
+ * Use this to consume from a stream that is not managed by your stack.
504
+ * You must specify either `kinesisStreamName` or `streamArn`.
505
+ */
506
+ streamArn?: string;
507
+ /**
508
+ * #### The ARN of a specific stream consumer to use.
509
+ *
510
+ * ---
511
+ *
512
+ * This cannot be used with `autoCreateConsumer`.
513
+ */
514
+ consumerArn?: string;
515
+ /**
516
+ * #### Automatically creates a dedicated stream consumer for this integration.
517
+ *
518
+ * ---
519
+ *
520
+ * This is recommended for minimizing latency and maximizing throughput.
521
+ * For more details, see the [AWS documentation on stream consumers](https://docs.aws.amazon.com/streams/latest/dev/amazon-kinesis-consumers.html).
522
+ * This cannot be used with `consumerArn`.
523
+ */
524
+ autoCreateConsumer?: boolean;
525
+ /**
526
+ * #### The maximum time (in seconds) to wait before invoking the function with a batch of records.
527
+ *
528
+ * ---
529
+ *
530
+ * Maximum is 300 seconds.
531
+ */
532
+ maxBatchWindowSeconds?: number;
533
+ /**
534
+ * #### The maximum number of records to process in a single batch.
535
+ *
536
+ * ---
537
+ *
538
+ * Maximum is 10,000.
539
+ *
540
+ * @default 10
541
+ */
542
+ batchSize?: number;
543
+ /**
544
+ * #### The position in the stream from which to start reading records.
545
+ *
546
+ * ---
547
+ *
548
+ * - `LATEST`: Read only new records.
549
+ * - `TRIM_HORIZON`: Read all available records from the beginning of the stream.
550
+ *
551
+ * @default TRIM_HORIZON
552
+ */
553
+ startingPosition?: 'LATEST' | 'TRIM_HORIZON';
554
+ /**
555
+ * #### The number of times to retry a failed batch of records.
556
+ *
557
+ * ---
558
+ *
559
+ * > **Important:** If an error occurs, the entire batch is retried, including records that were processed successfully. Your function should be idempotent to handle this.
560
+ */
561
+ maximumRetryAttempts?: number;
562
+ /**
563
+ * #### A destination (SQS queue or SNS topic) for batches that fail after all retry attempts.
564
+ */
565
+ onFailure?: DestinationOnFailure;
566
+ /**
567
+ * #### The number of batches to process concurrently from the same shard.
568
+ */
569
+ parallelizationFactor?: number;
570
+ /**
571
+ * #### Splits a failed batch in two before retrying.
572
+ *
573
+ * ---
574
+ *
575
+ * This can be useful if a failure is caused by a batch being too large.
576
+ */
577
+ bisectBatchOnFunctionError?: boolean;
578
+ }
579
+
580
+ interface DestinationOnFailure {
581
+ /**
582
+ * #### The ARN of the SNS topic or SQS queue for failed batches.
583
+ */
584
+ arn: string;
585
+ /**
586
+ * #### The type of the destination.
587
+ */
588
+ type: 'sns' | 'sqs';
589
+ }
590
+
591
+ /**
592
+ * #### Triggers a function when items are created, updated, or deleted in a DynamoDB table.
593
+ *
594
+ * ---
595
+ *
596
+ * Records are processed in batches. You must enable streams on the DynamoDB table first
597
+ * (set `streaming` in your `dynamoDbTables` config).
598
+ */
599
+ interface DynamoDbIntegration {
600
+ type: 'dynamo-db-stream';
601
+ properties: DynamoDbIntegrationProps;
602
+ }
603
+
604
+ interface DynamoDbIntegrationProps {
605
+ /**
606
+ * #### The ARN of the DynamoDB table stream.
607
+ */
608
+ streamArn: string;
609
+ /**
610
+ * #### The maximum time (in seconds) to wait before invoking the function with a batch of records.
611
+ *
612
+ * ---
613
+ *
614
+ * Maximum is 300 seconds.
615
+ */
616
+ maxBatchWindowSeconds?: number; // maximum 300 seconds
617
+ /**
618
+ * #### The maximum number of records to process in a single batch.
619
+ *
620
+ * ---
621
+ *
622
+ * Maximum is 1,000.
623
+ *
624
+ * @default 100
625
+ */
626
+ batchSize?: number;
627
+ /**
628
+ * #### The position in the stream from which to start reading records.
629
+ *
630
+ * ---
631
+ *
632
+ * - `LATEST`: Read only new records.
633
+ * - `TRIM_HORIZON`: Read all available records from the beginning of the stream.
634
+ *
635
+ * @default TRIM_HORIZON
636
+ */
637
+ startingPosition?: string;
638
+ /**
639
+ * #### The number of times to retry a failed batch of records.
640
+ *
641
+ * ---
642
+ *
643
+ * > **Important:** If an error occurs, the entire batch is retried, including records that were processed successfully. Your function should be idempotent to handle this.
644
+ */
645
+ maximumRetryAttempts?: number;
646
+ /**
647
+ * #### A destination (SQS queue or SNS topic) for batches that fail after all retry attempts.
648
+ */
649
+ onFailure?: DestinationOnFailure;
650
+ /**
651
+ * #### The number of batches to process concurrently from the same shard.
652
+ */
653
+ parallelizationFactor?: number;
654
+ /**
655
+ * #### Splits a failed batch in two before retrying.
656
+ *
657
+ * ---
658
+ *
659
+ * This can be useful if a failure is caused by a batch being too large.
660
+ */
661
+ bisectBatchOnFunctionError?: boolean;
662
+ }
663
+ /**
664
+ * #### Triggers a function when files are created, deleted, or restored in an S3 bucket.
665
+ */
666
+ interface S3Integration {
667
+ type: 's3';
668
+ properties: S3IntegrationProps;
669
+ }
670
+
671
+ interface S3IntegrationProps {
672
+ /**
673
+ * #### The ARN of the S3 bucket to monitor for events.
674
+ */
675
+ bucketArn: string;
676
+ /**
677
+ * #### The type of S3 event that will trigger the function.
678
+ */
679
+ s3EventType:
680
+ | 's3:ReducedRedundancyLostObject'
681
+ | 's3:ObjectCreated:*'
682
+ | 's3:ObjectCreated:Put'
683
+ | 's3:ObjectCreated:Post'
684
+ | 's3:ObjectCreated:Copy'
685
+ | 's3:ObjectCreated:CompleteMultipartUpload'
686
+ | 's3:ObjectRemoved:*'
687
+ | 's3:ObjectRemoved:Delete'
688
+ | 's3:ObjectRemoved:DeleteMarkerCreated'
689
+ | 's3:ObjectRestore:*'
690
+ | 's3:ObjectRestore:Post'
691
+ | 's3:ObjectRestore:Completed'
692
+ | 's3:Replication:*'
693
+ | 's3:Replication:OperationFailedReplication'
694
+ | 's3:Replication:OperationNotTracked'
695
+ | 's3:Replication:OperationMissedThreshold'
696
+ | 's3:Replication:OperationReplicatedAfterThreshold';
697
+ /**
698
+ * #### A filter to apply to objects, so the function is only triggered for relevant objects.
699
+ */
700
+ filterRule?: S3FilterRule;
701
+ }
702
+
703
+ interface S3FilterRule {
704
+ /**
705
+ * #### The prefix that an object's key must have to trigger the function.
706
+ */
707
+ prefix?: string;
708
+ /**
709
+ * #### The suffix that an object's key must have to trigger the function.
710
+ */
711
+ suffix?: string;
712
+ }
713
+
714
+ /**
715
+ * #### Triggers a function on a recurring schedule (cron jobs, periodic tasks).
716
+ *
717
+ * ---
718
+ *
719
+ * Two formats:
720
+ * - **Rate**: `rate(5 minutes)`, `rate(1 hour)`, `rate(7 days)`
721
+ * - **Cron**: `cron(0 18 ? * MON-FRI *)` (6-field AWS cron, all times UTC)
722
+ */
723
+ interface ScheduleIntegration {
724
+ type: 'schedule';
725
+ properties: ScheduleIntegrationProps;
726
+ }
727
+
728
+ interface ScheduleIntegrationProps {
729
+ /**
730
+ * #### The schedule rate or cron expression.
731
+ *
732
+ * ---
733
+ *
734
+ * Examples: `rate(2 hours)`, `cron(0 10 * * ? *)`
735
+ */
736
+ scheduleRate: string;
737
+ /**
738
+ * #### A fixed JSON object to be passed as the event payload.
739
+ *
740
+ * ---
741
+ *
742
+ * If you need to customize the payload based on the event, use `inputTransformer` instead.
743
+ * You can only use one of `input`, `inputPath`, or `inputTransformer`.
744
+ *
745
+ * Example:
746
+ *
747
+ * ```yaml
748
+ * input:
749
+ * source: 'my-scheduled-event'
750
+ * ```
751
+ */
752
+ input?: any;
753
+ /**
754
+ * #### A JSONPath expression to extract a portion of the event to pass to the target.
755
+ *
756
+ * ---
757
+ *
758
+ * This is useful for forwarding only a specific part of the event payload.
759
+ * You can only use one of `input`, `inputPath`, or `inputTransformer`.
760
+ *
761
+ * Example:
762
+ *
763
+ * ```yaml
764
+ * inputPath: '$.detail'
765
+ * ```
766
+ */
767
+ inputPath?: string;
768
+ /**
769
+ * #### Customizes the event payload sent to the target.
770
+ *
771
+ * ---
772
+ *
773
+ * This allows you to extract values from the original event and use them to construct a new payload.
774
+ * You can only use one of `input`, `inputPath`, or `inputTransformer`.
775
+ *
776
+ * Example:
777
+ *
778
+ * ```yaml
779
+ * inputTransformer:
780
+ * inputPathsMap:
781
+ * eventTime: '$.time'
782
+ * inputTemplate:
783
+ * message: 'This event occurred at <eventTime>.'
784
+ * ```
785
+ */
786
+ inputTransformer?: EventInputTransformer;
787
+ }
788
+
789
+ interface AlarmIntegration {
790
+ type: 'cloudwatch-alarm';
791
+ properties: AlarmIntegrationProps;
792
+ }
793
+
794
+ interface AlarmIntegrationProps {
795
+ /**
796
+ * #### The name of the alarm (defined in the `alarms` section) that will trigger the function.
797
+ */
798
+ alarmName: string;
799
+ // input?: any;
800
+ // inputPath?: string;
801
+ // inputTransformer?: EventInputTransformer;
802
+ }
803
+
804
+ /**
805
+ * #### Triggers a function when new log records appear in a CloudWatch log group.
806
+ *
807
+ * ---
808
+ *
809
+ * **Note:** The event payload is base64-encoded and gzipped — you must decode and decompress it in your handler.
810
+ */
811
+ interface CloudwatchLogIntegration {
812
+ type: 'cloudwatch-log';
813
+ properties: CloudwatchLogIntegrationProps;
814
+ }
815
+
816
+ interface CloudwatchLogIntegrationProps {
817
+ /**
818
+ * #### The ARN of the log group to watch for new records.
819
+ */
820
+ logGroupArn: string;
821
+ /**
822
+ * #### A filter pattern to apply to the log records.
823
+ *
824
+ * ---
825
+ *
826
+ * Only logs that match this pattern will trigger the function.
827
+ * For details on the syntax, see the [AWS documentation on filter and pattern syntax](https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/FilterAndPatternSyntax.html).
828
+ */
829
+ filter?: string;
830
+ }
831
+
832
+ interface EventBusIntegrationPattern {
833
+ /**
834
+ * #### Filter by event version.
835
+ */
836
+ version?: any;
837
+ /**
838
+ * #### Filter by event detail-type (e.g., `["OrderPlaced"]`). This is the primary field for routing custom events.
839
+ */
840
+ 'detail-type'?: any;
841
+ /**
842
+ * #### Filter by event source (e.g., `["my-app"]` or `["aws.ec2"]` for AWS service events).
843
+ */
844
+ source?: any;
845
+ /**
846
+ * #### Filter by AWS account ID.
847
+ */
848
+ account?: any;
849
+ /**
850
+ * #### Filter by AWS region.
851
+ */
852
+ region?: any;
853
+ /**
854
+ * #### Filter by resource ARNs.
855
+ */
856
+ resources?: any;
857
+ /**
858
+ * #### Filter by event payload content. Supports nested matching, prefix/suffix, numeric comparisons.
859
+ */
860
+ detail?: any;
861
+ /**
862
+ * #### Filter by replay name (only present on replayed events).
863
+ */
864
+ 'replay-name'?: any;
865
+ }
866
+
867
+ interface EventInputTransformer {
868
+ /**
869
+ * #### A map of key-value pairs to extract from the event payload.
870
+ *
871
+ * ---
872
+ *
873
+ * Each value is a JSONPath expression that extracts data from the event. These extracted values can then be used in the `inputTemplate`.
874
+ */
875
+ inputPathsMap?: any;
876
+ /**
877
+ * #### A template for constructing a new event payload.
878
+ *
879
+ * ---
880
+ *
881
+ * Use placeholders (`<placeholder>`) to insert the values extracted with `inputPathsMap`.
882
+ */
883
+ inputTemplate: any;
884
+ }
885
+
886
+ interface IotIntegration {
887
+ type: 'iot';
888
+ properties: IotIntegrationProps;
889
+ }
890
+
891
+ interface IotIntegrationProps {
892
+ /**
893
+ * #### The SQL statement for the IoT topic rule.
894
+ */
895
+ sql: string;
896
+ /**
897
+ * #### The version of the IoT SQL rules engine to use.
898
+ */
899
+ sqlVersion?: string;
900
+ }
901
+
902
+ /**
903
+ * #### Triggers a function when an HTTP API Gateway receives a matching request.
904
+ *
905
+ * ---
906
+ *
907
+ * Routes are matched by specificity — exact paths take priority over wildcard paths.
908
+ */
909
+ interface HttpApiIntegration {
910
+ type: 'http-api-gateway';
911
+ properties: HttpApiIntegrationProps;
912
+ }
913
+
914
+ interface HttpApiIntegrationProps {
915
+ /**
916
+ * #### The name of the HTTP API Gateway.
917
+ */
918
+ httpApiGatewayName: string;
919
+ /**
920
+ * #### The HTTP method that will trigger this integration.
921
+ *
922
+ * ---
923
+ *
924
+ * You can specify an exact method (e.g., `GET`) or use `*` to match any method.
925
+ */
926
+ method: 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE' | 'HEAD' | 'OPTIONS' | '*';
927
+ /**
928
+ * #### The URL path that will trigger this integration.
929
+ *
930
+ * ---
931
+ *
932
+ * - **Exact path**: `/users`
933
+ * - **Path with parameter**: `/users/{id}`. The `id` will be available in `event.pathParameters.id`.
934
+ * - **Greedy path**: `/files/{proxy+}`. This will match any path starting with `/files/`.
935
+ */
936
+ path: string;
937
+ /**
938
+ * #### An authorizer to protect this route.
939
+ *
940
+ * ---
941
+ *
942
+ * Unauthorized requests will be rejected with a `401 Unauthorized` response.
943
+ */
944
+ authorizer?: StpAuthorizer;
945
+ /**
946
+ * #### The payload format version for the Lambda integration.
947
+ *
948
+ * ---
949
+ *
950
+ * For details on the differences between formats, see the [AWS documentation](https://docs.aws.amazon.com/apigateway/latest/developerguide/http-api-develop-integrations-lambda.html).
951
+ *
952
+ * @default '1.0'
953
+ */
954
+ payloadFormat?: '1.0' | '2.0';
955
+ }
956
+
957
+ /**
958
+ * #### Triggers a batch job when an event matching a specified pattern is received by an event bus.
959
+ *
960
+ * ---
961
+ *
962
+ * You can use a custom event bus or the default AWS event bus.
963
+ */
964
+ interface EventBusIntegration {
965
+ type: 'event-bus';
966
+ properties: EventBusIntegrationProps;
967
+ }
968
+
969
+ interface EventBusIntegrationProps {
970
+ /**
971
+ * #### The ARN of an existing event bus.
972
+ *
973
+ * ---
974
+ *
975
+ * Use this to subscribe to an event bus that is not managed by your stack.
976
+ * You must specify only one of `eventBusArn`, `eventBusName`, or `useDefaultBus`.
977
+ */
978
+ eventBusArn?: string;
979
+ /**
980
+ * #### The name of an event bus defined in your stack's resources.
981
+ *
982
+ * ---
983
+ *
984
+ * You must specify only one of `eventBusArn`, `eventBusName`, or `useDefaultBus`.
985
+ */
986
+ eventBusName?: string;
987
+ /**
988
+ * #### Uses the default AWS event bus.
989
+ *
990
+ * ---
991
+ *
992
+ * You must specify only one of `eventBusArn`, `eventBusName`, or `useDefaultBus`.
993
+ */
994
+ useDefaultBus?: boolean;
995
+ /**
996
+ * #### A pattern to filter events from the event bus.
997
+ *
998
+ * ---
999
+ *
1000
+ * Only events that match this pattern will trigger the target.
1001
+ * For details on the syntax, see the [AWS EventBridge documentation on event patterns](https://docs.aws.amazon.com/eventbridge/latest/userguide/eb-event-patterns.html).
1002
+ */
1003
+ eventPattern: EventBusIntegrationPattern;
1004
+ /**
1005
+ * #### A destination for events that fail to be delivered to the target.
1006
+ *
1007
+ * ---
1008
+ *
1009
+ * In rare cases, an event might fail to be delivered. This property specifies an SQS queue where failed events will be sent.
1010
+ */
1011
+ onDeliveryFailure?: EventBusOnDeliveryFailure;
1012
+ /**
1013
+ * #### A fixed JSON object to be passed as the event payload.
1014
+ *
1015
+ * ---
1016
+ *
1017
+ * If you need to customize the payload based on the event, use `inputTransformer` instead.
1018
+ * You can only use one of `input`, `inputPath`, or `inputTransformer`.
1019
+ *
1020
+ * Example:
1021
+ *
1022
+ * ```yaml
1023
+ * input:
1024
+ * source: 'my-custom-event'
1025
+ * ```
1026
+ */
1027
+ input?: any;
1028
+ /**
1029
+ * #### A JSONPath expression to extract a portion of the event to pass to the target.
1030
+ *
1031
+ * ---
1032
+ *
1033
+ * This is useful for forwarding only a specific part of the event payload.
1034
+ * You can only use one of `input`, `inputPath`, or `inputTransformer`.
1035
+ *
1036
+ * Example:
1037
+ *
1038
+ * ```yaml
1039
+ * inputPath: '$.detail'
1040
+ * ```
1041
+ */
1042
+ inputPath?: string;
1043
+ /**
1044
+ * #### Customizes the event payload sent to the target.
1045
+ *
1046
+ * ---
1047
+ *
1048
+ * This allows you to extract values from the original event and use them to construct a new payload.
1049
+ * You can only use one of `input`, `inputPath`, or `inputTransformer`.
1050
+ *
1051
+ * Example:
1052
+ *
1053
+ * ```yaml
1054
+ * inputTransformer:
1055
+ * inputPathsMap:
1056
+ * instanceId: '$.detail.instance-id'
1057
+ * instanceState: '$.detail.state'
1058
+ * inputTemplate:
1059
+ * message: 'Instance <instanceId> is now in state <instanceState>.'
1060
+ * ```
1061
+ */
1062
+ inputTransformer?: EventInputTransformer;
1063
+ }
1064
+
1065
+ interface EventBusOnDeliveryFailure {
1066
+ /**
1067
+ * #### The ARN of the SQS queue for failed events.
1068
+ */
1069
+ sqsQueueArn?: string;
1070
+ /**
1071
+ * #### The name of an SQS queue (defined in your Stacktape configuration) for failed events.
1072
+ */
1073
+ sqsQueueName?: string;
1074
+ }
1075
+
1076
+ /**
1077
+ * #### Triggers a container when a request is made to a Network Load Balancer.
1078
+ *
1079
+ * ---
1080
+ *
1081
+ * A Network Load Balancer operates at the transport layer (Layer 4) and can handle TCP and TLS traffic.
1082
+ */
1083
+ interface ContainerWorkloadNetworkLoadBalancerIntegration {
1084
+ type: 'network-load-balancer';
1085
+ properties: ContainerWorkloadNetworkLoadBalancerIntegrationProps;
1086
+ }
1087
+
1088
+ interface ContainerWorkloadNetworkLoadBalancerIntegrationProps extends NetworkLoadBalancerIntegrationProps {
1089
+ /**
1090
+ * #### The container port that will receive traffic from the load balancer.
1091
+ */
1092
+ containerPort: number;
1093
+ }
1094
+
1095
+ interface NetworkLoadBalancerIntegrationProps {
1096
+ /**
1097
+ * #### The name of the Network Load Balancer.
1098
+ *
1099
+ * ---
1100
+ *
1101
+ * This must reference a load balancer defined in your Stacktape configuration.
1102
+ */
1103
+ loadBalancerName: string;
1104
+ /**
1105
+ * #### The port of the listener that will forward traffic to this integration.
1106
+ */
1107
+ listenerPort: number;
1108
+ }
1109
+ ```