Configuration reference
Every key gigadrive.yaml accepts, with its type, its default, and what the platform does with it.
The keys the v4 schema accepts, grouped by the block they belong to. Defaults are what you get when the key is absent, not what a generated file would contain. The keys are the same whether you write YAML, JSON or the executable form TypeScript configuration covers.
Top level
| Key | Type | Default | What it does |
|---|---|---|---|
version | integer, 4 only | none, required | Declares the config format. Must be a number, and 4 is the only accepted value |
assets | string | none | One directory whose files are published to the edge. See Assets |
functions | map of pattern to settings | {} | Turns matching files into Functions. See Entrypoints |
routes | list, 1024 at most | [] | Maps request paths onto those Functions. See Routes |
images | object | none | The image optimization policy. See Images |
services | object | none | Infrastructure the deployment provisions for itself |
env | map of string to string | {} | Accepted and not applied. See Environment variables |
build_commands | list of strings | [] | Accepted and not run. See Build commands |
populateAssetCache | boolean | false | Accepted and not read |
presets | list of strings | none | Accepted and not read |
env is validated at 100 keys at most, each value a string of 65536 characters at most, and then goes unused: no part of the build or the provisioning pipeline applies it, so a name written there appears in neither a build nor a running Function. Set variables with the console, the CLI or the API instead. Unknown keys at this level pass validation and are discarded too.
functions.<pattern>
The key is a glob, or a regular expression anchored at both ends when it is not the name of an existing file. Every file it matches becomes one Function.
| Key | Type | Default | What it does |
|---|---|---|---|
runtime | node-22, node-20, node-18, node-16, bun-1, php-84, php-83, php-81 | node-20 | The language and major version the Function runs under |
memory | number, MB, 128 to 3009 | 128 | RAM for the Function. See Memory and CPU |
max_duration | number, seconds, 1 to 28800 | 30 | Ceiling on one invocation, including its response stream or WebSocket connection |
schedule | string | none | Runs the Function on a timer. See Cron jobs |
symlinks | map, 1 to 100 entries, each side 256 characters at most | none | Links created in the project before packaging. Both ends must resolve inside the project root |
includeFiles | string or list of strings | none | Globs added to the package after dependency tracing |
excludeFiles | string or list of strings | none | Globs removed from the package, and from the pattern match itself |
runtime, memory, max_duration, includeFiles, and excludeFiles merge across every pattern that matches a file, with later patterns winning. symlinks and schedule are read only from the pattern that first produced the file.
routes[]
| Key | Type | Default | What it does |
|---|---|---|---|
source | string, 4096 at most | required | Literal path, prefix ending in *, or regular expression matched against the request path |
destination | string, 4096 at most | required | The entrypoint path this route serves, exactly as written in functions, with no leading slash |
methods | list of ANY, GET, POST, PUT, PATCH, DELETE, HEAD, OPTIONS | [ANY] | Which methods the route answers. Each one becomes its own entry in the route table |
headers | map of string to string | {} | Response headers set after the handler returns |
statusCode | integer, 100 to 999 | none | Accepted and not applied |
redirect | boolean | none | Accepted. The route is never created, so the path answers 404 |
has | list, 16 at most | none | Accepted and not applied |
missing | list, 16 at most | none | Accepted and not applied |
An entry in has or missing is { type: host, value }, or { type: header | cookie | query, key, value } where value is optional. Both are validated strictly and then ignored.
images
Supplying the block fills in every key you leave out. Omitting it emits no policy.
| Key | Type | Default |
|---|---|---|
widths | 1 to 64 integers, each 1 to 8192 | [640, 750, 828, 1080, 1200, 1920, 2048, 3840] |
heights | up to 64 integers, each 1 to 8192 | [] |
qualities | 1 to 100 integers, each 1 to 100 | [75] |
formats | 1 to 4 of image/avif, image/webp, image/jpeg, image/png | [image/avif, image/webp] |
localPatterns | up to 64 objects | [{ pathname: /** }] |
remotePatterns | up to 64 objects | [] |
minimumCacheTTL | integer, 0 to 31536000 seconds | 14400 |
dangerouslyAllowSVG | boolean | false |
contentSecurityPolicy | string, 4096 at most | default-src 'self'; script-src 'none'; sandbox; |
contentDispositionType | inline or attachment | attachment |
maximumRedirects | integer, 0 to 10 | 3 |
maximumResponseBody | integer, 1024 to 104857600 bytes | 52428800 |
variants | up to 100 named entries | {} |
A localPatterns entry takes pathname (1 to 2048 characters) and search. A remotePatterns entry requires hostname (1 to 253 characters) and takes protocol (http or https), port, pathname, and search. A variant name matches ^[A-Za-z0-9][A-Za-z0-9_-]{0,63}$ and sets at least one of width (1 to 8192), height (1 to 8192), quality (1 to 100), format, and fit (contain, cover, fill, inside, outside).
services.storage
services:
storage:
buckets:
user-uploads: null
brand-assets:
visibility: publicbuckets is required when storage is present. A bucket name is 3 to 63 characters of lowercase letters, digits, and hyphens, starting and ending alphanumeric, and it may not look like a UUID. The value is null, {}, or { visibility: public | private }, and visibility defaults to private.
Provisioning is additive and scoped to the deployment's environment. A repeated deployment reuses an existing bucket without changing its visibility, and a bucket you stop declaring is never deleted. Declaring buckets on a deployment that has no environment fails the build. Buckets covers what you then do with them.
When the file is rejected
| Condition | Result |
|---|---|
| The file is empty, or the YAML or JSON does not parse | The build fails, naming the file |
| A TypeScript or JavaScript config throws, or exports no object | The build fails, naming the file. See TypeScript configuration |
version is missing or is not a number | The build fails before schema validation, naming the file |
version is a number other than 4 | The build fails with an unsupported-version error |
| A value breaks the schema | The build fails and lists each violation with the path to it |
Scanning the project for a functions pattern fails | The build fails, naming the pattern. A pattern that matches nothing is not a failure |
| A declared entrypoint file does not exist on a Node or Bun runtime | The build fails before packaging, naming the file and the config it came from |
One more check runs outside the build. gigadrive deploy reads the parser's error list before uploading and refuses a project that resolves to no Functions, no assets and no routes: The current project config does not resolve to any functions, assets or routes and can not be deployed. An archive uploaded without that check is unpacked and read the same way, and the deployment fails with the same message before any build starts. The build itself never reads that list.
