stacktape 3.5.7 → 3.6.0-beta.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 +142 -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 +405 -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 +206 -41
  122. package/package.json +1 -1
  123. package/plain.d.ts +309 -54
@@ -0,0 +1,399 @@
1
+ ---
2
+ docType: config-ref
3
+ title: Container Workload
4
+ resourceType: multi-container-workload
5
+ tags:
6
+ - multi-container-workload
7
+ - multi-container
8
+ - sidecar
9
+ source: types/stacktape-config/multi-container-workloads.d.ts
10
+ priority: 1
11
+ ---
12
+
13
+ # Container Workload
14
+
15
+ Run multiple containers together as a single unit with shared compute resources.
16
+
17
+ For advanced setups: sidecars, init containers, or services that need multiple processes.
18
+ Supports Fargate (serverless) or EC2 (custom instances). Auto-scales horizontally.
19
+
20
+ Resource type: `multi-container-workload`
21
+
22
+ ## TypeScript Definition
23
+
24
+ ```typescript
25
+ /**
26
+ * #### Run multiple containers together as a single unit with shared compute resources.
27
+ *
28
+ * ---
29
+ *
30
+ * For advanced setups: sidecars, init containers, or services that need multiple processes.
31
+ * Supports Fargate (serverless) or EC2 (custom instances). Auto-scales horizontally.
32
+ */
33
+ interface ContainerWorkload {
34
+ type: 'multi-container-workload';
35
+ properties: ContainerWorkloadProps;
36
+ overrides?: ResourceOverrides;
37
+ }
38
+
39
+ interface ContainerWorkloadProps extends ResourceAccessProps {
40
+ /**
41
+ * #### Containers in this workload. They share compute resources and scale together.
42
+ */
43
+ containers: ContainerWorkloadContainer[];
44
+ /**
45
+ * #### CPU, memory, and compute engine (Fargate or EC2).
46
+ *
47
+ * ---
48
+ *
49
+ * - **Fargate** (set `cpu` + `memory`): Serverless, no servers to manage.
50
+ * - **EC2** (set `instanceTypes`): Choose specific instance types for more control or GPU access.
51
+ */
52
+ resources: ContainerWorkloadResourcesConfig;
53
+ /**
54
+ * period of time scheduler should ignore unhealthy load balancer health checks after a task has first started.
55
+ * This is only used when your multi-container-workload is configured to use a load balancer. This grace period can prevent the service scheduler from marking workload instances as unhealthy and stopping them before they have time to come up.
56
+ */
57
+ // loadBalancerCheckGracePeriodSeconds?: number;
58
+ /**
59
+ * #### Auto-scaling: how many instances and when to add/remove them.
60
+ */
61
+ scaling?: ContainerWorkloadScaling;
62
+ /**
63
+ * #### Gradual traffic shifting (canary/linear) for safe deployments. Requires an ALB integration.
64
+ */
65
+ deployment?: ContainerWorkloadDeploymentConfig;
66
+ /**
67
+ * #### Enable `stacktape container:session` for interactive shell access to running containers.
68
+ */
69
+ enableRemoteSessions?: boolean;
70
+ /**
71
+ * #### Run in private subnets with a NAT Gateway for outbound internet. Gives you a static public IP.
72
+ *
73
+ * ---
74
+ *
75
+ * Useful for IP whitelisting with third-party APIs. NAT Gateway costs ~$32/month per AZ + data processing fees.
76
+ *
77
+ * @default false
78
+ */
79
+ usePrivateSubnetsWithNAT?: boolean;
80
+ }
81
+
82
+ interface ContainerWorkloadDeploymentConfig {
83
+ /**
84
+ * #### How traffic shifts to the new version during deployment.
85
+ *
86
+ * ---
87
+ *
88
+ * - `Canary10Percent5Minutes`: 10% first, then all after 5 min.
89
+ * - `Canary10Percent15Minutes`: 10% first, then all after 15 min.
90
+ * - `Linear10PercentEvery1Minutes`: 10% more every minute.
91
+ * - `Linear10PercentEvery3Minutes`: 10% more every 3 minutes.
92
+ * - `AllAtOnce`: Instant switch.
93
+ */
94
+ strategy:
95
+ | 'Canary10Percent5Minutes'
96
+ | 'Canary10Percent15Minutes'
97
+ | 'Linear10PercentEvery1Minutes'
98
+ | 'Linear10PercentEvery3Minutes'
99
+ | 'AllAtOnce';
100
+ /**
101
+ * #### Lambda function to run before traffic shifts to the new version (for validation/smoke tests).
102
+ */
103
+ beforeAllowTrafficFunction?: string;
104
+ /**
105
+ * #### Lambda function to run after all traffic has shifted (for post-deployment checks).
106
+ */
107
+ afterTrafficShiftFunction?: string;
108
+ /**
109
+ * #### ALB listener port for test traffic. Only needed with `beforeAllowTrafficFunction` and custom listeners.
110
+ */
111
+ testListenerPort?: number;
112
+ }
113
+
114
+ interface ContainerWorkloadResourcesConfig {
115
+ /**
116
+ * #### vCPUs for the workload (Fargate). Ignored when using `instanceTypes`.
117
+ */
118
+ cpu?: 0.25 | 0.5 | 1 | 2 | 4 | 8 | 16;
119
+ /**
120
+ * #### Memory in MB. Must be compatible with the vCPU count on Fargate.
121
+ *
122
+ * ---
123
+ *
124
+ * Fargate valid combos: 0.25 vCPU → 512-2048 MB, 0.5 → 1024-4096, 1 → 2048-8192, 2 → 4096-16384,
125
+ * 4 → 8192-30720, 8 → 16384-61440, 16 → 32768-122880.
126
+ * For EC2: auto-detected from instance type if omitted.
127
+ */
128
+ memory?: number;
129
+ /**
130
+ * #### EC2 instance types for the workload (e.g., `t3.medium`, `c6g.large`). Use instead of `cpu`/`memory`.
131
+ *
132
+ * ---
133
+ *
134
+ * First type in the list is preferred. Instances auto-scale and are refreshed weekly for patching.
135
+ * Tip: specify a single type and omit `cpu`/`memory` for optimal sizing.
136
+ */
137
+ instanceTypes?: string[];
138
+ /**
139
+ * #### Keep pre-initialized EC2 instances ready for faster scaling. Only works with a single instance type.
140
+ */
141
+ enableWarmPool?: boolean;
142
+ /**
143
+ * #### CPU architecture for Fargate. `arm64` is ~20% cheaper. Ignored when using `instanceTypes`.
144
+ * @default 'x86_64'
145
+ */
146
+ architecture?: 'x86_64' | 'arm64';
147
+ }
148
+
149
+ interface ContainerWorkloadScaling {
150
+ /**
151
+ * #### Minimum running instances. Set to 0 is not supported — minimum is 1.
152
+ * @default 1
153
+ */
154
+ minInstances?: number;
155
+ /**
156
+ * #### Maximum running instances. Traffic is distributed across all instances.
157
+ * @default 1
158
+ */
159
+ maxInstances?: number;
160
+ /**
161
+ * #### When to scale: CPU and/or memory utilization targets.
162
+ */
163
+ scalingPolicy?: ContainerWorkloadScalingPolicy;
164
+ }
165
+
166
+ interface ContainerWorkloadScalingPolicy {
167
+ /**
168
+ * #### Scale out when avg CPU exceeds this %, scale in when it drops below.
169
+ * @default 80
170
+ */
171
+ keepAvgCpuUtilizationUnder?: number;
172
+ /**
173
+ * #### Scale out when avg memory exceeds this %, scale in when it drops below.
174
+ * @default 80
175
+ */
176
+ keepAvgMemoryUtilizationUnder?: number;
177
+ }
178
+
179
+ interface ContainerWorkloadContainerLogging extends LogForwardingBase {
180
+ /**
181
+ * #### Disable logging to CloudWatch.
182
+ * @default false
183
+ */
184
+ disabled?: boolean;
185
+ /**
186
+ * #### How many days to keep logs.
187
+ * @default 90
188
+ */
189
+ retentionDays?: 1 | 3 | 5 | 7 | 14 | 30 | 60 | 90 | 120 | 150 | 180 | 365 | 400 | 545 | 731 | 1827 | 3653;
190
+ }
191
+
192
+ interface ContainerWorkloadContainerBase {
193
+ /**
194
+ * #### Unique container name within this workload.
195
+ */
196
+ name: string;
197
+ /**
198
+ * #### How to build or specify the container image.
199
+ */
200
+ packaging: ContainerWorkloadContainerPackaging;
201
+ /**
202
+ * #### If `true` (default), the entire workload restarts when this container fails.
203
+ */
204
+ essential?: boolean;
205
+ /**
206
+ * #### Container logging (stdout/stderr). Sent to CloudWatch, viewable with `stacktape logs`.
207
+ */
208
+ logging?: ContainerWorkloadContainerLogging;
209
+ /**
210
+ * #### Start this container only after the listed containers reach a specific state.
211
+ *
212
+ * ---
213
+ *
214
+ * E.g., wait for a database sidecar to be `HEALTHY` before starting the app container.
215
+ */
216
+ dependsOn?: ContainerDependency[];
217
+ /**
218
+ * #### Environment variables injected at runtime. Use `$ResourceParam()` or `$Secret()` for dynamic values.
219
+ */
220
+ environment?: EnvironmentVar[];
221
+ /**
222
+ * #### Command-based health check. If it fails on an essential container, the workload instance is replaced.
223
+ */
224
+ internalHealthCheck?: ContainerHealthCheck;
225
+ /**
226
+ * #### Seconds to wait after SIGTERM before SIGKILL (2-120).
227
+ * @default 2
228
+ */
229
+ stopTimeout?: number;
230
+ /**
231
+ * #### Mount EFS volumes for persistent, shared storage across containers.
232
+ */
233
+ volumeMounts?: ContainerEfsMount[];
234
+ }
235
+
236
+ interface ContainerWorkloadContainer extends ContainerWorkloadContainerBase {
237
+ /**
238
+ * #### How this container receives traffic (API Gateway, load balancer, or service-connect).
239
+ */
240
+ events?: (
241
+ | ContainerWorkloadHttpApiIntegration
242
+ | ContainerWorkloadLoadBalancerIntegration
243
+ | ContainerWorkloadInternalIntegration
244
+ | ContainerWorkloadServiceConnectIntegration
245
+ | ContainerWorkloadNetworkLoadBalancerIntegration
246
+ )[];
247
+ /**
248
+ * #### Load balancer health check settings. Only applies when integrated with an ALB or NLB.
249
+ */
250
+ loadBalancerHealthCheck?: LoadBalancerHealthCheck;
251
+ }
252
+
253
+ interface ContainerEfsMount {
254
+ /**
255
+ * #### The type of the volume mount.
256
+ */
257
+ type: 'efs';
258
+ /**
259
+ * #### Properties for the EFS volume mount.
260
+ */
261
+ properties: ContainerEfsMountProps;
262
+ }
263
+
264
+ interface ContainerEfsMountProps {
265
+ /**
266
+ * #### Name of the `efs-filesystem` resource defined in your config.
267
+ */
268
+ efsFilesystemName: string;
269
+ /**
270
+ * #### Subdirectory within the EFS filesystem to mount. Restricts access to that directory.
271
+ * @default "/"
272
+ */
273
+ rootDirectory?: string;
274
+ /**
275
+ * #### Absolute path inside the container where the volume is mounted (e.g., `/data`).
276
+ */
277
+ mountPath: string;
278
+ }
279
+
280
+ interface LoadBalancerHealthCheck {
281
+ /**
282
+ * #### Path the load balancer pings to check container health.
283
+ * @default /
284
+ */
285
+ healthcheckPath?: string;
286
+ /**
287
+ * #### Seconds between health checks.
288
+ * @default 5
289
+ */
290
+ healthcheckInterval?: number;
291
+ /**
292
+ * #### Seconds before a health check is considered failed.
293
+ * @default 4
294
+ */
295
+ healthcheckTimeout?: number;
296
+ /**
297
+ * #### Health check protocol. ALB defaults to `HTTP`, NLB defaults to `TCP`.
298
+ */
299
+ healthCheckProtocol?: 'HTTP' | 'TCP';
300
+ /**
301
+ * #### Health check port. Defaults to the traffic port.
302
+ */
303
+ healthCheckPort?: number;
304
+ }
305
+
306
+ // interface ContainerWorkloadPort {
307
+ // number: number;
308
+ // integrations?: (
309
+ // | ContainerWorkloadHttpApiIntegration
310
+ // | ContainerWorkloadLoadBalancerIntegration
311
+ // | ContainerWorkloadServiceConnectIntegration
312
+ // )[];
313
+ // }
314
+
315
+ interface ContainerDependency {
316
+ /**
317
+ * The name of the container that this container depends on.
318
+ */
319
+ containerName: string;
320
+ /**
321
+ * #### The condition that the dependency container must meet.
322
+ * ---
323
+ * Available conditions:
324
+ * - `START`: The dependency has started.
325
+ * - `COMPLETE`: The dependency has finished executing (regardless of success).
326
+ * - `SUCCESS`: The dependency has finished with an exit code of `0`.
327
+ * - `HEALTHY`: The dependency has passed its first health check.
328
+ */
329
+ condition: 'COMPLETE' | 'HEALTHY' | 'START' | 'SUCCESS';
330
+ }
331
+
332
+ // interface ContainerWorkloadPort {
333
+ // /**
334
+ // * port number to expose on the container
335
+ // */
336
+ // containerPort: number;
337
+ // /**
338
+ // * port protocol. default is <b>tcp</b>
339
+ // */
340
+ // protocol?: 'udp' | 'tcp'; // tcp is default
341
+ // // removing loadBalancerCheck for time being (for simplicity)
342
+ // // loadBalancerCheck?: LoadBalancerAvailabilityCheck;
343
+ // }
344
+
345
+ interface ContainerHealthCheck {
346
+ /**
347
+ * #### Command to check health. E.g., `["CMD-SHELL", "curl -f http://localhost/ || exit 1"]`. Exit 0 = healthy.
348
+ */
349
+ healthCheckCommand: string[];
350
+ /**
351
+ * #### Seconds between health checks (5-300).
352
+ * @default 30
353
+ */
354
+ intervalSeconds?: number;
355
+ /**
356
+ * #### Seconds before a check is considered failed (2-60).
357
+ * @default 5
358
+ */
359
+ timeoutSeconds?: number;
360
+ /**
361
+ * #### Consecutive failures before marking unhealthy (1-10).
362
+ * @default 3
363
+ */
364
+ retries?: number;
365
+ /**
366
+ * #### Grace period (seconds) before counting failures. Gives the container time to start (0-300).
367
+ */
368
+ startPeriodSeconds?: number;
369
+ }
370
+
371
+ interface LoadBalancerAvailabilityCheck {
372
+ httpPath?: string;
373
+ intervalSeconds?: number;
374
+ }
375
+
376
+ interface ECSBlueGreenService {
377
+ Type: 'Stacktape::ECSBlueGreenV1::Service';
378
+ Properties: {
379
+ ECSService: import('@cloudform/ecs/service').ServiceProperties;
380
+ StackName: import('@cloudform/dataTypes').Value<string>;
381
+ CodeDeployApplicationName: import('@cloudform/dataTypes').Value<string>;
382
+ CodeDeployDeploymentGroupName: import('@cloudform/dataTypes').Value<string>;
383
+ LifecycleEventHooks: {
384
+ AfterAllowTraffic: import('@cloudform/dataTypes').Value<string>;
385
+ BeforeAllowTraffic: import('@cloudform/dataTypes').Value<string>;
386
+ };
387
+ };
388
+ DependsOn: string[];
389
+ }
390
+
391
+ type ContainerWorkloadReferencableParam = 'logGroupArn';
392
+
393
+ type ContainerWorkloadEvent =
394
+ | ContainerWorkloadLoadBalancerIntegration
395
+ | ContainerWorkloadHttpApiIntegration
396
+ | ContainerWorkloadInternalIntegration
397
+ | ContainerWorkloadServiceConnectIntegration
398
+ | ContainerWorkloadNetworkLoadBalancerIntegration;
399
+ ```
@@ -0,0 +1,118 @@
1
+ ---
2
+ docType: config-ref
3
+ title: Network Load Balancer
4
+ resourceType: network-load-balancer
5
+ tags:
6
+ - network-load-balancer
7
+ - nlb
8
+ source: types/stacktape-config/network-load-balancer.d.ts
9
+ priority: 1
10
+ ---
11
+
12
+ # Network Load Balancer
13
+
14
+ TCP/TLS load balancer for non-HTTP traffic (MQTT, game servers, custom protocols).
15
+
16
+ Handles millions of connections with ultra-low latency. Use when you need raw TCP/TLS
17
+ instead of HTTP routing. Does not support CDN, firewall, or gradual deployments.
18
+
19
+ Resource type: `network-load-balancer`
20
+
21
+ ## TypeScript Definition
22
+
23
+ ```typescript
24
+ /**
25
+ * #### TCP/TLS load balancer for non-HTTP traffic (MQTT, game servers, custom protocols).
26
+ *
27
+ * ---
28
+ *
29
+ * Handles millions of connections with ultra-low latency. Use when you need raw TCP/TLS
30
+ * instead of HTTP routing. Does not support CDN, firewall, or gradual deployments.
31
+ */
32
+ interface NetworkLoadBalancer {
33
+ type: 'network-load-balancer';
34
+ properties: NetworkLoadBalancerProps;
35
+ overrides?: ResourceOverrides;
36
+ }
37
+
38
+ interface NetworkLoadBalancerProps {
39
+ /**
40
+ * #### `internet` (public) or `internal` (VPC-only).
41
+ * @default internet
42
+ */
43
+ interface?: 'internet' | 'internal';
44
+ /**
45
+ * #### Custom domains.
46
+ *
47
+ * ---
48
+ *
49
+ * By default, Stacktape creates DNS records and TLS certificates for each domain.
50
+ * If you manage DNS yourself, set `disableDnsRecordCreation` and provide `customCertificateArn`.
51
+ *
52
+ * Backward compatible format `string[]` is still supported.
53
+ */
54
+ customDomains?: DomainConfiguration[] | string[];
55
+ /**
56
+ * #### Listeners define which ports and protocols (TCP/TLS) this load balancer accepts traffic on.
57
+ */
58
+ listeners: NetworkLoadBalancerListener[];
59
+ // /**
60
+ // * #### Enables HTTPS on the load balancer (default load balancer listener)
61
+ // * ---
62
+ // * - If set to true:
63
+ // * - load balancer uses HTTPS protocol for the incoming connection
64
+ // * - all incoming HTTP protocol connections are redirected to the HTTPS
65
+ // * - To use this property, you also need to specify custom domain in `customDomains` property
66
+ // */
67
+ // useHttps?: boolean;
68
+ // /**
69
+ // * #### Additional alarms associated with this resource
70
+ // * ---
71
+ // * - These alarms will be merged with the alarms configured globally in the [console](https://console.stacktape.com/alarms)
72
+ // */
73
+ // alarms?: NetworkLoadBalancerAlarm[];
74
+ // /**
75
+ // * #### Disables globally configured alarms specifically for this resource
76
+ // * ---
77
+ // * - List of alarm names as configured in the [console](https://console.stacktape.com/alarms)
78
+ // */
79
+ // disabledGlobalAlarms?: string[];
80
+ // /**
81
+ // * #### Name of the 'web-app-firewall' resource to use for this load balancer
82
+ // * ---
83
+ // * - You can use `web-app-firewall` to protect your resources from common web exploits that could affect application availability, compromise security, or consume excessive resources.
84
+ // * - Web app firewall protects your application by filtering dangerous requests coming to your app.
85
+ // * You can read more about the firewall [in our docs](https://docs.stacktape.com/security-resources/web-app-firewalls/).
86
+ // */
87
+ // useFirewall?: string;
88
+ }
89
+
90
+ interface NetworkLoadBalancerListener {
91
+ /**
92
+ * #### `TCP` (raw) or `TLS` (encrypted). TLS requires a certificate (auto-created with `customDomains` or via `customCertificateArns`).
93
+ */
94
+ protocol: 'TCP' | 'TLS';
95
+ /**
96
+ * #### Port this listener accepts traffic on.
97
+ */
98
+ port: number;
99
+ /**
100
+ * #### ARNs of your own ACM certificates. Not needed if using `customDomains` or TCP protocol.
101
+ */
102
+ customCertificateArns?: string[];
103
+ /**
104
+ * #### Restrict access to specific IP addresses/CIDRs. Default: all IPs allowed.
105
+ */
106
+ whitelistIps?: string[];
107
+ }
108
+
109
+ interface StpResolvedNetworkLoadBalancerReference extends Omit<
110
+ ContainerWorkloadNetworkLoadBalancerIntegrationProps,
111
+ 'loadBalancerName'
112
+ > {
113
+ protocol: 'TCP' | 'TLS';
114
+ loadBalancer: StpNetworkLoadBalancer;
115
+ listenerPort: number;
116
+ listenerHasCustomCerts?: boolean;
117
+ }
118
+ ```
@@ -0,0 +1,147 @@
1
+ ---
2
+ docType: config-ref
3
+ title: Nextjs Web
4
+ resourceType: nextjs-web
5
+ tags:
6
+ - nextjs-web
7
+ - nextjs
8
+ - next.js
9
+ - next
10
+ - ssr
11
+ source: types/stacktape-config/nextjs-web.d.ts
12
+ priority: 1
13
+ ---
14
+
15
+ # Nextjs Web
16
+
17
+ Deploy a Next.js app with SSR on AWS Lambda, static assets on S3, and a CloudFront CDN.
18
+
19
+ Handles ISR (Incremental Static Regeneration), image optimization, and middleware out of the box.
20
+ Optionally deploy to Lambda@Edge for lower latency or enable response streaming.
21
+
22
+ Resource type: `nextjs-web`
23
+
24
+ ## TypeScript Definition
25
+
26
+ ```typescript
27
+ /**
28
+ * #### Deploy a Next.js app with SSR on AWS Lambda, static assets on S3, and a CloudFront CDN.
29
+ *
30
+ * ---
31
+ *
32
+ * Handles ISR (Incremental Static Regeneration), image optimization, and middleware out of the box.
33
+ * Optionally deploy to Lambda@Edge for lower latency or enable response streaming.
34
+ */
35
+ interface NextjsWeb {
36
+ type: 'nextjs-web';
37
+ properties: NextjsWebProps;
38
+ overrides?: ResourceOverrides;
39
+ }
40
+
41
+ interface NextjsWebProps extends ResourceAccessProps {
42
+ /**
43
+ * #### Directory containing your `next.config.js`. For monorepos, point to the Next.js workspace.
44
+ */
45
+ appDirectory: string;
46
+ /**
47
+ * #### Customize the SSR Lambda function (memory, timeout, VPC, logging).
48
+ */
49
+ serverLambda?: NextjsServerLambdaProperties;
50
+ /**
51
+ * #### Number of Lambda instances to keep warm (pre-initialized) to reduce cold starts.
52
+ *
53
+ * ---
54
+ *
55
+ * A separate "warmer" function periodically pings the SSR Lambda. Not available with `useEdgeLambda: true`.
56
+ *
57
+ * @default 0
58
+ */
59
+ warmServerInstances?: number;
60
+ /**
61
+ * #### Run SSR at CloudFront edge locations for lower latency worldwide.
62
+ *
63
+ * ---
64
+ *
65
+ * **Trade-offs:** Slower deploys, no `warmServerInstances`, no response streaming.
66
+ *
67
+ * @default false
68
+ */
69
+ useEdgeLambda?: boolean;
70
+ /**
71
+ * #### Override the default `next build` command.
72
+ */
73
+ buildCommand?: string;
74
+ /**
75
+ * #### Dev server config for `stacktape dev`. Defaults to `next dev`.
76
+ */
77
+ dev?: {
78
+ /**
79
+ * #### Dev server command (e.g., `npm run dev`).
80
+ *
81
+ * @default "next dev"
82
+ */
83
+ command?: string;
84
+ };
85
+ /**
86
+ * #### Set custom headers (e.g., `Cache-Control`) for static files matching a pattern.
87
+ */
88
+ fileOptions?: DirectoryUploadFilter[];
89
+ /**
90
+ * #### Environment variables for the SSR function. Use `$ResourceParam()` or `$Secret()` for dynamic values.
91
+ */
92
+ environment?: EnvironmentVar[];
93
+ /**
94
+ * #### Attach custom domains with auto-managed DNS records and TLS certificates.
95
+ *
96
+ * ---
97
+ *
98
+ * **Prerequisite:** A Route 53 hosted zone for your domain must exist in your AWS account.
99
+ */
100
+ customDomains?: DomainConfiguration[];
101
+ /**
102
+ * #### Name of a `web-app-firewall` resource to protect this app. Firewall `scope` must be `cdn`.
103
+ */
104
+ useFirewall?: string;
105
+ /**
106
+ * #### Stream SSR responses for faster Time to First Byte and up to 20 MB response size (vs 6 MB default).
107
+ *
108
+ * ---
109
+ *
110
+ * Not compatible with `useEdgeLambda: true`.
111
+ *
112
+ * @default false
113
+ */
114
+ streamingEnabled?: boolean;
115
+ /**
116
+ * #### CDN cache controls for SSR routes and specific path patterns.
117
+ */
118
+ cdn?: SsrWebCdnConfig;
119
+ }
120
+
121
+ interface NextjsServerLambdaProperties {
122
+ /**
123
+ * #### Memory in MB (128–10,240). CPU scales proportionally — 1,769 MB = 1 vCPU.
124
+ *
125
+ * @default 1024
126
+ */
127
+ memory?: number;
128
+ /**
129
+ * #### Max execution time in seconds. Max: 30.
130
+ *
131
+ * @default 30
132
+ */
133
+ timeout?: number;
134
+ /**
135
+ * #### Logging config. Logs are sent to CloudWatch. View with `stacktape logs` or in the AWS console.
136
+ */
137
+ logging?: LambdaFunctionLogging;
138
+ /**
139
+ * #### Connect to VPC resources (databases, Redis). **Warning:** function loses direct internet access.
140
+ *
141
+ * ---
142
+ *
143
+ * S3 and DynamoDB remain accessible via auto-created VPC endpoints.
144
+ */
145
+ joinDefaultVpc?: boolean;
146
+ }
147
+ ```