stacktape 3.5.8 → 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 +0 -12
- package/package.json +1 -1
- package/plain.d.ts +309 -54
|
@@ -0,0 +1,496 @@
|
|
|
1
|
+
---
|
|
2
|
+
docType: config-ref
|
|
3
|
+
title: Cdn Configuration
|
|
4
|
+
resourceType: cdn
|
|
5
|
+
tags:
|
|
6
|
+
- cdn
|
|
7
|
+
- cloudfront
|
|
8
|
+
- distribution
|
|
9
|
+
source: types/stacktape-config/cdn.d.ts
|
|
10
|
+
priority: 1
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
# Cdn Configuration
|
|
14
|
+
|
|
15
|
+
Resource type: `cdn`
|
|
16
|
+
|
|
17
|
+
## TypeScript Definition
|
|
18
|
+
|
|
19
|
+
```typescript
|
|
20
|
+
interface CdnConfiguration {
|
|
21
|
+
/**
|
|
22
|
+
* #### Enable CDN (CloudFront) for faster global delivery and lower bandwidth costs.
|
|
23
|
+
*
|
|
24
|
+
* ---
|
|
25
|
+
*
|
|
26
|
+
* Caches responses at edge locations worldwide so users get content from the nearest server.
|
|
27
|
+
* The CDN itself has no monthly fee — you pay per request (~$0.01/10k) and per GB transferred.
|
|
28
|
+
*
|
|
29
|
+
* @default false
|
|
30
|
+
*/
|
|
31
|
+
enabled: boolean;
|
|
32
|
+
/**
|
|
33
|
+
* #### Control how long and what gets cached at the CDN edge.
|
|
34
|
+
*
|
|
35
|
+
* ---
|
|
36
|
+
*
|
|
37
|
+
* When the origin response has no `Cache-Control` header, defaults apply:
|
|
38
|
+
* - **Bucket origins**: cached for 6 months (or until invalidated on deploy).
|
|
39
|
+
* - **API Gateway / Load Balancer origins**: not cached.
|
|
40
|
+
*/
|
|
41
|
+
cachingOptions?: CdnCachingOptions;
|
|
42
|
+
/**
|
|
43
|
+
* #### Control which headers, cookies, and query params are forwarded to your origin.
|
|
44
|
+
*
|
|
45
|
+
* ---
|
|
46
|
+
*
|
|
47
|
+
* By default, all headers/cookies/query params are forwarded. Use this to restrict
|
|
48
|
+
* what reaches your app (e.g., strip cookies for static content).
|
|
49
|
+
*/
|
|
50
|
+
forwardingOptions?: CdnForwardingOptions;
|
|
51
|
+
/**
|
|
52
|
+
* #### Route specific URL patterns to different origins (e.g., `/api/*` → Lambda, `/assets/*` → S3).
|
|
53
|
+
*
|
|
54
|
+
* ---
|
|
55
|
+
*
|
|
56
|
+
* Evaluated in order; first match wins. Unmatched requests go to the default origin.
|
|
57
|
+
* Each route can have its own caching and forwarding settings.
|
|
58
|
+
*/
|
|
59
|
+
routeRewrites?: CdnRouteRewrite[];
|
|
60
|
+
/**
|
|
61
|
+
* #### Custom domains (e.g., `cdn.example.com`). Stacktape auto-creates DNS records and TLS certificates.
|
|
62
|
+
*
|
|
63
|
+
* ---
|
|
64
|
+
*
|
|
65
|
+
* Your domain must be added as a Route53 hosted zone in your AWS account first.
|
|
66
|
+
*/
|
|
67
|
+
customDomains?: DomainConfiguration[];
|
|
68
|
+
/**
|
|
69
|
+
* #### Run edge functions on CDN requests/responses (URL rewrites, auth, A/B testing).
|
|
70
|
+
*
|
|
71
|
+
* ---
|
|
72
|
+
*
|
|
73
|
+
* - `onRequest`: Before cache lookup — modify the request, add auth, or return early.
|
|
74
|
+
* - `onResponse`: Before returning to the client — modify headers, add cookies.
|
|
75
|
+
*/
|
|
76
|
+
edgeFunctions?: EdgeFunctionsConfig;
|
|
77
|
+
/**
|
|
78
|
+
* #### Which regions the CDN serves from. Fewer regions = lower cost, but slower for distant users.
|
|
79
|
+
*
|
|
80
|
+
* ---
|
|
81
|
+
*
|
|
82
|
+
* - **`PriceClass_100`**: North America + Europe. Cheapest option. Good if your users are in the US/EU.
|
|
83
|
+
* - **`PriceClass_200`**: Adds Asia, Middle East, Africa.
|
|
84
|
+
* - **`PriceClass_All`** (default): All regions worldwide, including South America and Oceania.
|
|
85
|
+
*
|
|
86
|
+
* The CDN itself has no monthly base cost - you only pay per request and per GB transferred.
|
|
87
|
+
* The price class controls which edge locations are used, and some regions cost more per request.
|
|
88
|
+
*
|
|
89
|
+
* @default PriceClass_All
|
|
90
|
+
*/
|
|
91
|
+
cloudfrontPriceClass?: 'PriceClass_100' | 'PriceClass_200' | 'PriceClass_All';
|
|
92
|
+
/**
|
|
93
|
+
* #### Prepend a path prefix to all requests forwarded to the origin.
|
|
94
|
+
*
|
|
95
|
+
* ---
|
|
96
|
+
*
|
|
97
|
+
* E.g., with prefix `/v2`, a request for `/users` is forwarded to the origin as `/v2/users`.
|
|
98
|
+
*/
|
|
99
|
+
defaultRoutePrefix?: string;
|
|
100
|
+
/**
|
|
101
|
+
* #### Page to show for 404 errors (e.g., `/error.html`).
|
|
102
|
+
* @default /404.html
|
|
103
|
+
*/
|
|
104
|
+
errorDocument?: string;
|
|
105
|
+
/**
|
|
106
|
+
* #### Page served for requests to `/`.
|
|
107
|
+
* @default /index.html
|
|
108
|
+
*/
|
|
109
|
+
indexDocument?: string;
|
|
110
|
+
/**
|
|
111
|
+
* #### Skip clearing the CDN cache after each deploy.
|
|
112
|
+
*
|
|
113
|
+
* ---
|
|
114
|
+
*
|
|
115
|
+
* By default, all cached content is flushed on every deploy so users see the latest version.
|
|
116
|
+
* Set to `true` if you manage cache invalidation yourself or want to keep cached content between deploys.
|
|
117
|
+
*
|
|
118
|
+
* @default false
|
|
119
|
+
*/
|
|
120
|
+
disableInvalidationAfterDeploy?: boolean;
|
|
121
|
+
/**
|
|
122
|
+
* #### Name of a `web-app-firewall` resource to protect this CDN from common web exploits.
|
|
123
|
+
*/
|
|
124
|
+
useFirewall?: string;
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
interface EdgeFunctionsConfig {
|
|
128
|
+
/**
|
|
129
|
+
* #### Name of an `edge-lambda-function` to run when the CDN receives a request (before cache lookup).
|
|
130
|
+
*
|
|
131
|
+
* ---
|
|
132
|
+
*
|
|
133
|
+
* Use to modify the request, add auth checks, or return an immediate response without hitting the origin.
|
|
134
|
+
*/
|
|
135
|
+
onRequest?: string;
|
|
136
|
+
/**
|
|
137
|
+
* #### Name of an `edge-lambda-function` to run before returning the response to the client.
|
|
138
|
+
*
|
|
139
|
+
* ---
|
|
140
|
+
*
|
|
141
|
+
* Use to modify response headers, add security headers, or set cookies.
|
|
142
|
+
* Does not run if the origin returned a 400+ error or if `onRequest` already generated a response.
|
|
143
|
+
*/
|
|
144
|
+
onResponse?: string;
|
|
145
|
+
/**
|
|
146
|
+
* #### Name of an `edge-lambda-function` to run before forwarding to the origin (after cache miss).
|
|
147
|
+
*
|
|
148
|
+
* ---
|
|
149
|
+
*
|
|
150
|
+
* Only runs on cache misses. Use to modify the request before it reaches your origin.
|
|
151
|
+
*
|
|
152
|
+
* > **Warning:** Stacktape uses this trigger internally for bucket/web-service/API Gateway CDN setups.
|
|
153
|
+
* > Overriding it may break default behavior. Only use if you know what you're doing.
|
|
154
|
+
*/
|
|
155
|
+
onOriginRequest?: string;
|
|
156
|
+
/**
|
|
157
|
+
* #### Name of an `edge-lambda-function` to run after the origin responds (before caching).
|
|
158
|
+
*
|
|
159
|
+
* ---
|
|
160
|
+
*
|
|
161
|
+
* Modify the response before it's cached and returned. Changes are cached as if they came from the origin.
|
|
162
|
+
*/
|
|
163
|
+
onOriginResponse?: string;
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
interface CdnRouteRewrite {
|
|
167
|
+
/**
|
|
168
|
+
* #### URL path pattern to match (e.g., `/api/*`, `*.jpg`, `/docs/v2/*`). Wildcards supported.
|
|
169
|
+
*/
|
|
170
|
+
path: string;
|
|
171
|
+
/**
|
|
172
|
+
* #### Prepend a path prefix to requests before forwarding to the origin.
|
|
173
|
+
*
|
|
174
|
+
* ---
|
|
175
|
+
*
|
|
176
|
+
* E.g., with prefix `/v2`, a request for `/users` is forwarded as `/v2/users`.
|
|
177
|
+
*/
|
|
178
|
+
routePrefix?: string;
|
|
179
|
+
/**
|
|
180
|
+
* #### Where to send matching requests. Can be a bucket, API Gateway, load balancer, Lambda, or external domain.
|
|
181
|
+
*
|
|
182
|
+
* ---
|
|
183
|
+
*
|
|
184
|
+
* If not set, requests go to the default origin (the resource this CDN is attached to).
|
|
185
|
+
*/
|
|
186
|
+
routeTo?:
|
|
187
|
+
| CdnLoadBalancerRoute
|
|
188
|
+
| CdnHttpApiGatewayRoute
|
|
189
|
+
| CdnBucketRoute
|
|
190
|
+
| CdnCustomDomainRoute
|
|
191
|
+
| CdnLambdaFunctionRoute; // | CdnWebServiceRoute;
|
|
192
|
+
/**
|
|
193
|
+
* #### Override caching behavior for requests matching this route.
|
|
194
|
+
*/
|
|
195
|
+
cachingOptions?: CdnCachingOptions;
|
|
196
|
+
/**
|
|
197
|
+
* #### Override which headers, cookies, and query params are forwarded for this route.
|
|
198
|
+
*/
|
|
199
|
+
forwardingOptions?: CdnForwardingOptions;
|
|
200
|
+
/**
|
|
201
|
+
* #### Run edge functions on requests/responses matching this route.
|
|
202
|
+
*/
|
|
203
|
+
edgeFunctions?: EdgeFunctionsConfig;
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
interface CdnLoadBalancerRoute {
|
|
207
|
+
type: 'application-load-balancer';
|
|
208
|
+
properties: CdnLoadBalancerOrigin;
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
interface CdnLoadBalancerOrigin {
|
|
212
|
+
/**
|
|
213
|
+
* #### Name of the `application-load-balancer` resource to route to.
|
|
214
|
+
*/
|
|
215
|
+
loadBalancerName: string;
|
|
216
|
+
/**
|
|
217
|
+
* #### Listener port on the load balancer. Only needed if using custom listeners.
|
|
218
|
+
*/
|
|
219
|
+
listenerPort?: number;
|
|
220
|
+
/**
|
|
221
|
+
* #### Explicit origin domain. Only needed if the ALB has no `customDomains` and uses `customCertificateArns`.
|
|
222
|
+
*/
|
|
223
|
+
originDomainName?: string;
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
interface CdnHttpApiGatewayRoute {
|
|
227
|
+
type: 'http-api-gateway';
|
|
228
|
+
properties: CdnHttpApiGatewayOrigin;
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
interface CdnHttpApiGatewayOrigin {
|
|
232
|
+
/**
|
|
233
|
+
* #### Name of the `http-api-gateway` resource to route to.
|
|
234
|
+
*/
|
|
235
|
+
httpApiGatewayName: string;
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
interface CdnLambdaFunctionRoute {
|
|
239
|
+
type: 'function';
|
|
240
|
+
properties: CdnLambdaFunctionOrigin;
|
|
241
|
+
}
|
|
242
|
+
|
|
243
|
+
interface CdnLambdaFunctionOrigin {
|
|
244
|
+
/**
|
|
245
|
+
* #### Name of the `function` resource to route to. The function must have `url.enabled: true`.
|
|
246
|
+
*/
|
|
247
|
+
functionName: string;
|
|
248
|
+
}
|
|
249
|
+
|
|
250
|
+
interface CdnCustomDomainRoute {
|
|
251
|
+
type: 'custom-origin';
|
|
252
|
+
properties: CdnCustomOrigin;
|
|
253
|
+
}
|
|
254
|
+
|
|
255
|
+
interface CdnCustomOrigin {
|
|
256
|
+
/**
|
|
257
|
+
* #### Domain name of the external origin (e.g., `api.example.com`).
|
|
258
|
+
*/
|
|
259
|
+
domainName: string;
|
|
260
|
+
/**
|
|
261
|
+
* #### Protocol for connecting to the origin.
|
|
262
|
+
* @default HTTPS
|
|
263
|
+
*/
|
|
264
|
+
protocol?: 'HTTP' | 'HTTPS';
|
|
265
|
+
/**
|
|
266
|
+
* #### Port on the origin. Defaults to 443 for HTTPS, 80 for HTTP.
|
|
267
|
+
*/
|
|
268
|
+
port?: number;
|
|
269
|
+
}
|
|
270
|
+
|
|
271
|
+
interface CdnBucketRoute {
|
|
272
|
+
type: 'bucket';
|
|
273
|
+
properties: CdnBucketOrigin;
|
|
274
|
+
}
|
|
275
|
+
|
|
276
|
+
interface CdnBucketOrigin {
|
|
277
|
+
/**
|
|
278
|
+
* #### Name of the `bucket` resource to route to.
|
|
279
|
+
*/
|
|
280
|
+
bucketName: string;
|
|
281
|
+
/**
|
|
282
|
+
* #### Disable clean URL normalization (e.g., `/about` → `/about.html`).
|
|
283
|
+
* @default false
|
|
284
|
+
*/
|
|
285
|
+
disableUrlNormalization?: boolean;
|
|
286
|
+
}
|
|
287
|
+
|
|
288
|
+
interface CdnResponseHeader {
|
|
289
|
+
/**
|
|
290
|
+
* #### Name of the header
|
|
291
|
+
*/
|
|
292
|
+
headerName: string;
|
|
293
|
+
/**
|
|
294
|
+
* #### Value of the header
|
|
295
|
+
*/
|
|
296
|
+
value: string;
|
|
297
|
+
}
|
|
298
|
+
|
|
299
|
+
interface CdnCachingOptions {
|
|
300
|
+
/**
|
|
301
|
+
* #### HTTP methods to cache. Use `['GET', 'HEAD', 'OPTIONS']` if your API uses CORS preflight.
|
|
302
|
+
*/
|
|
303
|
+
cacheMethods?: ('GET' | 'HEAD' | 'OPTIONS')[];
|
|
304
|
+
/**
|
|
305
|
+
* #### Minimum cache time (seconds). Overrides `Cache-Control: max-age` if the origin sets a lower value.
|
|
306
|
+
*/
|
|
307
|
+
minTTL?: number;
|
|
308
|
+
/**
|
|
309
|
+
* #### Maximum cache time (seconds). Caps how long the CDN caches content, even if the origin says longer.
|
|
310
|
+
*/
|
|
311
|
+
maxTTL?: number;
|
|
312
|
+
/**
|
|
313
|
+
* #### Default cache time (seconds). Used when the origin response has no `Cache-Control` or `Expires` header.
|
|
314
|
+
*/
|
|
315
|
+
defaultTTL?: number;
|
|
316
|
+
/**
|
|
317
|
+
* #### Disable automatic Gzip/Brotli compression. Compression is on by default and reduces transfer size/cost.
|
|
318
|
+
* @default false
|
|
319
|
+
*/
|
|
320
|
+
disableCompression?: boolean;
|
|
321
|
+
/**
|
|
322
|
+
* #### Which headers, cookies, and query params make responses unique in the cache.
|
|
323
|
+
*
|
|
324
|
+
* ---
|
|
325
|
+
*
|
|
326
|
+
* Defaults: **Bucket** = URL path only. **API/ALB** = URL path + query string.
|
|
327
|
+
* Values included in the cache key are always forwarded to the origin.
|
|
328
|
+
*/
|
|
329
|
+
cacheKeyParameters?: CdnCacheKey;
|
|
330
|
+
/**
|
|
331
|
+
* #### Use a pre-existing AWS cache policy ID instead of configuring TTL and cache key options here.
|
|
332
|
+
*/
|
|
333
|
+
cachePolicyId?: string;
|
|
334
|
+
}
|
|
335
|
+
|
|
336
|
+
interface CdnCacheKey {
|
|
337
|
+
/**
|
|
338
|
+
* #### Which cookies to include in the cache key. Different cookie values = different cached responses.
|
|
339
|
+
*/
|
|
340
|
+
cookies?: CacheKeyCookies;
|
|
341
|
+
/**
|
|
342
|
+
* #### Which headers to include in the cache key. Different header values = different cached responses.
|
|
343
|
+
*/
|
|
344
|
+
headers?: CacheKeyHeaders;
|
|
345
|
+
/**
|
|
346
|
+
* #### Which query params to include in the cache key. Different param values = different cached responses.
|
|
347
|
+
*/
|
|
348
|
+
queryString?: CacheKeyQueryString;
|
|
349
|
+
}
|
|
350
|
+
|
|
351
|
+
interface CacheKeyCookies {
|
|
352
|
+
/**
|
|
353
|
+
* #### No cookies are included in the cache key.
|
|
354
|
+
*/
|
|
355
|
+
none?: boolean;
|
|
356
|
+
/**
|
|
357
|
+
* #### Only the listed cookies are included in the cache key.
|
|
358
|
+
*/
|
|
359
|
+
whitelist?: string[];
|
|
360
|
+
/**
|
|
361
|
+
* #### All cookies except the listed ones are included in the cache key.
|
|
362
|
+
*/
|
|
363
|
+
allExcept?: string[];
|
|
364
|
+
/**
|
|
365
|
+
* #### All cookies are included in the cache key.
|
|
366
|
+
*/
|
|
367
|
+
all?: boolean;
|
|
368
|
+
}
|
|
369
|
+
|
|
370
|
+
interface CacheKeyHeaders {
|
|
371
|
+
/**
|
|
372
|
+
* #### No headers are included in the cache key.
|
|
373
|
+
*/
|
|
374
|
+
none?: boolean;
|
|
375
|
+
/**
|
|
376
|
+
* #### Only the listed headers are included in the cache key.
|
|
377
|
+
*/
|
|
378
|
+
whitelist?: string[];
|
|
379
|
+
}
|
|
380
|
+
|
|
381
|
+
interface CacheKeyQueryString {
|
|
382
|
+
/**
|
|
383
|
+
* #### All query parameters are included in the cache key.
|
|
384
|
+
*/
|
|
385
|
+
all?: boolean;
|
|
386
|
+
/**
|
|
387
|
+
* #### No query parameters are included in the cache key.
|
|
388
|
+
*/
|
|
389
|
+
none?: boolean;
|
|
390
|
+
/**
|
|
391
|
+
* #### Only the listed query parameters are included in the cache key.
|
|
392
|
+
*/
|
|
393
|
+
whitelist?: string[];
|
|
394
|
+
}
|
|
395
|
+
|
|
396
|
+
interface CdnCustomRequestHeader {
|
|
397
|
+
/**
|
|
398
|
+
* #### Name of the header
|
|
399
|
+
*/
|
|
400
|
+
headerName: string;
|
|
401
|
+
/**
|
|
402
|
+
* #### Value of the header
|
|
403
|
+
*/
|
|
404
|
+
value: string;
|
|
405
|
+
}
|
|
406
|
+
|
|
407
|
+
interface CdnForwardingOptions {
|
|
408
|
+
/**
|
|
409
|
+
* #### Static headers the CDN adds to every request sent to the origin (e.g., API keys, custom identifiers).
|
|
410
|
+
*/
|
|
411
|
+
customRequestHeaders?: CdnCustomRequestHeader[];
|
|
412
|
+
/**
|
|
413
|
+
* #### HTTP methods forwarded to the origin. Default: all methods.
|
|
414
|
+
*/
|
|
415
|
+
allowedMethods?: ('GET' | 'HEAD' | 'OPTIONS' | 'PUT' | 'PATCH' | 'POST' | 'DELETE')[];
|
|
416
|
+
/**
|
|
417
|
+
* #### Which cookies to forward to the origin. Default: all cookies.
|
|
418
|
+
*
|
|
419
|
+
* ---
|
|
420
|
+
*
|
|
421
|
+
* Cookies in the cache key (see `cachingOptions`) are always forwarded regardless of this setting.
|
|
422
|
+
*/
|
|
423
|
+
cookies?: ForwardCookies;
|
|
424
|
+
/**
|
|
425
|
+
* #### Which headers to forward to the origin. Default: all headers.
|
|
426
|
+
*
|
|
427
|
+
* ---
|
|
428
|
+
*
|
|
429
|
+
* > The `Authorization` header must be added to `cachingOptions.cacheKeyParameters` to be forwarded.
|
|
430
|
+
*/
|
|
431
|
+
headers?: ForwardHeaders;
|
|
432
|
+
/**
|
|
433
|
+
* #### Which query params to forward to the origin. Default: all query params.
|
|
434
|
+
*/
|
|
435
|
+
queryString?: ForwardQueryString;
|
|
436
|
+
/**
|
|
437
|
+
* #### Use a pre-existing AWS origin request policy ID instead of configuring forwarding options here.
|
|
438
|
+
*/
|
|
439
|
+
originRequestPolicyId?: string;
|
|
440
|
+
}
|
|
441
|
+
|
|
442
|
+
interface ForwardCookies {
|
|
443
|
+
/**
|
|
444
|
+
* #### No cookies are forwarded to the origin.
|
|
445
|
+
*/
|
|
446
|
+
none?: boolean;
|
|
447
|
+
/**
|
|
448
|
+
* #### Only the listed cookies are forwarded to the origin.
|
|
449
|
+
*/
|
|
450
|
+
whitelist?: string[];
|
|
451
|
+
/**
|
|
452
|
+
* #### All cookies are forwarded to the origin.
|
|
453
|
+
*/
|
|
454
|
+
all?: boolean;
|
|
455
|
+
}
|
|
456
|
+
|
|
457
|
+
interface ForwardHeaders {
|
|
458
|
+
/**
|
|
459
|
+
* #### No headers are forwarded to the origin.
|
|
460
|
+
*/
|
|
461
|
+
none?: boolean;
|
|
462
|
+
/**
|
|
463
|
+
* #### Only the listed headers are forwarded to the origin.
|
|
464
|
+
*/
|
|
465
|
+
whitelist?: string[];
|
|
466
|
+
/**
|
|
467
|
+
* #### Forward all headers from the viewer's request.
|
|
468
|
+
*/
|
|
469
|
+
allViewer?: boolean;
|
|
470
|
+
/**
|
|
471
|
+
* #### Forward all viewer headers plus the listed CloudFront-specific headers (e.g., `CloudFront-Viewer-Country`).
|
|
472
|
+
*/
|
|
473
|
+
allViewerAndWhitelistCloudFront?: string[];
|
|
474
|
+
/**
|
|
475
|
+
* #### Forward all viewer headers except the listed ones.
|
|
476
|
+
*/
|
|
477
|
+
allExcept?: string[];
|
|
478
|
+
}
|
|
479
|
+
|
|
480
|
+
interface ForwardQueryString {
|
|
481
|
+
/**
|
|
482
|
+
* #### All query parameters are forwarded to the origin.
|
|
483
|
+
*/
|
|
484
|
+
all?: boolean;
|
|
485
|
+
/**
|
|
486
|
+
* #### No query parameters are forwarded to the origin.
|
|
487
|
+
*/
|
|
488
|
+
none?: boolean;
|
|
489
|
+
/**
|
|
490
|
+
* #### Only the listed query parameters are forwarded to the origin.
|
|
491
|
+
*/
|
|
492
|
+
whitelist?: string[];
|
|
493
|
+
}
|
|
494
|
+
|
|
495
|
+
type CdnReferenceableParam = 'cdnDomain' | 'cdnCustomDomains' | 'cdnUrl' | 'cdnCustomDomainUrls' | 'cdnCanonicalDomain';
|
|
496
|
+
```
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
---
|
|
2
|
+
docType: config-ref
|
|
3
|
+
title: Custom Resource Definition
|
|
4
|
+
resourceType: custom-resource
|
|
5
|
+
tags:
|
|
6
|
+
- custom-resource
|
|
7
|
+
- cloudformation-custom
|
|
8
|
+
source: types/stacktape-config/custom-resources.d.ts
|
|
9
|
+
priority: 1
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
# Custom Resource Definition
|
|
13
|
+
|
|
14
|
+
Lambda-backed provisioning logic for resources not natively supported by Stacktape/CloudFormation.
|
|
15
|
+
|
|
16
|
+
Your Lambda function runs on stack create, update, and delete events to manage external resources
|
|
17
|
+
(third-party APIs, SaaS services, custom infrastructure). Pair with `custom-resource-instance` to use.
|
|
18
|
+
|
|
19
|
+
Resource type: `custom-resource`
|
|
20
|
+
|
|
21
|
+
## TypeScript Definition
|
|
22
|
+
|
|
23
|
+
```typescript
|
|
24
|
+
/**
|
|
25
|
+
* #### Lambda-backed provisioning logic for resources not natively supported by Stacktape/CloudFormation.
|
|
26
|
+
*
|
|
27
|
+
* ---
|
|
28
|
+
*
|
|
29
|
+
* Your Lambda function runs on stack create, update, and delete events to manage external resources
|
|
30
|
+
* (third-party APIs, SaaS services, custom infrastructure). Pair with `custom-resource-instance` to use.
|
|
31
|
+
*/
|
|
32
|
+
interface CustomResourceDefinition {
|
|
33
|
+
type: 'custom-resource-definition';
|
|
34
|
+
properties: CustomResourceDefinitionProps;
|
|
35
|
+
overrides?: ResourceOverrides;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* #### An instance of a `custom-resource-definition`. Pass properties to the backing Lambda function.
|
|
40
|
+
*/
|
|
41
|
+
interface CustomResourceInstance {
|
|
42
|
+
type: 'custom-resource-instance';
|
|
43
|
+
properties: CustomResourceInstanceProps;
|
|
44
|
+
overrides?: ResourceOverrides;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
interface CustomResourceInstanceProps {
|
|
48
|
+
/**
|
|
49
|
+
* #### Name of the `custom-resource-definition` in your config that provides the backing Lambda.
|
|
50
|
+
*/
|
|
51
|
+
definitionName: string;
|
|
52
|
+
/**
|
|
53
|
+
* #### Key-value pairs passed to the Lambda function during create/update/delete events.
|
|
54
|
+
*/
|
|
55
|
+
resourceProperties: { [name: string]: any };
|
|
56
|
+
}
|
|
57
|
+
interface CustomResourceDefinitionProps extends ResourceAccessProps {
|
|
58
|
+
/**
|
|
59
|
+
* #### How the Lambda function code is packaged and deployed.
|
|
60
|
+
*/
|
|
61
|
+
packaging: LambdaPackaging;
|
|
62
|
+
/**
|
|
63
|
+
* #### Environment variables injected into the Lambda function. Use `$ResourceParam()` for dynamic values.
|
|
64
|
+
*/
|
|
65
|
+
environment?: EnvironmentVar[];
|
|
66
|
+
/**
|
|
67
|
+
* #### Lambda runtime. Auto-detected from file extension if not specified.
|
|
68
|
+
*/
|
|
69
|
+
runtime?: LambdaRuntime;
|
|
70
|
+
/**
|
|
71
|
+
* #### Max execution time in seconds. Max: 900.
|
|
72
|
+
* @default 10
|
|
73
|
+
*/
|
|
74
|
+
timeout?: number;
|
|
75
|
+
/**
|
|
76
|
+
* #### Memory in MB (128–10,240). CPU scales proportionally — 1,769 MB = 1 vCPU.
|
|
77
|
+
*/
|
|
78
|
+
memory?: number;
|
|
79
|
+
}
|
|
80
|
+
```
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
---
|
|
2
|
+
docType: config-ref
|
|
3
|
+
title: Deployment Script
|
|
4
|
+
resourceType: deployment-script
|
|
5
|
+
tags:
|
|
6
|
+
- deployment-script
|
|
7
|
+
- deploy-script
|
|
8
|
+
- migration-script
|
|
9
|
+
source: types/stacktape-config/deployment-script.d.ts
|
|
10
|
+
priority: 1
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
# Deployment Script
|
|
14
|
+
|
|
15
|
+
Run a script during deploy or delete — database migrations, seed data, cleanup tasks.
|
|
16
|
+
|
|
17
|
+
Executes as a Lambda function. Use `after:deploy` to run migrations after resources are ready,
|
|
18
|
+
or `before:delete` for cleanup. Can also be triggered manually with `stacktape deployment-script:run`.
|
|
19
|
+
|
|
20
|
+
Resource type: `deployment-script`
|
|
21
|
+
|
|
22
|
+
## TypeScript Definition
|
|
23
|
+
|
|
24
|
+
```typescript
|
|
25
|
+
/**
|
|
26
|
+
* #### Run a script during deploy or delete — database migrations, seed data, cleanup tasks.
|
|
27
|
+
*
|
|
28
|
+
* ---
|
|
29
|
+
*
|
|
30
|
+
* Executes as a Lambda function. Use `after:deploy` to run migrations after resources are ready,
|
|
31
|
+
* or `before:delete` for cleanup. Can also be triggered manually with `stacktape deployment-script:run`.
|
|
32
|
+
*/
|
|
33
|
+
interface DeploymentScript {
|
|
34
|
+
type: 'deployment-script';
|
|
35
|
+
properties: DeploymentScriptProps;
|
|
36
|
+
overrides?: ResourceOverrides;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
interface DeploymentScriptProps extends ResourceAccessProps {
|
|
40
|
+
/**
|
|
41
|
+
* #### When to run: `after:deploy` (fails → rollback) or `before:delete` (fails → deletion continues).
|
|
42
|
+
*/
|
|
43
|
+
trigger: 'after:deploy' | 'before:delete';
|
|
44
|
+
/**
|
|
45
|
+
* #### How the script code is packaged. Use `stacktape-lambda-buildpack` for auto-bundling.
|
|
46
|
+
*/
|
|
47
|
+
packaging: LambdaPackaging;
|
|
48
|
+
/**
|
|
49
|
+
* #### Lambda runtime. Auto-detected from file extension if not specified.
|
|
50
|
+
*/
|
|
51
|
+
runtime?: LambdaRuntime;
|
|
52
|
+
/**
|
|
53
|
+
* #### Environment variables injected at runtime. Use `$ResourceParam()` or `$Secret()` for dynamic values.
|
|
54
|
+
*/
|
|
55
|
+
environment?: EnvironmentVar[];
|
|
56
|
+
/**
|
|
57
|
+
* #### Structured data passed to the handler function as the event payload. Not for secrets — use `environment`.
|
|
58
|
+
*/
|
|
59
|
+
parameters?: { [name: string]: any };
|
|
60
|
+
/**
|
|
61
|
+
* #### Memory in MB (128–10,240). CPU scales proportionally — 1,769 MB = 1 vCPU.
|
|
62
|
+
*/
|
|
63
|
+
memory?: number;
|
|
64
|
+
/**
|
|
65
|
+
* #### Max execution time in seconds. Max: 900 (15 minutes).
|
|
66
|
+
* @default 10
|
|
67
|
+
*/
|
|
68
|
+
timeout?: number;
|
|
69
|
+
/**
|
|
70
|
+
* #### Connect to VPC resources (databases, Redis). **Warning:** function loses direct internet access.
|
|
71
|
+
*/
|
|
72
|
+
joinDefaultVpc?: boolean;
|
|
73
|
+
/**
|
|
74
|
+
* #### Ephemeral `/tmp` storage in MB (512–10,240).
|
|
75
|
+
* @default 512
|
|
76
|
+
*/
|
|
77
|
+
storage?: number;
|
|
78
|
+
}
|
|
79
|
+
```
|