From 4cb81e6e13e619a50f3f9b94c684f4e9d3f0cd62 Mon Sep 17 00:00:00 2001 From: Samuel Macleod Date: Tue, 21 Oct 2025 16:27:49 +0100 Subject: [PATCH 1/6] Add changelog --- ...-10-24-automatic-resource-provisioning.mdx | 33 +++++++++++++++++++ .../workers/runtime-apis/bindings/index.mdx | 2 +- 2 files changed, 34 insertions(+), 1 deletion(-) create mode 100644 src/content/changelog/workers/2025-10-24-automatic-resource-provisioning.mdx diff --git a/src/content/changelog/workers/2025-10-24-automatic-resource-provisioning.mdx b/src/content/changelog/workers/2025-10-24-automatic-resource-provisioning.mdx new file mode 100644 index 000000000000000..56ccb6de1e3e89d --- /dev/null +++ b/src/content/changelog/workers/2025-10-24-automatic-resource-provisioning.mdx @@ -0,0 +1,33 @@ +--- +title: Automatic resource provisioning +description: Wrangler can now automatically provision resources when deploying your Worker +products: + - workers +date: 2025-10-24 +--- + +import { Render, TypeScriptExample, WranglerConfig } from "~/components"; + +If your Wrangler configuration file includes a KV namespace, D1 database, or R2 bucket that does not yet exist on your account, you can still develop locally and deploy your application seamlessly, without having to run additional commands to create resources. + +You can set up your Wrangler configuration file like the following: + +```jsonc +{ + "kv_namespaces": { + "binding": "MY_KV", + }, + "r2_buckets": { + "binding": "MY_R2", + }, + "d1_databases": { + "binding": "MY_D1", + }, +} +``` + +When using this feature, the `id` field for KV and D1 and the `bucket_name` for R2 are optional in your wrangler configuration. + +When developing locally, you can interact with local versions of any KV, D1, R2 resources configured in your Wrangler configuration file, without having to include an id to existing resource + +Once ready to deploy, run `npx wrangler deploy`. Cloudflare will automatically create the resources that do not exist and bind them to your worker. Future deployments will use the same created resources. diff --git a/src/content/docs/workers/runtime-apis/bindings/index.mdx b/src/content/docs/workers/runtime-apis/bindings/index.mdx index 128432aa4401754..5a1d3e4056faf9a 100644 --- a/src/content/docs/workers/runtime-apis/bindings/index.mdx +++ b/src/content/docs/workers/runtime-apis/bindings/index.mdx @@ -12,7 +12,7 @@ import { DirectoryListing, WranglerConfig } from "~/components"; Bindings allow your Worker to interact with resources on the Cloudflare Developer Platform. Bindings provide better performance and less restrictions when accessing resources from Workers than the [REST APIs](/api/) which are intended for non-Workers applications. -The following bindings available today: +The following bindings are available today: From ef6f98b59e5c248bda3df9f01496434028471748 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Somhairle=20MacLe=C3=B2id?= Date: Tue, 21 Oct 2025 17:20:40 +0100 Subject: [PATCH 2/6] Update src/content/changelog/workers/2025-10-24-automatic-resource-provisioning.mdx Co-authored-by: emily-shen <69125074+emily-shen@users.noreply.github.com> --- .../workers/2025-10-24-automatic-resource-provisioning.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/content/changelog/workers/2025-10-24-automatic-resource-provisioning.mdx b/src/content/changelog/workers/2025-10-24-automatic-resource-provisioning.mdx index 56ccb6de1e3e89d..89e0c5659e0b4a0 100644 --- a/src/content/changelog/workers/2025-10-24-automatic-resource-provisioning.mdx +++ b/src/content/changelog/workers/2025-10-24-automatic-resource-provisioning.mdx @@ -28,6 +28,6 @@ You can set up your Wrangler configuration file like the following: When using this feature, the `id` field for KV and D1 and the `bucket_name` for R2 are optional in your wrangler configuration. -When developing locally, you can interact with local versions of any KV, D1, R2 resources configured in your Wrangler configuration file, without having to include an id to existing resource +When developing locally, you can interact with local versions of any KV, D1, R2 resources configured in your Wrangler configuration file, without having to include an id to existing resource. Once ready to deploy, run `npx wrangler deploy`. Cloudflare will automatically create the resources that do not exist and bind them to your worker. Future deployments will use the same created resources. From b4a007a3f1f69aa79b0f18c7d7f4196e3129a93c Mon Sep 17 00:00:00 2001 From: Samuel Macleod Date: Tue, 21 Oct 2025 21:47:37 +0100 Subject: [PATCH 3/6] feedback --- ...-10-24-automatic-resource-provisioning.mdx | 28 ++++++++----------- 1 file changed, 11 insertions(+), 17 deletions(-) diff --git a/src/content/changelog/workers/2025-10-24-automatic-resource-provisioning.mdx b/src/content/changelog/workers/2025-10-24-automatic-resource-provisioning.mdx index 89e0c5659e0b4a0..d173535a61b2d12 100644 --- a/src/content/changelog/workers/2025-10-24-automatic-resource-provisioning.mdx +++ b/src/content/changelog/workers/2025-10-24-automatic-resource-provisioning.mdx @@ -1,6 +1,6 @@ --- -title: Automatic resource provisioning -description: Wrangler can now automatically provision resources when deploying your Worker +title: Automatic resource provisioning for KV, R2, and D1 +description: Wrangler can now automatically provision KV, R2, and D1 resources when deploying your Worker products: - workers date: 2025-10-24 @@ -8,26 +8,20 @@ date: 2025-10-24 import { Render, TypeScriptExample, WranglerConfig } from "~/components"; -If your Wrangler configuration file includes a KV namespace, D1 database, or R2 bucket that does not yet exist on your account, you can still develop locally and deploy your application seamlessly, without having to run additional commands to create resources. +Previously, if you wanted to develop or deploy a worker with attached resources, you'd have to first manually create the desired resources. Now, if your Wrangler configuration file includes a KV namespace, D1 database, or R2 bucket that does not yet exist on your account, you can develop locally and deploy your application seamlessly, without having to run additional commands to create resources. -You can set up your Wrangler configuration file like the following: +This is still an experimental feature, but we're turning it on by default to make it easier for people to test it and try it out. You can disable the feature using the `--no-x-provision` flag. It currently works for KV, R2, and D1 bindings. + +To use this feature, update to wrangler@4.45.0 and add bindings to your config file _without_ resource IDs e.g.: ```jsonc { - "kv_namespaces": { - "binding": "MY_KV", - }, - "r2_buckets": { - "binding": "MY_R2", - }, - "d1_databases": { - "binding": "MY_D1", - }, + "kv_namespaces": [{ "binding": "MY_KV" }], + "d1_databases": [{ "binding": "MY_DB" }], + "r2_buckets": [{ "binding": "MY_R2" }], } ``` -When using this feature, the `id` field for KV and D1 and the `bucket_name` for R2 are optional in your wrangler configuration. - -When developing locally, you can interact with local versions of any KV, D1, R2 resources configured in your Wrangler configuration file, without having to include an id to existing resource. +`wrangler dev` will then automatically create these resources for you locally, and on your next run of `wrangler deploy`, Wrangler will call the Cloudflare API to create the requested resources and link them to your Worker. -Once ready to deploy, run `npx wrangler deploy`. Cloudflare will automatically create the resources that do not exist and bind them to your worker. Future deployments will use the same created resources. +Though resource IDs will be automatically written back to your Wrangler config file after resource creation, resources will stay linked across future deploys even without adding the resource IDs to the config file. This is especially useful for shared templates, which now no longer need to include account-specific resource IDs when adding a binding. From b62800951e4e4ed95901d47f1817a6a508a4b89a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Somhairle=20MacLe=C3=B2id?= Date: Thu, 23 Oct 2025 21:39:12 +0100 Subject: [PATCH 4/6] Update src/content/changelog/workers/2025-10-24-automatic-resource-provisioning.mdx Co-authored-by: lrapoport-cf <107272160+lrapoport-cf@users.noreply.github.com> --- .../workers/2025-10-24-automatic-resource-provisioning.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/content/changelog/workers/2025-10-24-automatic-resource-provisioning.mdx b/src/content/changelog/workers/2025-10-24-automatic-resource-provisioning.mdx index d173535a61b2d12..0ec0e1dd1be51fb 100644 --- a/src/content/changelog/workers/2025-10-24-automatic-resource-provisioning.mdx +++ b/src/content/changelog/workers/2025-10-24-automatic-resource-provisioning.mdx @@ -8,7 +8,7 @@ date: 2025-10-24 import { Render, TypeScriptExample, WranglerConfig } from "~/components"; -Previously, if you wanted to develop or deploy a worker with attached resources, you'd have to first manually create the desired resources. Now, if your Wrangler configuration file includes a KV namespace, D1 database, or R2 bucket that does not yet exist on your account, you can develop locally and deploy your application seamlessly, without having to run additional commands to create resources. +Previously, if you wanted to develop or deploy a worker with attached resources, you'd have to first manually create the desired resources. Now, if your Wrangler configuration file includes a KV namespace, D1 database, or R2 bucket that does not yet exist on your account, you can develop locally and deploy your application seamlessly, without having to run additional commands. This is still an experimental feature, but we're turning it on by default to make it easier for people to test it and try it out. You can disable the feature using the `--no-x-provision` flag. It currently works for KV, R2, and D1 bindings. From 8582d28910dfb1feb9d3845113f4ba23fef8be1c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Somhairle=20MacLe=C3=B2id?= Date: Thu, 23 Oct 2025 21:39:23 +0100 Subject: [PATCH 5/6] Update src/content/changelog/workers/2025-10-24-automatic-resource-provisioning.mdx Co-authored-by: lrapoport-cf <107272160+lrapoport-cf@users.noreply.github.com> --- .../workers/2025-10-24-automatic-resource-provisioning.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/content/changelog/workers/2025-10-24-automatic-resource-provisioning.mdx b/src/content/changelog/workers/2025-10-24-automatic-resource-provisioning.mdx index 0ec0e1dd1be51fb..97119278b4cee8f 100644 --- a/src/content/changelog/workers/2025-10-24-automatic-resource-provisioning.mdx +++ b/src/content/changelog/workers/2025-10-24-automatic-resource-provisioning.mdx @@ -10,7 +10,7 @@ import { Render, TypeScriptExample, WranglerConfig } from "~/components"; Previously, if you wanted to develop or deploy a worker with attached resources, you'd have to first manually create the desired resources. Now, if your Wrangler configuration file includes a KV namespace, D1 database, or R2 bucket that does not yet exist on your account, you can develop locally and deploy your application seamlessly, without having to run additional commands. -This is still an experimental feature, but we're turning it on by default to make it easier for people to test it and try it out. You can disable the feature using the `--no-x-provision` flag. It currently works for KV, R2, and D1 bindings. +Automatic provisioning is still experimental, but we're turning it on by default to make it easier to try out and test. It currently works for KV, R2, and D1 bindings. You can disable the feature using the `--no-x-provision` flag. To use this feature, update to wrangler@4.45.0 and add bindings to your config file _without_ resource IDs e.g.: From 5ec2080aee95196219e33b4b3a35672108ad8313 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Somhairle=20MacLe=C3=B2id?= Date: Fri, 24 Oct 2025 10:21:42 +0100 Subject: [PATCH 6/6] Update 2025-10-24-automatic-resource-provisioning.mdx --- .../workers/2025-10-24-automatic-resource-provisioning.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/content/changelog/workers/2025-10-24-automatic-resource-provisioning.mdx b/src/content/changelog/workers/2025-10-24-automatic-resource-provisioning.mdx index 97119278b4cee8f..8d5b16c36bd1a5c 100644 --- a/src/content/changelog/workers/2025-10-24-automatic-resource-provisioning.mdx +++ b/src/content/changelog/workers/2025-10-24-automatic-resource-provisioning.mdx @@ -10,7 +10,7 @@ import { Render, TypeScriptExample, WranglerConfig } from "~/components"; Previously, if you wanted to develop or deploy a worker with attached resources, you'd have to first manually create the desired resources. Now, if your Wrangler configuration file includes a KV namespace, D1 database, or R2 bucket that does not yet exist on your account, you can develop locally and deploy your application seamlessly, without having to run additional commands. -Automatic provisioning is still experimental, but we're turning it on by default to make it easier to try out and test. It currently works for KV, R2, and D1 bindings. You can disable the feature using the `--no-x-provision` flag. +Automatic provisioning is launching as an open beta, and we'd love to hear your feedback to help us make improvements! It currently works for KV, R2, and D1 bindings. You can disable the feature using the `--no-x-provision` flag. To use this feature, update to wrangler@4.45.0 and add bindings to your config file _without_ resource IDs e.g.: