Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
[wrangler]: Add support for D1 "us" jurisdiction
This MR adds support for the "us" jurisdiction for D1 in addition to the
already existing "eu" and "fedramp" jurisdictions.
  • Loading branch information
FlorentCollin committed Aug 7, 2026
commit 70fd1a6fca956995fc47525ce4378334a7b4c7af
7 changes: 7 additions & 0 deletions .changeset/fresh-d1-jurisdictions.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
"wrangler": minor
---

Add US jurisdiction support to `wrangler d1 create`

You can now create a D1 database in the US jurisdiction with `wrangler d1 create <name> --jurisdiction us`. The new jurisdiction is also listed in the command's help output.
13 changes: 10 additions & 3 deletions packages/wrangler/src/__tests__/d1/create.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,13 @@ describe("create", () => {
);
});

it("should show all supported jurisdictions in help", async ({ expect }) => {
await runWrangler("d1 create --help");

expect(std.out).toContain('[choices: "eu", "fedramp", "us"]');
expect(std.out).toContain("us: The United States");
});

it("should throw if location flag isn't in the list", async ({ expect }) => {
setIsTTY(false);
msw.use(
Expand Down Expand Up @@ -95,7 +102,7 @@ describe("create", () => {
await expect(runWrangler("d1 create test --jurisdiction something")).rejects
.toThrowErrorMatchingInlineSnapshot(`
[Error: Invalid values:
Argument: jurisdiction, Given: "something", Choices: "eu", "fedramp"]
Argument: jurisdiction, Given: "something", Choices: "eu", "fedramp", "us"]
`);
});

Expand All @@ -115,15 +122,15 @@ describe("create", () => {
uuid: "51e7c314-456e-4167-b6c3-869ad188fc23",
name: "test",
created_in_region: "WEUR",
jurisdiction: "eu",
jurisdiction: "us",
},
success: true,
errors: [],
messages: [],
});
})
);
await runWrangler("d1 create test --jurisdiction eu --binding MY_TEST_DB");
await runWrangler("d1 create test --jurisdiction us --binding MY_TEST_DB");
expect(std.out).toMatchInlineSnapshot(`
"
⛅️ wrangler x.x.x
Expand Down
2 changes: 1 addition & 1 deletion packages/wrangler/src/d1/constants.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
export const DEFAULT_MIGRATION_PATH = "./migrations";
export const DEFAULT_MIGRATION_TABLE = "d1_migrations";
export const LOCATION_CHOICES = ["weur", "eeur", "apac", "oc", "wnam", "enam"];
export const JURISDICTION_CHOICES = ["eu", "fedramp"];
export const JURISDICTION_CHOICES = ["eu", "fedramp", "us"];
export const D1_DOCS_URL = "https://developers.cloudflare.com/d1/";
1 change: 1 addition & 0 deletions packages/wrangler/src/d1/create.ts
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@ export const d1CreateCommand = createCommand({
The location to restrict the D1 database to run and store data within to comply with local regulations. Note that if jurisdictions are set, the location hint is ignored. Options:
eu: The European Union
fedramp: FedRAMP-compliant data centers
us: The United States
`,
},
...sharedResourceCreationArgs,
Expand Down
Loading