Skip to content

Commit 7adf817

Browse files
committed
Change id parameter to name for both bucket lifecycle and r2 bucket lock commands
1 parent 8fc464c commit 7adf817

File tree

2 files changed

+10
-10
lines changed

2 files changed

+10
-10
lines changed

src/content/changelog/r2/2025-03-06-r2-bucket-locks.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,13 @@ Here are a couple of examples showing how you can configure bucket lock rules us
2121
#### Ensure all objects in a bucket are retained for at least 180 days
2222

2323
```sh
24-
npx wrangler r2 bucket lock add <bucket> --id 180-days-all --retention-days 180
24+
npx wrangler r2 bucket lock add <bucket> --name 180-days-all --retention-days 180
2525
```
2626

2727
#### Prevent deletion or overwriting of all logs indefinitely (via prefix)
2828

2929
```sh
30-
npx wrangler r2 bucket lock add <bucket> --id indefinite-logs --prefix logs/ --retention-indefinite
30+
npx wrangler r2 bucket lock add <bucket> --name indefinite-logs --prefix logs/ --retention-indefinite
3131
```
3232

3333
For more information on bucket locks and how to set retention policies for objects in your R2 buckets, refer to our [documentation](/r2/buckets/bucket-locks/).

src/content/partials/workers/wrangler-commands/r2.mdx

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -263,8 +263,8 @@ wrangler r2 bucket lifecycle add <NAME> [OPTIONS]
263263

264264
- `NAME` <Type text="string" /> <MetaInfo text="required" />
265265
- The name of the R2 bucket to add a lifecycle rule to.
266-
- `--id` <Type text="string" /> <MetaInfo text="optional" />
267-
- A unique name for the lifecycle rule, used to identify and manage it.
266+
- `--name` <Type text="string" /> <MetaInfo text="optional" />
267+
- A unique name for the lifecycle rule, used to identify and manage it. For example: `delete-logs-180-days`.
268268
- `--prefix` <Type text="string" /> <MetaInfo text="optional" />
269269
- Prefix condition for the lifecycle rule (leave empty for all prefixes).
270270
- `--expire-days` <Type text="number" /> <MetaInfo text="optional" />
@@ -296,8 +296,8 @@ wrangler r2 bucket lifecycle remove <NAME> [OPTIONS]
296296

297297
- `NAME` <Type text="string" /> <MetaInfo text="required" />
298298
- The name of the R2 bucket to remove a lifecycle rule from.
299-
- `--id` <Type text="string" /> <MetaInfo text="required" />
300-
- The unique identifier of the lifecycle rule to remove.
299+
- `--name` <Type text="string" /> <MetaInfo text="required" />
300+
- The unique name of the lifecycle rule to remove.
301301
- `--jurisdiction` <Type text="string" /> <MetaInfo text="optional" />
302302
- The jurisdiction where the bucket exists, if a jurisdiction has been specified. Refer to [jurisdictional restrictions](/r2/reference/data-location/#jurisdictional-restrictions).
303303

@@ -349,8 +349,8 @@ wrangler r2 bucket lock add <NAME> [OPTIONS]
349349

350350
- `NAME` <Type text="string" /> <MetaInfo text="required" />
351351
- The name of the R2 bucket to add a bucket lock rule to.
352-
- `--id` <Type text="string" /> <MetaInfo text="optional" />
353-
- A unique name for the bucket lock rule, used to identify and manage it.
352+
- `--name` <Type text="string" /> <MetaInfo text="optional" />
353+
- A unique name for the bucket lock rule, used to identify and manage it. For example: `retain-logs-180-days`.
354354
- `--prefix` <Type text="string" /> <MetaInfo text="optional" />
355355
- Prefix condition for the bucket lock rule (leave empty for all prefixes).
356356
- `--retention-days` <Type text="number" /> <MetaInfo text="optional" />
@@ -374,8 +374,8 @@ wrangler r2 bucket lock remove <NAME> [OPTIONS]
374374

375375
- `NAME` <Type text="string" /> <MetaInfo text="required" />
376376
- The name of the R2 bucket to remove a bucket lock rule from.
377-
- `--id` <Type text="string" /> <MetaInfo text="required" />
378-
- The unique identifier of the bucket lock rule to remove.
377+
- `--name` <Type text="string" /> <MetaInfo text="required" />
378+
- The unique name of the bucket lock rule to remove.
379379
- `--jurisdiction` <Type text="string" /> <MetaInfo text="optional" />
380380
- The jurisdiction where the bucket exists, if a jurisdiction has been specified. Refer to [jurisdictional restrictions](/r2/reference/data-location/#jurisdictional-restrictions).
381381

0 commit comments

Comments
 (0)