You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
You can now automatically provision Cloudflare resources as part of your deployment. Without this, you need to separately manually create any resouces that do not yet exist on your account prior to deploying.
12
13
13
-
With resource provisioning, if your Wrangler configuration file includes a [KV namespace](/kv/), [D1 database](/d1/), or [R2 bucket](/r2/) that does not yet exist, Wrangler will create these resources upon deployment. This is done by adding the experimental `–x-provision` flag to your commands.
14
+
With resource provisioning, if your Wrangler configuration file includes a [KV namespace](/kv/), [D1 database](/d1/), or [R2 bucket](/r2/) that does not yet exist, Wrangler will create these resources upon deployment. This is done by adding the experimental `-–x-provision` flag to your commands.
14
15
15
16
## Wrangler Configuration
16
-
You can set up your Wrangler configuration file like the following:
17
+
You can set up your Wrangler configuration file like the following:
18
+
19
+
<WranglerConfig>
17
20
```json
18
21
{
19
22
"kv_namespaces": [
@@ -33,20 +36,26 @@ You can set up your Wrangler configuration file like the following:
33
36
]
34
37
}
35
38
```
36
-
When using the experimental `–x-provision` flag, the `id` field for KV and D1 and the `bucket_name` for R2 are optional in your wrangler configuration.
39
+
</WranglerConfig>
40
+
41
+
When using the experimental `-–x-provision` flag, the `id` field for KV and D1 and the `bucket_name` for R2 are optional in your wrangler configuration.
37
42
38
43
## Developing locally and deploying
39
44
When developing locally, you can interact with local versions of any KV, D1, R2 resources configured in your Wrangler configuration file by running:
40
45
41
-
```sh
42
-
npx wrangler dev –x-provision
43
-
```
46
+
<PackageManagers
47
+
type="exec"
48
+
pkg="wrangler"
49
+
args={"dev –-x-provision"}
50
+
/>
44
51
45
52
When you're ready to deploy, run:
46
53
47
-
```sh
48
-
npx wrangler deploy –x-provision
49
-
```
54
+
<PackageManagers
55
+
type="exec"
56
+
pkg="wrangler"
57
+
args={"deploy –-x-provision"}
58
+
/>
50
59
51
60
Upon deploy Wrangler will automatically create the resources that do not yet exist on your accound and bind them to your Worker. The newly created resource will be named with the format `<worker-name>-<binding-name>` by default.
0 commit comments