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
8 changes: 4 additions & 4 deletions src/content/changelogs/r2.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,16 +19,16 @@ entries:
- Public buckets accessible via custom domain now support Smart [Tiered Cache](/r2/buckets/public-buckets/#caching).
- publish_date: "2024-11-19"
description: |-
- R2 [`bucket lifecycle` command](/workers/wrangler/commands/#lifecycle-add) added to Wrangler. Supports listing, adding, and removing object lifecycle rules.
- R2 [`bucket lifecycle` command](/workers/wrangler/commands/#r2-bucket-lifecycle-add) added to Wrangler. Supports listing, adding, and removing object lifecycle rules.
- publish_date: "2024-11-14"
description: |-
- R2 [`bucket info` command](/workers/wrangler/commands/#info-2) added to Wrangler. Displays location of bucket and common metrics.
- R2 [`bucket info` command](/workers/wrangler/commands/r2-bucket-info) added to Wrangler. Displays location of bucket and common metrics.
- publish_date: "2024-11-08"
description: |-
- R2 [`bucket dev-url` command](/workers/wrangler/commands/#dev-url-enable) added to Wrangler. Supports enabling, disabling, and getting status of bucket's [r2.dev public access URL](/r2/buckets/public-buckets/#enable-managed-public-access).
- R2 [`bucket dev-url` command](/workers/wrangler/commands/#r2-bucket-dev-url-enable) added to Wrangler. Supports enabling, disabling, and getting status of bucket's [r2.dev public access URL](/r2/buckets/public-buckets/#enable-managed-public-access).
- publish_date: "2024-11-06"
description: |-
- R2 [`bucket domain` command](/workers/wrangler/commands/#domain-add) added to Wrangler. Supports listing, adding, removing, and updating [R2 bucket custom domains](/r2/buckets/public-buckets/#custom-domains).
- R2 [`bucket domain` command](/workers/wrangler/commands/#r2-bucket-domain-add) added to Wrangler. Supports listing, adding, removing, and updating [R2 bucket custom domains](/r2/buckets/public-buckets/#custom-domains).
- publish_date: "2024-11-01"
description: |-
- Add `minTLS` to response of [list custom domains](/api/resources/r2/subresources/buckets/subresources/domains/subresources/custom/methods/list/) endpoint.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ export default {
};
```

To make this work, you need to use [`wrangler secret put`](/workers/wrangler/commands/#put-3) to set your `OPENAI_API_KEY`. This will save the API key to your environment so your Worker can access it when deployed. This key is the API key you created earlier in the OpenAI dashboard:
To make this work, you need to use [`wrangler secret put`](/workers/wrangler/commands/#put) to set your `OPENAI_API_KEY`. This will save the API key to your environment so your Worker can access it when deployed. This key is the API key you created earlier in the OpenAI dashboard:

```sh title="Save your API key to your Workers env"
npx wrangler secret put OPENAI_API_KEY
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ You will use C3 for new project creation.

[Wrangler](/workers/wrangler/) is a command-line tool for building with Cloudflare developer products.

With Wrangler, you can [develop](/workers/wrangler/commands/#dev) your Worker locally and remotely, [roll back](/workers/wrangler/commands/#rollback) to a previous deployment of your Worker, [delete](/workers/wrangler/commands/#delete-3) a Worker and its bound Developer Platform resources, and more. Refer to [Wrangler Commands](/workers/wrangler/commands/) to view the full reference of Wrangler commands.
With Wrangler, you can [develop](/workers/wrangler/commands/#dev) your Worker locally and remotely, [roll back](/workers/wrangler/commands/#rollback) to a previous deployment of your Worker, [delete](/workers/wrangler/commands/#delete-1) a Worker and its bound Developer Platform resources, and more. Refer to [Wrangler Commands](/workers/wrangler/commands/) to view the full reference of Wrangler commands.

When you run C3 to create your project, C3 will install the latest version of Wrangler and you do not need to install Wrangler again. You can [update Wrangler](/workers/wrangler/install-and-update/#update-wrangler) to a newer version in your project to access new Wrangler capabilities and features.

Expand Down
6 changes: 3 additions & 3 deletions src/content/docs/r2/buckets/create-buckets.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ The R2 support in Wrangler allows you to manage buckets and perform basic operat

## Bucket-Level Operations

Create a bucket with the [`r2 bucket create`](/workers/wrangler/commands/#create-4) command:
Create a bucket with the [`r2 bucket create`](/workers/wrangler/commands/#r2-bucket-create) command:

```sh
wrangler r2 bucket create your-bucket-name
Expand All @@ -31,13 +31,13 @@ The placeholder text is only for the example.

:::

List buckets in the current account with the [`r2 bucket list`](/workers/wrangler/commands/#list-5) command:
List buckets in the current account with the [`r2 bucket list`](/workers/wrangler/commands/#r2-bucket-list) command:

```sh
wrangler r2 bucket list
```

Delete a bucket with the [`r2 bucket delete`](/workers/wrangler/commands/#delete-7) command. Note that the bucket must be empty and all objects must be deleted.
Delete a bucket with the [`r2 bucket delete`](/workers/wrangler/commands/#r2-bucket-delete) command. Note that the bucket must be empty and all objects must be deleted.

```sh
wrangler r2 bucket delete BUCKET_TO_DELETE
Expand Down
2 changes: 1 addition & 1 deletion src/content/docs/r2/buckets/event-notifications.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ To begin, install [`npm`](https://docs.npmjs.com/getting-started). Then [install

#### Enable event notifications on your R2 bucket

Log in to Wrangler with the [`wrangler login` command](/workers/wrangler/commands/#login). Then add an [event notification rule](/r2/buckets/event-notifications/#event-notification-rules) to your bucket by running the [`r2 bucket notification create` command](/workers/wrangler/commands/#notification-create).
Log in to Wrangler with the [`wrangler login` command](/workers/wrangler/commands/#login). Then add an [event notification rule](/r2/buckets/event-notifications/#event-notification-rules) to your bucket by running the [`r2 bucket notification create` command](/workers/wrangler/commands/#r2-bucket-notification-create).

```sh
npx wrangler r2 bucket notification create <BUCKET_NAME> --event-type <EVENT_TYPE> --queue <QUEUE_NAME>
Expand Down
10 changes: 5 additions & 5 deletions src/content/docs/r2/buckets/object-lifecycles.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ For example, you can create an object lifecycle rule to delete objects after 90
- An object is no longer billable once it has been deleted.
- Buckets have a default lifecycle rule to expire multipart uploads seven days after initiation.
- When an object is transitioned from Standard storage to Infrequent Access storage, a [Class A operation](/r2/pricing/#class-a-operations) is incurred.
- When rules conflict and specify both a storage class transition and expire transition within a 24 hour period, the expire (or delete) lifecycle transition takes precedence over transitioning storage class.
- When rules conflict and specify both a storage class transition and expire transition within a 24 hour period, the expire (or delete) lifecycle transition takes precedence over transitioning storage class.

## Configure lifecycle rules for your bucket

Expand All @@ -39,13 +39,13 @@ When you create an object lifecycle rule, you can specify which prefix you would
1. Install [`npm`](https://docs.npmjs.com/getting-started).
2. Install [Wrangler, the Developer Platform CLI](/workers/wrangler/install-and-update/).
3. Log in to Wrangler with the [`wrangler login` command](/workers/wrangler/commands/#login).
4. Add a lifecycle rule to your bucket by running the [`r2 bucket lifecycle add` command](/workers/wrangler/commands/#lifecycle-add).
4. Add a lifecycle rule to your bucket by running the [`r2 bucket lifecycle add` command](/workers/wrangler/commands/#r2-bucket-lifecycle-add).

```sh
npx wrangler r2 bucket lifecycle add <BUCKET_NAME> [OPTIONS]
```

Alternatively you can set the entire lifecycle configuration for a bucket from a JSON file using the [`r2 bucket lifecycle set` command](/workers/wrangler/commands/#lifecycle-set).
Alternatively you can set the entire lifecycle configuration for a bucket from a JSON file using the [`r2 bucket lifecycle set` command](/workers/wrangler/commands/#r2-bucket-lifecycle-set).

```sh
npx wrangler r2 bucket lifecycle set <BUCKET_NAME> --file <FILE_PATH>
Expand Down Expand Up @@ -142,7 +142,7 @@ await client

### Wrangler

To get the list of lifecycle rules associated with your bucket, run the [`r2 bucket lifecycle list` command](/workers/wrangler/commands/#lifecycle-list).
To get the list of lifecycle rules associated with your bucket, run the [`r2 bucket lifecycle list` command](/workers/wrangler/commands/#r2-bucket-lifecycle-list).

```sh
npx wrangler r2 bucket lifecycle list <BUCKET_NAME>
Expand Down Expand Up @@ -186,7 +186,7 @@ console.log(

### Wrangler

To remove a specific lifecycle rule from your bucket, run the [`r2 bucket lifecycle remove` command](/workers/wrangler/commands/#lifecycle-remove).
To remove a specific lifecycle rule from your bucket, run the [`r2 bucket lifecycle remove` command](/workers/wrangler/commands/#r2-bucket-lifecycle-remove).

```sh
npx wrangler r2 bucket lifecycle remove <BUCKET_NAME> --id <RULE_ID>
Expand Down
4 changes: 2 additions & 2 deletions src/content/docs/r2/data-migration/sippy.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ To begin, install [`npm`](https://docs.npmjs.com/getting-started). Then [install

#### Enable Sippy on your R2 bucket

Log in to Wrangler with the [`wrangler login` command](/workers/wrangler/commands/#login). Then run the [`r2 bucket sippy enable` command](/workers/wrangler/commands/#sippy-enable):
Log in to Wrangler with the [`wrangler login` command](/workers/wrangler/commands/#login). Then run the [`r2 bucket sippy enable` command](/workers/wrangler/commands/#r2-bucket-sippy-enable):

```sh
npx wrangler r2 bucket sippy enable <BUCKET_NAME>
Expand Down Expand Up @@ -127,7 +127,7 @@ You can optionally select a time window to query. This defaults to the last 24 h

### Wrangler

To disable Sippy, run the [`r2 bucket sippy disable` command](/workers/wrangler/commands/#sippy-disable):
To disable Sippy, run the [`r2 bucket sippy disable` command](/workers/wrangler/commands/#r2-bucket-sippy-disable):

```sh
npx wrangler r2 bucket sippy disable <BUCKET_NAME>
Expand Down
2 changes: 1 addition & 1 deletion src/content/docs/r2/tutorials/summarize-pdf.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -455,7 +455,7 @@ The queue handler now adds the summary to the R2 bucket as a text file.

## 9. Enable event notifications

Your `queue` handler is ready to handle incoming event notification messages. You need to enable event notifications with the [`wrangler r2 bucket notification create` command](/workers/wrangler/commands/#notification-create) for your bucket. The following command creates an event notification for the `object-create` event type for the `pdf` suffix:
Your `queue` handler is ready to handle incoming event notification messages. You need to enable event notifications with the [`wrangler r2 bucket notification create` command](/workers/wrangler/commands/#r2-bucket-notification-create) for your bucket. The following command creates an event notification for the `object-create` event type for the `pdf` suffix:

```sh
npx wrangler r2 bucket notification create <R2_BUCKET_NAME> --event-type object-create --queue pdf-summarizer --suffix "pdf"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ npx wrangler deploy

## 8. Enable event notifications

Now that you have your consumer Worker ready to handle incoming event notification messages, you need to enable event notifications with the [`wrangler r2 bucket notification create` command](/workers/wrangler/commands/#notification-create) for `example-upload-bucket`:
Now that you have your consumer Worker ready to handle incoming event notification messages, you need to enable event notifications with the [`wrangler r2 bucket notification create` command](/workers/wrangler/commands/#r2-bucket-notification-create) for `example-upload-bucket`:

```sh
npx wrangler r2 bucket notification create example-upload-bucket --event-type object-create --queue example-event-notification-queue
Expand Down
2 changes: 1 addition & 1 deletion src/content/docs/workers/configuration/secrets.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ To add a secret via the dashboard:

#### Via Wrangler

Secrets can be deleted through [`wrangler secret delete`](/workers/wrangler/commands/#delete-7) or [`wrangler versions secret delete`](/workers/wrangler/commands/#secret-delete) commands.
Secrets can be deleted through [`wrangler secret delete`](/workers/wrangler/commands/#delete-2) or [`wrangler versions secret delete`](/workers/wrangler/commands/#secret-delete) commands.

`wrangler secret delete` creates a new version of the Worker and deploys it immediately.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ curl -s https://example.com -H 'Cloudflare-Workers-Version-Overrides: my-worker-

The dictionary can contain multiple key-value pairs. Each key indicates the name of the Worker the override should be applied to. The value indicates the version ID that should be used and must be a [String](https://www.rfc-editor.org/rfc/rfc8941#name-strings).

A version override will only be applied if the specified version is in the current deployment. The versions in the current deployment can be found using the [`wrangler deployments list`](/workers/wrangler/commands/#list-6) command or on the [Workers Dashboard](https://dash.cloudflare.com/?to=/:account/workers) under Worker > Deployments > Active Deployment.
A version override will only be applied if the specified version is in the current deployment. The versions in the current deployment can be found using the [`wrangler deployments list`](/workers/wrangler/commands/#list-5) command or on the [Workers Dashboard](https://dash.cloudflare.com/?to=/:account/workers) under Worker > Deployments > Active Deployment.

:::note[Verifying that the version override was applied]

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ New versions are not created when you make changes to [resources connected to yo

#### Via Wrangler

Wrangler allows you to view the 10 most recent versions and deployments. Refer to the [`versions list`](/workers/wrangler/commands/#list-8) and [`deployments`](/workers/wrangler/commands/#list-9) documentation to view the commands.
Wrangler allows you to view the 10 most recent versions and deployments. Refer to the [`versions list`](/workers/wrangler/commands/#list-4) and [`deployments`](/workers/wrangler/commands/#list-5) documentation to view the commands.

#### Via the Cloudflare dashboard

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ For the remainder of this tutorial you will complete each task, iterating on you

To begin, you need to understand how to populate your todo list with actual data. To do this, use [Cloudflare Workers KV](/kv/) — a key-value store that you can access inside of your Worker to read and write data.

To get started with KV, set up a namespace. All of your cached data will be stored inside that namespace and, with configuration, you can access that namespace inside the Worker with a predefined variable. Use Wrangler to create a new namespace called `TODOS` with the [`kv:namespace create` command](/workers/wrangler/commands/#create-3) and get the associated namespace ID by running the following command in your terminal:
To get started with KV, set up a namespace. All of your cached data will be stored inside that namespace and, with configuration, you can access that namespace inside the Worker with a predefined variable. Use Wrangler to create a new namespace called `TODOS` with the [`kv:namespace create` command](/workers/wrangler/commands/#kv-namespace-create) and get the associated namespace ID by running the following command in your terminal:

```sh title="Create a new KV namespace"
npx wrangler kv:namespace create "TODOS" --preview
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,15 +71,15 @@ cd finetune-chatgpt-model

Next, upload the fine-tune document to R2. R2 is a key-value store that allows you to store and retrieve files from within your Workers application. You will use [Wrangler](/workers/wrangler) to create a new R2 bucket.

To create a new R2 bucket use the [`wrangler r2 bucket create`](/workers/wrangler/commands/#create-2) command. Note that you are logged in with your Cloudflare account. If not logged in via Wrangler, use the [`wrangler login`](/workers/wrangler/commands/#login) command.
To create a new R2 bucket use the [`wrangler r2 bucket create`](/workers/wrangler/commands/#r2-bucket-create) command. Note that you are logged in with your Cloudflare account. If not logged in via Wrangler, use the [`wrangler login`](/workers/wrangler/commands/#login) command.

```sh
npx wrangler r2 bucket create <BUCKET_NAME>
```

Replace `<BUCKET_NAME>` with your desired bucket name. Note that bucket names must be lowercase and can only contain dashes.

Next, upload a file using the [`wrangler r2 object put`](/workers/wrangler/commands/#put-2) command.
Next, upload a file using the [`wrangler r2 object put`](/workers/wrangler/commands/#r2-object-put) command.

```sh
npx wrangler r2 object put <PATH> -f <FILE_NAME>
Expand Down Expand Up @@ -239,7 +239,7 @@ app.get("/jobs", async (c) => {

After you have created your Worker application and added the required functions, deploy the application.

Before you deploy, you must set the `OPENAI_API_KEY` [secret](/workers/configuration/secrets/) for your application. Do this by running the [`wrangler secret put`](/workers/wrangler/commands/#put-3) command:
Before you deploy, you must set the `OPENAI_API_KEY` [secret](/workers/configuration/secrets/) for your application. Do this by running the [`wrangler secret put`](/workers/wrangler/commands/#put) command:

```sh
npx wrangler secret put OPENAI_API_KEY
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ function checkSignature(text, headers, githubSecretToken) {
}
```

To make this work, you need to use [`wrangler secret put`](/workers/wrangler/commands/#put-3) to set your `GITHUB_SECRET_TOKEN`. This token is the secret you picked earlier when configuring you GitHub webhook:
To make this work, you need to use [`wrangler secret put`](/workers/wrangler/commands/#put) to set your `GITHUB_SECRET_TOKEN`. This token is the secret you picked earlier when configuring you GitHub webhook:

```sh
npx wrangler secret put GITHUB_SECRET_TOKEN
Expand Down Expand Up @@ -203,7 +203,7 @@ async function sendText(accountSid, authToken, message) {
}
```

To make this work, you need to set some secrets to hide your `ACCOUNT_SID` and `AUTH_TOKEN` from the source code. You can set secrets with [`wrangler secret put`](/workers/wrangler/commands/#put-3) in your command line.
To make this work, you need to set some secrets to hide your `ACCOUNT_SID` and `AUTH_TOKEN` from the source code. You can set secrets with [`wrangler secret put`](/workers/wrangler/commands/#put) in your command line.

```sh
npx wrangler secret put TWILIO_ACCOUNT_SID
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ async fetch(request, env, ctx) {
},
```

Use [`wrangler secret put`](/workers/wrangler/commands/#put-3) to set `OPENAI_API_KEY`. This [secret's](/workers/configuration/secrets/) value is the API key you created earlier in the OpenAI dashboard:
Use [`wrangler secret put`](/workers/wrangler/commands/#put) to set `OPENAI_API_KEY`. This [secret's](/workers/configuration/secrets/) value is the API key you created earlier in the OpenAI dashboard:

```sh
npx wrangler secret put <OPENAI_API_KEY>
Expand Down
2 changes: 1 addition & 1 deletion src/content/docs/workers/tutorials/postgres/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -325,7 +325,7 @@ Create a Hyperdrive configuration using the connection string for your PostgreSQ
npx wrangler hyperdrive create <NAME_OF_HYPERDRIVE_CONFIG> --connection-string="postgres://user:password@HOSTNAME_OR_IP_ADDRESS:PORT/database_name"
```

You can also use explicit parameters by following the [wrangler documentation for Hyperdrive](/workers/wrangler/commands/#create-1).
You can also use explicit parameters by following the [wrangler documentation for Hyperdrive](/workers/wrangler/commands/#r2-bucket-create).

This command outputs the Hyperdrive configuration `id` that will be used for your Hyperdrive [binding](/workers/runtime-apis/bindings/). Set up your binding by specifying the `id` in the `wrangler.toml` file.

Expand Down
Loading
Loading