Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
---
title: Automatic resource provisioning
Copy link
Contributor

@lrapoport-cf lrapoport-cf Oct 21, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should we narrow to "Automatic resource provisioning for KV, D1, and R2" or maybe put the specific resources in the description?

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.
Copy link
Contributor

@lrapoport-cf lrapoport-cf Oct 21, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe include a sentence that contrasts the before to the now, something like below (but could probably be made smoother):

Suggested change
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 still develop locally and deploy your application seamlessly, but without having to run additional commands first.


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.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bit nitpicky. Do we want to be clear here here that 'binding' here means writing the created resources to the configuration file. Could be an addition to the final sentence eg.

As part of this process, these bindings will be written to your wrangler configuration file. Future deployments of your worker will use these bindings.

2 changes: 1 addition & 1 deletion src/content/docs/workers/runtime-apis/bindings/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -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:

<DirectoryListing />

Expand Down
Loading