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.
- package/.tsconfig.bun-build.json +1 -0
- package/ai-docs/cli-ref/aws-profile-create.md +22 -0
- package/ai-docs/cli-ref/aws-profile-delete.md +22 -0
- package/ai-docs/cli-ref/aws-profile-list.md +20 -0
- package/ai-docs/cli-ref/aws-profile-update.md +22 -0
- package/ai-docs/cli-ref/bastion-session.md +29 -0
- package/ai-docs/cli-ref/bastion-tunnel.md +30 -0
- package/ai-docs/cli-ref/bucket-sync.md +30 -0
- package/ai-docs/cli-ref/cf-module-update.md +26 -0
- package/ai-docs/cli-ref/cf-rollback.md +28 -0
- package/ai-docs/cli-ref/codebuild-deploy.md +34 -0
- package/ai-docs/cli-ref/compile-template.md +25 -0
- package/ai-docs/cli-ref/container-session.md +30 -0
- package/ai-docs/cli-ref/debug-alarms.md +28 -0
- package/ai-docs/cli-ref/debug-aws-sdk.md +33 -0
- package/ai-docs/cli-ref/debug-container-exec.md +36 -0
- package/ai-docs/cli-ref/debug-dynamodb.md +35 -0
- package/ai-docs/cli-ref/debug-logs.md +34 -0
- package/ai-docs/cli-ref/debug-metrics.md +33 -0
- package/ai-docs/cli-ref/debug-opensearch.md +35 -0
- package/ai-docs/cli-ref/debug-redis.md +36 -0
- package/ai-docs/cli-ref/debug-sql.md +35 -0
- package/ai-docs/cli-ref/defaults-configure.md +29 -0
- package/ai-docs/cli-ref/defaults-list.md +20 -0
- package/ai-docs/cli-ref/delete.md +24 -0
- package/ai-docs/cli-ref/deploy.md +25 -0
- package/ai-docs/cli-ref/deployment-script-run.md +28 -0
- package/ai-docs/cli-ref/dev-stop.md +26 -0
- package/ai-docs/cli-ref/dev.md +45 -0
- package/ai-docs/cli-ref/domain-add.md +26 -0
- package/ai-docs/cli-ref/help.md +18 -0
- package/ai-docs/cli-ref/info-operations.md +22 -0
- package/ai-docs/cli-ref/info-stack.md +30 -0
- package/ai-docs/cli-ref/info-stacks.md +26 -0
- package/ai-docs/cli-ref/info-whoami.md +22 -0
- package/ai-docs/cli-ref/init.md +30 -0
- package/ai-docs/cli-ref/login.md +20 -0
- package/ai-docs/cli-ref/logout.md +18 -0
- package/ai-docs/cli-ref/mcp-add.md +22 -0
- package/ai-docs/cli-ref/mcp.md +20 -0
- package/ai-docs/cli-ref/org-create.md +24 -0
- package/ai-docs/cli-ref/org-delete.md +24 -0
- package/ai-docs/cli-ref/org-list.md +22 -0
- package/ai-docs/cli-ref/package-workloads.md +25 -0
- package/ai-docs/cli-ref/param-get.md +26 -0
- package/ai-docs/cli-ref/preview-changes.md +23 -0
- package/ai-docs/cli-ref/project-create.md +22 -0
- package/ai-docs/cli-ref/projects-list.md +22 -0
- package/ai-docs/cli-ref/rollback.md +28 -0
- package/ai-docs/cli-ref/script-run.md +29 -0
- package/ai-docs/cli-ref/secret-create.md +28 -0
- package/ai-docs/cli-ref/secret-delete.md +26 -0
- package/ai-docs/cli-ref/secret-get.md +26 -0
- package/ai-docs/cli-ref/upgrade.md +20 -0
- package/ai-docs/cli-ref/version.md +18 -0
- package/ai-docs/concept/connecting-resources.md +369 -0
- package/ai-docs/concept/directives.md +371 -0
- package/ai-docs/concept/extending-cloudformation.md +315 -0
- package/ai-docs/concept/overrides-and-transforms.md +352 -0
- package/ai-docs/concept/stages-and-environments.md +347 -0
- package/ai-docs/concept/typescript-config.md +447 -0
- package/ai-docs/concept/yaml-config.md +338 -0
- package/ai-docs/config-ref/_root.md +142 -0
- package/ai-docs/config-ref/application-load-balancer.md +1109 -0
- package/ai-docs/config-ref/astro-web.md +115 -0
- package/ai-docs/config-ref/aws-cdk-construct.md +68 -0
- package/ai-docs/config-ref/bastion.md +93 -0
- package/ai-docs/config-ref/batch-job.md +179 -0
- package/ai-docs/config-ref/bucket.md +348 -0
- package/ai-docs/config-ref/cdn.md +496 -0
- package/ai-docs/config-ref/custom-resource.md +80 -0
- package/ai-docs/config-ref/deployment-script.md +79 -0
- package/ai-docs/config-ref/dynamo-db-table.md +202 -0
- package/ai-docs/config-ref/edge-lambda-function.md +87 -0
- package/ai-docs/config-ref/efs-filesystem.md +72 -0
- package/ai-docs/config-ref/event-bus.md +63 -0
- package/ai-docs/config-ref/function.md +409 -0
- package/ai-docs/config-ref/hosting-bucket.md +171 -0
- package/ai-docs/config-ref/http-api-gateway.md +149 -0
- package/ai-docs/config-ref/http-endpoint.md +92 -0
- package/ai-docs/config-ref/kinesis-stream.md +97 -0
- package/ai-docs/config-ref/mongo-db-atlas-cluster.md +254 -0
- package/ai-docs/config-ref/multi-container-workload.md +399 -0
- package/ai-docs/config-ref/network-load-balancer.md +118 -0
- package/ai-docs/config-ref/nextjs-web.md +147 -0
- package/ai-docs/config-ref/nuxt-web.md +81 -0
- package/ai-docs/config-ref/open-search.md +206 -0
- package/ai-docs/config-ref/private-service.md +75 -0
- package/ai-docs/config-ref/redis-cluster.md +223 -0
- package/ai-docs/config-ref/relational-database.md +525 -0
- package/ai-docs/config-ref/remix-web.md +74 -0
- package/ai-docs/config-ref/sns-topic.md +69 -0
- package/ai-docs/config-ref/solidstart-web.md +75 -0
- package/ai-docs/config-ref/sqs-queue-not-empty.md +405 -0
- package/ai-docs/config-ref/sqs-queue.md +232 -0
- package/ai-docs/config-ref/state-machine.md +235 -0
- package/ai-docs/config-ref/sveltekit-web.md +81 -0
- package/ai-docs/config-ref/tanstack-web.md +75 -0
- package/ai-docs/config-ref/upstash-redis.md +59 -0
- package/ai-docs/config-ref/user-auth-pool.md +876 -0
- package/ai-docs/config-ref/web-app-firewall.md +212 -0
- package/ai-docs/config-ref/web-service.md +178 -0
- package/ai-docs/config-ref/worker-service.md +41 -0
- package/ai-docs/getting-started/console.md +232 -0
- package/ai-docs/getting-started/deployment.md +434 -0
- package/ai-docs/getting-started/dev-mode.md +118 -0
- package/ai-docs/getting-started/how-it-works.md +119 -0
- package/ai-docs/getting-started/intro.md +157 -0
- package/ai-docs/getting-started/using-with-ai.md +228 -0
- package/ai-docs/getting-started/workflow.md +197 -0
- package/ai-docs/index.json +1514 -0
- package/ai-docs/recipe/background-jobs.md +183 -0
- package/ai-docs/recipe/database-migrations.md +240 -0
- package/ai-docs/recipe/graphql-api.md +211 -0
- package/ai-docs/recipe/monorepo-setup.md +183 -0
- package/ai-docs/recipe/nextjs-full-stack.md +188 -0
- package/ai-docs/recipe/rest-api-with-database.md +156 -0
- package/ai-docs/recipe/scheduled-tasks.md +186 -0
- package/ai-docs/recipe/static-website.md +241 -0
- package/ai-docs/troubleshooting/cloudformation-stack-states.md +189 -0
- package/bin/stacktape.js +206 -41
- package/package.json +1 -1
- package/plain.d.ts +309 -54
|
@@ -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,142 @@
|
|
|
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
|
+
* #### Set a monthly spending limit and get email alerts when costs approach it.
|
|
61
|
+
*
|
|
62
|
+
* ---
|
|
63
|
+
*
|
|
64
|
+
* The budget resets at the start of each calendar month. You can configure alerts
|
|
65
|
+
* based on actual spend or AWS-forecasted spend.
|
|
66
|
+
*
|
|
67
|
+
* > Not available in all regions (e.g., `ap-east-1`, `af-south-1`).
|
|
68
|
+
*/
|
|
69
|
+
budgetControl?: BudgetControl;
|
|
70
|
+
/**
|
|
71
|
+
* #### Run scripts automatically before/after deploy, delete, or dev commands.
|
|
72
|
+
*
|
|
73
|
+
* ---
|
|
74
|
+
*
|
|
75
|
+
* Each hook references a script defined in the `scripts` section.
|
|
76
|
+
* Common uses: run database migrations after deploy, build frontend before deploy,
|
|
77
|
+
* clean up resources after delete.
|
|
78
|
+
*/
|
|
79
|
+
hooks?: Hooks;
|
|
80
|
+
/**
|
|
81
|
+
* #### Custom shell commands or code you can run manually or as lifecycle hooks.
|
|
82
|
+
*
|
|
83
|
+
* ---
|
|
84
|
+
*
|
|
85
|
+
* Use `connectTo` in a script to auto-inject database URLs, API keys, etc. as environment variables.
|
|
86
|
+
* Run scripts with `stacktape script:run --scriptName myScript` or attach them to `hooks`.
|
|
87
|
+
*
|
|
88
|
+
* **Script types:**
|
|
89
|
+
* - **`local-script`**: Runs on your machine (or CI). Good for migrations, builds, seed scripts.
|
|
90
|
+
* - **`local-script-with-bastion-tunneling`**: Runs locally but tunnels connections to VPC-only
|
|
91
|
+
* resources (e.g., private databases) through a bastion host.
|
|
92
|
+
* - **`bastion-script`**: Runs remotely on the bastion host inside your VPC.
|
|
93
|
+
*
|
|
94
|
+
* Scripts can be shell commands or JS/TS/Python files.
|
|
95
|
+
*/
|
|
96
|
+
scripts?: { [scriptName: string]: LocalScript | BastionScript | LocalScriptWithBastionTunneling };
|
|
97
|
+
/**
|
|
98
|
+
* #### Register custom functions that dynamically compute config values at deploy time.
|
|
99
|
+
*
|
|
100
|
+
* ---
|
|
101
|
+
*
|
|
102
|
+
* Define a directive by pointing to a JS/TS/Python file, then use it anywhere in the config
|
|
103
|
+
* like a built-in directive (`$MyDirective()`). Useful for fetching external data,
|
|
104
|
+
* computing dynamic values, or conditional logic.
|
|
105
|
+
*/
|
|
106
|
+
directives?: DirectiveDefinition[];
|
|
107
|
+
/**
|
|
108
|
+
* #### Advanced deployment settings: rollback behavior, termination protection, artifact retention.
|
|
109
|
+
*
|
|
110
|
+
* ---
|
|
111
|
+
*
|
|
112
|
+
* Most projects don't need to change these. Useful for production stacks where you want
|
|
113
|
+
* extra safety (termination protection, rollback alarms) or cost control (artifact cleanup).
|
|
114
|
+
*/
|
|
115
|
+
deploymentConfig?: DeploymentConfig;
|
|
116
|
+
/**
|
|
117
|
+
* #### Stack-wide settings: custom outputs, tags, VPC configuration, and stack info saving.
|
|
118
|
+
*/
|
|
119
|
+
stackConfig?: StackConfig;
|
|
120
|
+
/**
|
|
121
|
+
* #### Your app's infrastructure: APIs, databases, containers, functions, buckets, and more.
|
|
122
|
+
*
|
|
123
|
+
* ---
|
|
124
|
+
*
|
|
125
|
+
* Each entry is a named resource (e.g., `myApi`, `myDatabase`). Stacktape creates and manages
|
|
126
|
+
* the underlying AWS resources for you. Use `stacktape stack-info --detailed` to inspect them.
|
|
127
|
+
*/
|
|
128
|
+
resources: { [resourceName: string]: StacktapeResourceDefinition };
|
|
129
|
+
/**
|
|
130
|
+
* #### Escape hatch: add raw AWS CloudFormation resources alongside Stacktape-managed ones.
|
|
131
|
+
*
|
|
132
|
+
* ---
|
|
133
|
+
*
|
|
134
|
+
* For advanced use cases where Stacktape doesn't have a built-in resource type.
|
|
135
|
+
* These are merged into the CloudFormation template as-is. Use `stacktape stack-info --detailed`
|
|
136
|
+
* to check existing logical names and avoid conflicts.
|
|
137
|
+
*
|
|
138
|
+
* Does not count towards your resource limit.
|
|
139
|
+
*/
|
|
140
|
+
cloudformationResources?: { [resourceName: string]: CloudformationResource };
|
|
141
|
+
}
|
|
142
|
+
```
|