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,338 @@
1
+ ---
2
+ docType: concept
3
+ title: YAML Configuration
4
+ tags:
5
+ - yaml
6
+ - configuration
7
+ - concept
8
+ source: docs/_curated-docs/concepts/yaml-config.mdx
9
+ priority: 1
10
+ ---
11
+
12
+ # YAML Configuration
13
+
14
+ YAML is a human-readable configuration format that works well for straightforward Stacktape configurations.
15
+
16
+ ## Basic Structure
17
+
18
+ Create `stacktape.yml` in your project root:
19
+
20
+ ```yaml
21
+ resources:
22
+ api:
23
+ type: http-api-gateway
24
+ properties:
25
+ cors:
26
+ enabled: true
27
+
28
+ handler:
29
+ type: function
30
+ properties:
31
+ packaging:
32
+ type: stacktape-lambda-buildpack
33
+ properties:
34
+ entryfilePath: ./src/handler.ts
35
+ events:
36
+ - type: http-api-integration
37
+ properties:
38
+ httpApiGatewayName: api
39
+ method: GET
40
+ path: /
41
+ ```
42
+
43
+ ## Resource Definition
44
+
45
+ Each resource has three parts:
46
+
47
+ ```yaml
48
+ resources:
49
+ resourceName: # Unique name (used for references)
50
+ type: resource-type # Type of resource
51
+ properties: # Resource-specific configuration
52
+ property1: value1
53
+ property2: value2
54
+ ```
55
+
56
+ ## Available Resource Types
57
+
58
+ ### Compute
59
+
60
+ | Type | Description |
61
+ | -------------------------- | ----------------------------------- |
62
+ | `function` | Lambda function |
63
+ | `edge-lambda-function` | Lambda@Edge function |
64
+ | `web-service` | ECS container with public endpoint |
65
+ | `private-service` | ECS container with private endpoint |
66
+ | `worker-service` | ECS background container |
67
+ | `multi-container-workload` | Multiple containers |
68
+ | `batch-job` | AWS Batch job |
69
+ | `nextjs-web` | Next.js application |
70
+
71
+ ### Databases
72
+
73
+ | Type | Description |
74
+ | ------------------------ | ------------------------ |
75
+ | `relational-database` | RDS/Aurora database |
76
+ | `dynamo-db-table` | DynamoDB table |
77
+ | `redis-cluster` | ElastiCache Redis |
78
+ | `mongo-db-atlas-cluster` | MongoDB Atlas |
79
+ | `upstash-redis` | Upstash serverless Redis |
80
+ | `open-search-domain` | OpenSearch/Elasticsearch |
81
+
82
+ ### Networking
83
+
84
+ | Type | Description |
85
+ | --------------------------- | ---------------- |
86
+ | `http-api-gateway` | HTTP API Gateway |
87
+ | `application-load-balancer` | ALB |
88
+ | `network-load-balancer` | NLB |
89
+
90
+ ### Storage
91
+
92
+ | Type | Description |
93
+ | ---------------- | -------------------------------- |
94
+ | `bucket` | S3 bucket |
95
+ | `hosting-bucket` | S3 + CloudFront for static sites |
96
+ | `efs-filesystem` | EFS shared storage |
97
+
98
+ ### Messaging
99
+
100
+ | Type | Description |
101
+ | ----------- | --------------- |
102
+ | `sqs-queue` | SQS queue |
103
+ | `sns-topic` | SNS topic |
104
+ | `event-bus` | EventBridge bus |
105
+
106
+ ### Security
107
+
108
+ | Type | Description |
109
+ | ------------------ | --------------------------- |
110
+ | `user-auth-pool` | Cognito user pool |
111
+ | `web-app-firewall` | WAF |
112
+ | `bastion` | Bastion host for VPC access |
113
+
114
+ ### Other
115
+
116
+ | Type | Description |
117
+ | --------------- | -------------- |
118
+ | `state-machine` | Step Functions |
119
+
120
+ ## Lambda Function Example
121
+
122
+ ```yaml
123
+ resources:
124
+ myFunction:
125
+ type: function
126
+ properties:
127
+ packaging:
128
+ type: stacktape-lambda-buildpack
129
+ properties:
130
+ entryfilePath: ./src/handler.ts
131
+ memory: 512
132
+ timeout: 30
133
+ environment:
134
+ - name: NODE_ENV
135
+ value: production
136
+ events:
137
+ - type: http-api-integration
138
+ properties:
139
+ httpApiGatewayName: api
140
+ method: POST
141
+ path: /users
142
+ - type: schedule-integration
143
+ properties:
144
+ scheduleRate: rate(1 hour)
145
+ ```
146
+
147
+ ## Container Service Example
148
+
149
+ ```yaml
150
+ resources:
151
+ webApp:
152
+ type: web-service
153
+ properties:
154
+ packaging:
155
+ type: stacktape-image-buildpack
156
+ properties:
157
+ entryfilePath: ./src/server.ts
158
+ resources:
159
+ cpu: 0.5
160
+ memory: 1024
161
+ scaling:
162
+ minInstances: 1
163
+ maxInstances: 10
164
+ events:
165
+ - type: http-api-integration
166
+ properties:
167
+ httpApiGatewayName: api
168
+ containerPort: 3000
169
+ method: '*'
170
+ path: '/*'
171
+ ```
172
+
173
+ ## Database Example
174
+
175
+ ```yaml
176
+ resources:
177
+ database:
178
+ type: relational-database
179
+ properties:
180
+ engine:
181
+ type: postgres
182
+ properties:
183
+ version: '16'
184
+ primaryInstance:
185
+ instanceSize: db.t4g.micro
186
+ credentials:
187
+ masterUserPassword: $Secret('db-password')
188
+ ```
189
+
190
+ ## Using Variables
191
+
192
+ Define reusable values with the `variables` section:
193
+
194
+ ```yaml
195
+ variables:
196
+ instanceSize: db.t4g.micro
197
+ apiDomain: api.example.com
198
+
199
+ resources:
200
+ database:
201
+ type: relational-database
202
+ properties:
203
+ engine:
204
+ type: postgres
205
+ properties:
206
+ primaryInstance:
207
+ instanceSize: $Var('instanceSize')
208
+
209
+ api:
210
+ type: http-api-gateway
211
+ properties:
212
+ customDomains:
213
+ - domainName: $Var('apiDomain')
214
+ ```
215
+
216
+ ## Connecting Resources
217
+
218
+ Use `connectTo` to automatically handle permissions and credentials:
219
+
220
+ ```yaml
221
+ resources:
222
+ database:
223
+ type: relational-database
224
+ properties:
225
+ engine:
226
+ type: postgres
227
+
228
+ handler:
229
+ type: function
230
+ properties:
231
+ packaging:
232
+ type: stacktape-lambda-buildpack
233
+ properties:
234
+ entryfilePath: ./src/handler.ts
235
+ connectTo:
236
+ - database # Automatically gets DB credentials
237
+ ```
238
+
239
+ ## Scripts
240
+
241
+ Define reusable scripts:
242
+
243
+ ```yaml
244
+ scripts:
245
+ migrate:
246
+ type: local-script
247
+ properties:
248
+ executeCommand: npx prisma migrate deploy
249
+ connectTo:
250
+ - database
251
+
252
+ seed:
253
+ type: local-script
254
+ properties:
255
+ executeCommand: npx prisma db seed
256
+ connectTo:
257
+ - database
258
+ ```
259
+
260
+ Run scripts:
261
+
262
+ ```bash
263
+ stacktape script:run --scriptName migrate --stage dev --region us-east-1
264
+ ```
265
+
266
+ ## Hooks
267
+
268
+ Execute scripts during deployment lifecycle:
269
+
270
+ ```yaml
271
+ hooks:
272
+ beforeDeploy:
273
+ - scriptName: build
274
+ afterDeploy:
275
+ - scriptName: migrate
276
+ - scriptName: seed
277
+ ```
278
+
279
+ ## VS Code Extension
280
+
281
+ For the best YAML editing experience, install the [Stacktape VS Code extension](https://marketplace.visualstudio.com/items?itemName=stacktape.stacktape):
282
+
283
+ - Syntax validation
284
+ - Autocompletion
285
+ - Inline documentation
286
+ - Error highlighting
287
+
288
+ `[IMAGE PLACEHOLDER: vscode-yaml-autocomplete]`
289
+
290
+ ## Limitations vs TypeScript
291
+
292
+ YAML has some limitations compared to TypeScript:
293
+
294
+ | Feature | TypeScript | YAML |
295
+ | ----------------- | ---------- | ----------------- |
296
+ | Type checking | ✅ | ❌ |
297
+ | Autocompletion | ✅ Full | ✅ With extension |
298
+ | Conditional logic | ✅ Native | ⚠️ Via directives |
299
+ | Loops | ✅ Native | ❌ |
300
+ | Code reuse | ✅ Imports | ⚠️ Variables only |
301
+ | IDE refactoring | ✅ | ❌ |
302
+
303
+ For complex configurations with lots of conditional logic, consider TypeScript.
304
+
305
+ ## Converting YAML to TypeScript
306
+
307
+ Stacktape's documentation automatically shows TypeScript equivalents for YAML examples. You can also manually convert:
308
+
309
+ **YAML:**
310
+
311
+ ```yaml
312
+ resources:
313
+ handler:
314
+ type: function
315
+ properties:
316
+ packaging:
317
+ type: stacktape-lambda-buildpack
318
+ properties:
319
+ entryfilePath: ./src/handler.ts
320
+ ```
321
+
322
+ **TypeScript:**
323
+
324
+ ```typescript
325
+ import { defineConfig, LambdaFunction, StacktapeLambdaBuildpackPackaging } from 'stacktape';
326
+
327
+ export default defineConfig(() => {
328
+ const handler = new LambdaFunction({
329
+ packaging: new StacktapeLambdaBuildpackPackaging({
330
+ entryfilePath: './src/handler.ts'
331
+ })
332
+ });
333
+
334
+ return { resources: { handler } };
335
+ });
336
+ ```
337
+
338
+ ## Next Steps
@@ -0,0 +1,131 @@
1
+ ---
2
+ docType: config-ref
3
+ title: Stacktape Config
4
+ tags:
5
+ - root
6
+ - config
7
+ - stacktape-config
8
+ - top-level
9
+ source: types/stacktape-config/_root.d.ts
10
+ priority: 1
11
+ ---
12
+
13
+ # Stacktape Config
14
+
15
+ ## TypeScript Definition
16
+
17
+ ```typescript
18
+ interface StacktapeConfig {
19
+ /**
20
+ * #### The name of this service.
21
+ *
22
+ * ---
23
+ *
24
+ * > **Deprecated:** Use the `--projectName` option in the CLI instead.
25
+ *
26
+ * The CloudFormation stack name will be in the format: `{serviceName}-{stage}`.
27
+ *
28
+ * Must be alphanumeric and can contain dashes. Must match the regex `[a-zA-Z][-a-zA-Z0-9]*`.
29
+ *
30
+ * @deprecated
31
+ */
32
+ serviceName?: string;
33
+ /**
34
+ * #### Credentials and settings for 3rd-party services (MongoDB Atlas, Upstash).
35
+ *
36
+ * ---
37
+ *
38
+ * Required only if you use `mongo-db-atlas-cluster` or `upstash-redis` resources in your stack.
39
+ */
40
+ providerConfig?: {
41
+ mongoDbAtlas?: MongoDbAtlasProvider;
42
+ upstash?: UpstashProvider;
43
+ };
44
+ /**
45
+ * #### Reusable values you can reference anywhere in the config with `$Var().variableName`.
46
+ *
47
+ * ---
48
+ *
49
+ * Useful for avoiding repetition. For example, define a shared environment name
50
+ * and reference it in multiple resources.
51
+ *
52
+ * ```yaml
53
+ * variables:
54
+ * appPort: 3000
55
+ * # Then use: $Var().appPort
56
+ * ```
57
+ */
58
+ variables?: { [variableName: string]: any };
59
+ /**
60
+ * #### Run scripts automatically before/after deploy, delete, or dev commands.
61
+ *
62
+ * ---
63
+ *
64
+ * Each hook references a script defined in the `scripts` section.
65
+ * Common uses: run database migrations after deploy, build frontend before deploy,
66
+ * clean up resources after delete.
67
+ */
68
+ hooks?: Hooks;
69
+ /**
70
+ * #### Custom shell commands or code you can run manually or as lifecycle hooks.
71
+ *
72
+ * ---
73
+ *
74
+ * Use `connectTo` in a script to auto-inject database URLs, API keys, etc. as environment variables.
75
+ * Run scripts with `stacktape script:run --scriptName myScript` or attach them to `hooks`.
76
+ *
77
+ * **Script types:**
78
+ * - **`local-script`**: Runs on your machine (or CI). Good for migrations, builds, seed scripts.
79
+ * - **`local-script-with-bastion-tunneling`**: Runs locally but tunnels connections to VPC-only
80
+ * resources (e.g., private databases) through a bastion host.
81
+ * - **`bastion-script`**: Runs remotely on the bastion host inside your VPC.
82
+ *
83
+ * Scripts can be shell commands or JS/TS/Python files.
84
+ */
85
+ scripts?: { [scriptName: string]: LocalScript | BastionScript | LocalScriptWithBastionTunneling };
86
+ /**
87
+ * #### Register custom functions that dynamically compute config values at deploy time.
88
+ *
89
+ * ---
90
+ *
91
+ * Define a directive by pointing to a JS/TS/Python file, then use it anywhere in the config
92
+ * like a built-in directive (`$MyDirective()`). Useful for fetching external data,
93
+ * computing dynamic values, or conditional logic.
94
+ */
95
+ directives?: DirectiveDefinition[];
96
+ /**
97
+ * #### Advanced deployment settings: rollback behavior, termination protection, artifact retention.
98
+ *
99
+ * ---
100
+ *
101
+ * Most projects don't need to change these. Useful for production stacks where you want
102
+ * extra safety (termination protection, rollback alarms) or cost control (artifact cleanup).
103
+ */
104
+ deploymentConfig?: DeploymentConfig;
105
+ /**
106
+ * #### Stack-wide settings: custom outputs, tags, VPC configuration, and stack info saving.
107
+ */
108
+ stackConfig?: StackConfig;
109
+ /**
110
+ * #### Your app's infrastructure: APIs, databases, containers, functions, buckets, and more.
111
+ *
112
+ * ---
113
+ *
114
+ * Each entry is a named resource (e.g., `myApi`, `myDatabase`). Stacktape creates and manages
115
+ * the underlying AWS resources for you. Use `stacktape stack-info --detailed` to inspect them.
116
+ */
117
+ resources: { [resourceName: string]: StacktapeResourceDefinition };
118
+ /**
119
+ * #### Escape hatch: add raw AWS CloudFormation resources alongside Stacktape-managed ones.
120
+ *
121
+ * ---
122
+ *
123
+ * For advanced use cases where Stacktape doesn't have a built-in resource type.
124
+ * These are merged into the CloudFormation template as-is. Use `stacktape stack-info --detailed`
125
+ * to check existing logical names and avoid conflicts.
126
+ *
127
+ * Does not count towards your resource limit.
128
+ */
129
+ cloudformationResources?: { [resourceName: string]: CloudformationResource };
130
+ }
131
+ ```