Skip to content

Commit fa93765

Browse files
authored
feat(sandbox,vercel-sandbox): support all 19 regions (#326)
Support all 19 regions. We are just changing the hints and the SKILL, no actual code is being changed as the previous versions are already compatible.
1 parent 8e471d4 commit fa93765

6 files changed

Lines changed: 39 additions & 12 deletions

File tree

.changeset/wide-regions-hint.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
"@vercel/sandbox": patch
3+
"sandbox": patch
4+
---
5+
6+
Update region hints to cover all 19 Vercel regions.

packages/sandbox/src/args/region.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ export const regionType = cmd.extendType(cmd.string, {
1515
export const region = cmd.option({
1616
long: "region",
1717
type: cmd.optional(regionType),
18-
description: `Region to create the sandbox in (defaults to ${DEFAULT_SANDBOX_REGION}; see the Vercel docs for available regions)`,
18+
description: `Region to create the sandbox in (defaults to ${DEFAULT_SANDBOX_REGION}; any Vercel region is supported, e.g. sfo1, fra1, hnd1, syd1)`,
1919
});
2020

2121
export const regionListType = cmd.extendType(cmd.string, {
@@ -50,5 +50,5 @@ export const failoverRegions = cmd.option({
5050
long: "failover-regions",
5151
type: cmd.optional(failoverRegionListType),
5252
description:
53-
'Comma-separated regions the sandbox can fail over to (e.g. --failover-regions sfo1,cle1). Must not include the sandbox region. Pass "none" for no failover regions, overriding the project default.',
53+
'Comma-separated regions the sandbox can fail over to (e.g. --failover-regions sfo1,fra1). Must not include the sandbox region. Pass "none" for no failover regions, overriding the project default.',
5454
});

packages/sandbox/src/commands/config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -561,7 +561,7 @@ const failoverRegionsCommand = cmd.command({
561561
}),
562562
failoverRegions: cmd.positional({
563563
type: failoverRegionListType,
564-
description: 'Comma-separated regions the sandbox can fail over to (e.g. sfo1,cle1). Must not include the sandbox region. Pass "none" to remove them.',
564+
description: 'Comma-separated regions the sandbox can fail over to (e.g. sfo1,fra1). Must not include the sandbox region. Pass "none" to remove them.',
565565
}),
566566
scope,
567567
},

packages/vercel-sandbox/src/constants.ts

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,27 @@ export type ManagedImage =
1313
* Regions a sandbox can run in. More regions may become available, so any
1414
* other region string is accepted too.
1515
*/
16-
export type SandboxRegion = "iad1" | "sfo1" | "cle1" | "cdg1" | (string & {});
16+
export type SandboxRegion =
17+
| "iad1"
18+
| "sfo1"
19+
| "cle1"
20+
| "cdg1"
21+
| "fra1"
22+
| "arn1"
23+
| "sin1"
24+
| "pdx1"
25+
| "lhr1"
26+
| "icn1"
27+
| "bom1"
28+
| "cpt1"
29+
| "dub1"
30+
| "gru1"
31+
| "hkg1"
32+
| "syd1"
33+
| "yul1"
34+
| "hnd1"
35+
| "kix1"
36+
| (string & {});
1737

1838
/**
1939
* Region a sandbox runs in when none is requested.

packages/vercel-sandbox/src/sandbox.ts

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -111,13 +111,14 @@ export interface BaseCreateSandboxParams {
111111
*/
112112
tags?: Record<string, string>;
113113
/**
114-
* The region to create the sandbox in. Defaults to `iad1`.
115-
* See the Vercel documentation for the available regions.
114+
* The region to create the sandbox in. Defaults to `iad1`. Any Vercel
115+
* region is supported, e.g. `sfo1`, `fra1`, `hnd1`, `syd1`.
116+
* See the Vercel documentation for the full list.
116117
*/
117118
region?: SandboxRegion;
118119
/**
119-
* Additional regions the sandbox can fail over to. Must not include
120-
* `region`.
120+
* Additional regions the sandbox can fail over to, e.g. `["sfo1", "fra1"]`.
121+
* Must not include `region`.
121122
*/
122123
failoverRegions?: SandboxRegion[];
123124

skills/sandbox/SKILL.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -88,8 +88,8 @@ const sandbox = await Sandbox.create({
8888
tags: { env: "staging", team: "infra" }, // Up to 5 key:value tags
8989
persistent: true, // Default: true. Auto-snapshots on stop, restores on resume.
9090
snapshotExpiration: ms("7d"), // Default TTL for snapshots. Use 0 for no expiration.
91-
region: "<region>", // Optional, defaults to iad1. See the Vercel docs for available regions.
92-
failoverRegions: ["<region>"], // Optional. Must not include `region`.
91+
region: "<region>", // Optional, defaults to iad1. Any Vercel region, e.g. sfo1, fra1, hnd1, syd1.
92+
failoverRegions: ["<region>"], // Optional, e.g. ["sfo1", "fra1"]. Must not include `region`.
9393
});
9494

9595
console.log(sandbox.name);
@@ -940,7 +940,7 @@ const result = await sandbox.runCommand({
940940
| Base system | Ubuntu 26.04 |
941941
| User context | `ubuntu` user |
942942
| Writable path | `/vercel/sandbox` |
943-
| Regions | One primary region per sandbox, plus optional failover regions. Snapshots restore only in regions where they are available. See the Vercel docs for the region list. |
943+
| Regions | One primary region per sandbox, plus optional failover regions. All 19 Vercel regions are supported (`iad1` default, `sfo1`, `cle1`, `cdg1`, `fra1`, `arn1`, `sin1`, `pdx1`, `lhr1`, `icn1`, `bom1`, `cpt1`, `dub1`, `gru1`, `hkg1`, `syd1`, `yul1`, `hnd1`, `kix1`). Snapshots restore only in regions where they are available. |
944944

945945
## System Packages
946946

@@ -983,7 +983,7 @@ sandbox create --non-persistent # Disable filesystem persistence
983983
sandbox create --snapshot-expiration 7d # Default snapshot TTL
984984
sandbox create --keep-last-snapshots 1 # Retention policy
985985
sandbox create --tag env=staging # Repeatable
986-
sandbox create --region <region> # Defaults to iad1; see the Vercel docs for available regions
986+
sandbox create --region <region> # Defaults to iad1; any Vercel region, e.g. sfo1, fra1, hnd1, syd1
987987
sandbox create --failover-regions <region>,<region> # Comma-separated
988988
sandbox create --failover-regions none # No failover, overrides the project default
989989

0 commit comments

Comments
 (0)