Skip to content

Commit e26a906

Browse files
penalosanevikashah
authored andcommitted
Use shared components
1 parent 0c0bed2 commit e26a906

File tree

1 file changed

+19
-10
lines changed

1 file changed

+19
-10
lines changed

src/content/docs/workers/wrangler/resource-provisioning.mdx

Lines changed: 19 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,16 @@ sidebar:
77
text: Beta
88
---
99

10-
# Resource Provisioning
10+
import { PackageManagers, WranglerConfig } from "~/components";
11+
1112
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.
1213

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.
1415

1516
## 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>
1720
```json
1821
{
1922
"kv_namespaces": [
@@ -33,20 +36,26 @@ You can set up your Wrangler configuration file like the following:
3336
]
3437
}
3538
```
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.
3742

3843
## Developing locally and deploying
3944
When developing locally, you can interact with local versions of any KV, D1, R2 resources configured in your Wrangler configuration file by running:
4045

41-
```sh
42-
npx wrangler dev –x-provision
43-
```
46+
<PackageManagers
47+
type="exec"
48+
pkg="wrangler"
49+
args={"dev –-x-provision"}
50+
/>
4451

4552
When you're ready to deploy, run:
4653

47-
```sh
48-
npx wrangler deploy –x-provision
49-
```
54+
<PackageManagers
55+
type="exec"
56+
pkg="wrangler"
57+
args={"deploy –-x-provision"}
58+
/>
5059

5160
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.
5261

0 commit comments

Comments
 (0)