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
Copy file name to clipboardExpand all lines: src/content/docs/r2/buckets/bucket-locks.mdx
+5-3Lines changed: 5 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -3,6 +3,8 @@ title: Bucket locks
3
3
pcx_content_type: how-to
4
4
---
5
5
6
+
import { DashButton } from"~/components";
7
+
6
8
Bucket locks prevent the deletion and overwriting of objects in an R2 bucket for a specified period — or indefinitely. When enabled, bucket locks enforce retention policies on your objects, helping protect them from accidental or premature deletions.
7
9
8
10
## Get started with bucket locks
@@ -14,7 +16,7 @@ Before getting started, you will need:
14
16
15
17
### Enable bucket lock via dashboard
16
18
17
-
1.From the Cloudflare dashboard, select **R2** from the sidebar.
19
+
1.<DashButtonurl="/?to=/:account/r2/overview" />
18
20
2. Select the bucket you would like to add bucket lock rule to.
19
21
3. Switch to the **Settings** tab, then scroll down to the **Bucket lock rules** card.
20
22
4. Select **Add rule** and enter the rule name, prefix, and retention period.
@@ -87,7 +89,7 @@ If your bucket is setup with [jurisdictional restrictions](/r2/reference/data-lo
87
89
88
90
### Dashboard
89
91
90
-
1.From the Cloudflare dashboard, select **R2** from the sidebar.
92
+
1.<DashButtonurl="/?to=/:account/r2/overview" />
91
93
2. Select the bucket you would like to add bucket lock rule to.
92
94
3. Switch to the **Settings** tab, then scroll down to the **Bucket lock rules** card.
93
95
@@ -107,7 +109,7 @@ For more information on required parameters and examples of how to get bucket lo
107
109
108
110
### Dashboard
109
111
110
-
1.From the Cloudflare dashboard, select **R2** from the sidebar.
112
+
1.<DashButtonurl="/?to=/:account/r2/overview" />
111
113
2. Select the bucket you would like to add bucket lock rule to.
112
114
3. Switch to the **Settings** tab, then scroll down to the **Bucket lock rules** card.
113
115
4. Locate the rule you want to remove, select the `...` icon next to it, and then select **Delete**.
Event notifications send messages to your [queue](/queues/) when data in your R2 bucket changes. You can consume these messages with a [consumer Worker](/queues/reference/how-queues-works/#create-a-consumer-worker) or [pull over HTTP](/queues/configuration/pull-consumers/) from outside of Cloudflare Workers.
7
9
8
10
## Get started with event notifications
@@ -17,7 +19,7 @@ Before getting started, you will need:
17
19
18
20
### Enable event notifications via Dashboard
19
21
20
-
1.From the Cloudflare dashboard, select **R2** from the sidebar.
22
+
1.<DashButtonurl="/?to=/:account/r2/overview" />
21
23
2. Select the bucket you'd like to add an event notification rule to.
22
24
3. Switch to the **Settings** tab, then scroll down to the **Event notifications** card.
23
25
4. Select **Add notification** and choose the queue you'd like to receive notifications and the [type of events](/r2/buckets/event-notifications/#event-types) that will trigger them.
Triggered when new objects are created or existing objects are
72
-
overwritten.
73
-
</td>
74
-
<td>
75
-
<ul>
76
-
<li>
77
-
<code>PutObject</code>
78
-
</li>
79
-
<li>
80
-
<code>CopyObject</code>
81
-
</li>
82
-
<li>
83
-
<code>CompleteMultipartUpload</code>
84
-
</li>
85
-
</ul>
86
-
</td>
87
-
</tr>
88
-
<tr>
89
-
<td>
90
-
<code>object-delete</code>
91
-
</td>
92
-
<td>Triggered when an object is explicitly removed from the bucket.</td>
93
-
<td>
94
-
<ul>
95
-
<li>
96
-
<code>DeleteObject</code>
97
-
</li>
98
-
<li>
99
-
<code>LifecycleDeletion</code>
100
-
</li>
101
-
</ul>
102
-
</td>
103
-
</tr>
104
-
</tbody>
105
-
</table>
63
+
| Event type | Description | Trigger actions |
64
+
|------------|-------------|----------------|
65
+
|`object-create`| Triggered when new objects are created or existing objects are overwritten. | <ul><li>`PutObject`</li><li>`CopyObject`</li><li>`CompleteMultipartUpload`</li></ul> |
66
+
|`object-delete`| Triggered when an object is explicitly removed from the bucket. | <ul><li>`DeleteObject`</li><li>`LifecycleDeletion`</li></ul> |
106
67
107
68
## Message format
108
69
@@ -128,106 +89,19 @@ Queue consumers receive notifications as [Messages](/queues/configuration/javasc
128
89
129
90
### Properties
130
91
131
-
<table>
132
-
<tbody>
133
-
<thstyle="width:22%">Property</th>
134
-
<thstyle="width:18%">Type</th>
135
-
<thstyle="width:60%">Description</th>
136
-
<tr>
137
-
<td>
138
-
<code>account</code>
139
-
</td>
140
-
<td>String</td>
141
-
<td>The Cloudflare account ID that the event is associated with.</td>
142
-
</tr>
143
-
<tr>
144
-
<td>
145
-
<code>action</code>
146
-
</td>
147
-
<td>String</td>
148
-
<td>
149
-
The type of action that triggered the event notification. Example
<td>The name of the bucket where the event occurred.</td>
160
-
</tr>
161
-
<tr>
162
-
<td>
163
-
<code>object</code>
164
-
</td>
165
-
<td>Object</td>
166
-
<td>
167
-
A nested object containing details about the object involved in the
168
-
event.
169
-
</td>
170
-
</tr>
171
-
<tr>
172
-
<td>
173
-
<code>object.key</code>
174
-
</td>
175
-
<td>String</td>
176
-
<td>The key (or name) of the object within the bucket.</td>
177
-
</tr>
178
-
<tr>
179
-
<td>
180
-
<code>object.size</code>
181
-
</td>
182
-
<td>Number</td>
183
-
<td>
184
-
The size of the object in bytes. Note: not present for object-delete
185
-
events.
186
-
</td>
187
-
</tr>
188
-
<tr>
189
-
<td>
190
-
<code>object.eTag</code>
191
-
</td>
192
-
<td>String</td>
193
-
<td>
194
-
The entity tag (eTag) of the object. Note: not present for object-delete
195
-
events.
196
-
</td>
197
-
</tr>
198
-
<tr>
199
-
<td>
200
-
<code>eventTime</code>
201
-
</td>
202
-
<td>String</td>
203
-
<td>The time when the action that triggered the event occurred.</td>
204
-
</tr>
205
-
<tr>
206
-
<td>
207
-
<code>copySource</code>
208
-
</td>
209
-
<td>Object</td>
210
-
<td>
211
-
A nested object containing details about the source of a copied object.
212
-
Note: only present for events triggered by <code>CopyObject</code>.
213
-
</td>
214
-
</tr>
215
-
<tr>
216
-
<td>
217
-
<code>copySource.bucket</code>
218
-
</td>
219
-
<td>String</td>
220
-
<td>The bucket that contained the source object.</td>
221
-
</tr>
222
-
<tr>
223
-
<td>
224
-
<code>copySource.object</code>
225
-
</td>
226
-
<td>String</td>
227
-
<td>The name of the source object.</td>
228
-
</tr>
229
-
</tbody>
230
-
</table>
92
+
| Property | Type | Description |
93
+
|----------|------|-------------|
94
+
|`account`| String | The Cloudflare account ID that the event is associated with. |
95
+
|`action`| String | The type of action that triggered the event notification. Example actions include: `PutObject`, `CopyObject`, `CompleteMultipartUpload`, `DeleteObject`. |
96
+
|`bucket`| String | The name of the bucket where the event occurred. |
97
+
|`object`| Object | A nested object containing details about the object involved in the event. |
98
+
|`object.key`| String | The key (or name) of the object within the bucket. |
99
+
|`object.size`| Number | The size of the object in bytes. Note: not present for object-delete events. |
100
+
|`object.eTag`| String | The entity tag (eTag) of the object. Note: not present for object-delete events. |
101
+
|`eventTime`| String | The time when the action that triggered the event occurred. |
102
+
|`copySource`| Object | A nested object containing details about the source of a copied object. Note: only present for events triggered by `CopyObject`. |
103
+
|`copySource.bucket`| String | The bucket that contained the source object. |
104
+
|`copySource.object`| String | The name of the source object. |
Copy file name to clipboardExpand all lines: src/content/docs/r2/buckets/object-lifecycles.mdx
+4-2Lines changed: 4 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -3,6 +3,8 @@ title: Object lifecycles
3
3
pcx_content_type: how-to
4
4
---
5
5
6
+
import { DashButton } from"~/components";
7
+
6
8
Object lifecycles determine the retention period of objects uploaded to your bucket and allow you to specify when objects should transition from Standard storage to Infrequent Access storage.
7
9
8
10
A lifecycle configuration is a collection of lifecycle rules that define actions to apply to objects during their lifetime.
@@ -27,7 +29,7 @@ When you create an object lifecycle rule, you can specify which prefix you would
27
29
28
30
### Dashboard
29
31
30
-
1.From the Cloudflare dashboard, select **R2**.
32
+
1.<DashButtonurl="/?to=/:account/r2/overview" />
31
33
2. Locate and select your bucket from the list.
32
34
3. From the bucket page, select **Settings**.
33
35
4. Under **Object Lifecycle Rules**, select **Add rule**.
@@ -176,7 +178,7 @@ console.log(
176
178
177
179
### Dashboard
178
180
179
-
1.From the Cloudflare dashboard, select **R2**.
181
+
1.<DashButtonurl="/?to=/:account/r2/overview" />
180
182
2. Locate and select your bucket from the list.
181
183
3. From the bucket page, select **Settings**.
182
184
4. Under **Object lifecycle rules**, select the rules you would like to delete.
Copy file name to clipboardExpand all lines: src/content/docs/r2/buckets/public-buckets.mdx
+4-4Lines changed: 4 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -101,7 +101,7 @@ To remove a domain:
101
101
1. In **R2**, select the bucket you want to modify.
102
102
2. On the bucket page, Select **Settings**, go to **Custom Domains**.
103
103
3. Next to the domain you want to disable, select **...** and **Remove domain**.
104
-
4. Select ‘Remove domain’ in the confirmation window. This step also removes the CNAME record pointing to the domain. You can always add the domain again.
104
+
4. Select **Remove domain** in the confirmation window. This step also removes the CNAME record pointing to the domain. You can always add the domain again.
105
105
106
106
## Public development URL
107
107
@@ -125,14 +125,14 @@ To enable access through `r2.dev` for your buckets:
125
125
1. In **R2**, select the bucket you want to modify.
126
126
2. On the bucket page, select **Settings**.
127
127
3. Under **Public Development URL**, select **Enable**.
128
-
4. In **Allow Public Access?**, confirm your choice by typing ‘allow’ to confirm and select **Allow**.
128
+
4. In **Allow Public Access?**, confirm your choice by typing `allow` to confirm and select **Allow**.
129
129
5. You can now access the bucket and its objects using the Public Bucket URL.
130
130
131
131
To verify that your bucket is publicly accessible, check that **Public URL Access** shows **Allowed** in you bucket settings.
132
132
133
133
### Disable public development url
134
134
135
-
Disabling public development URL access removes your bucket’s exposure through the `r2.dev` subdomain. The bucket and its objects will no longer be accessible via the Public Bucket URL.
135
+
Disabling public development URL access removes your bucket's exposure through the `r2.dev` subdomain. The bucket and its objects will no longer be accessible via the Public Bucket URL.
136
136
137
137
If you have connected other domains, the bucket will remain accessible for those domains.
138
138
@@ -141,4 +141,4 @@ To disable public access for your bucket:
141
141
1. In **R2**, select the bucket you want to modify.
142
142
2. On the bucket page, select **Settings**.
143
143
3. Under **Public Development URL**, select **Disable**.
144
-
4. In **Disallow Public Access?**, type ‘disallow’ to confirm and select **Disallow**.
144
+
4. In **Disallow Public Access?**, type `disallow` to confirm and select **Disallow**.
This feature is currently in beta. To report bugs or request features, go to the #r2 channel in the [Cloudflare Developer Discord](https://discord.cloudflare.com) or fill out the [feedback form](https://forms.gle/5FqffSHcsL8ifEG8A).
44
-
45
-
46
42
:::
47
43
48
44
Infrequent Access storage is ideal for data that is accessed less frequently. This storage class offers lower storage cost compared to Standard storage, but includes [retrieval fees](/r2/pricing/#data-retrieval) and a 30 day [minimum storage duration](/r2/pricing/#minimum-storage-duration) requirement.
49
45
50
46
:::note
51
-
52
-
53
47
For objects stored in Infrequent Access storage, you will be charged for the object for the minimum storage duration even if the object was deleted, moved, or replaced before the specified duration.
54
-
55
-
56
48
:::
57
49
58
50
#### Example use cases
@@ -76,11 +68,7 @@ To learn more about how to specify the storage class for new objects, refer to t
76
68
### Use object lifecycle rules to transition objects to Infrequent Access storage
77
69
78
70
:::note
79
-
80
-
81
71
Once an object is stored in Infrequent Access, it cannot be transitioned to Standard Access using lifecycle policies.
82
-
83
-
84
72
:::
85
73
86
74
To learn more about how to transition objects from Standard storage to Infrequent Access storage, refer to [Object lifecycles](/r2/buckets/object-lifecycles/).
0 commit comments