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
# This lifecycle configuration rule will make that all objects that got a filter key that start with (path1/) be transferred
33
+
# from their default storage class (STANDARD, ONEZONE_IA) to GLACIER after 120 days counting
34
+
# from their creation and then 365 days after that they will be expired and deleted.
35
+
lifecycle_rule {
36
+
id = "id1"
37
+
prefix = "path1/"
38
+
enabled = true
39
+
40
+
expiration {
41
+
days = 365
42
+
}
43
+
44
+
transition {
45
+
days = 120
46
+
storage_class = "GLACIER"
47
+
}
48
+
}
49
+
50
+
# This lifecycle configuration rule specifies that all objects (identified by the key name prefix (path2/) in the rule)
51
+
# from their creation and then 50 days after that they will be expired and deleted.
52
+
lifecycle_rule {
53
+
id = "id2"
54
+
prefix = "path2/"
55
+
enabled = true
56
+
57
+
expiration {
58
+
days = "50"
59
+
}
60
+
}
61
+
62
+
# This lifecycle configuration rule remove any object with (path3/) prefix that match
63
+
# with the tags one day after creation.
64
+
lifecycle_rule {
65
+
id = "id3"
66
+
prefix = "path3/"
67
+
enabled = false
68
+
69
+
tags = {
70
+
"tagKey" = "tagValue"
71
+
"terraform" = "hashicorp"
72
+
}
73
+
74
+
expiration {
75
+
days = "1"
76
+
}
77
+
}
78
+
79
+
# This lifecycle configuration rule specifies a tag-based filter (tag1/value1).
80
+
# This rule directs Scaleway S3 to transition objects S3 Glacier class soon after creation.
81
+
# It is also disable temporaly.
82
+
lifecycle_rule {
83
+
id = "id4"
84
+
enabled = true
85
+
86
+
tags = {
87
+
"tag1" = "value1"
88
+
}
89
+
90
+
transition {
91
+
days = 0
92
+
storage_class = "GLACIER"
93
+
}
94
+
}
95
+
96
+
# This lifecycle configuration rule specifies with the AbortIncompleteMultipartUpload action to
97
+
# stop incomplete multipart uploads (identified by the key name prefix (path5/) in the rule)
98
+
# if they aren't completed within a specified number of days after initiation.
99
+
# Note: It's not recommended using prefix/ for AbortIncompleteMultipartUpload as any incomplete multipart upload will be billed
100
+
lifecycle_rule {
101
+
# prefix = "path5/"
102
+
enabled = true
103
+
abort_incomplete_multipart_upload_days = 30
104
+
}
105
+
}
106
+
```
107
+
24
108
## Arguments Reference
25
109
110
+
26
111
The following arguments are supported:
27
112
28
113
*`name` - (Required) The name of the bucket.
29
114
*`tags` - (Optional) A list of tags (key / value) for the bucket.
30
-
*`acl` - (Optional) The [canned ACL](https://docs.aws.amazon.com/AmazonS3/latest/userguide/acl_overview.html#canned-acl) you want to apply to the bucket.
115
+
*`acl` - (Optional) The canned ACL you want to apply to the bucket.
31
116
*`region` - (Optional) The [region](https://developers.scaleway.com/en/quickstart/#region-definition) in which the bucket should be created.
32
117
*`versioning` - (Optional) A state of [versioning](https://docs.aws.amazon.com/AmazonS3/latest/dev/Versioning.html) (documented below)
33
118
*`cors_rule` - (Optional) A rule of [Cross-Origin Resource Sharing](https://docs.aws.amazon.com/AmazonS3/latest/dev/cors.html) (documented below).
34
119
120
+
## The ACL
121
+
122
+
Please check the [canned ACL](https://docs.aws.amazon.com/AmazonS3/latest/userguide/acl_overview.html#canned-acl)
123
+
35
124
The `CORS` object supports the following:
36
125
37
126
*`allowed_headers` (Optional) Specifies which headers are allowed.
@@ -40,6 +129,35 @@ The `CORS` object supports the following:
40
129
*`expose_headers` (Optional) Specifies expose header in the response.
41
130
*`max_age_seconds` (Optional) Specifies time in seconds that browser can cache the response for a preflight request.
42
131
132
+
The `lifecycle_rule` (Optional) object supports the following:
133
+
134
+
*`id` - (Optional) Unique identifier for the rule. Must be less than or equal to 255 characters in length.
135
+
*`prefix` - (Optional) Object key prefix identifying one or more objects to which the rule applies.
136
+
*`tags` - (Optional) Specifies object tags key and value.
137
+
*`enabled` - (Required) The element value can be either Enabled or Disabled. If a rule is disabled, Scaleway S3 doesn't perform any of the actions defined in the rule.
138
+
139
+
*`abort_incomplete_multipart_upload_days` (Optional) Specifies the number of days after initiating a multipart upload when the multipart upload must be completed.
140
+
141
+
*~> **Important:** It's not recommended using `prefix` for `AbortIncompleteMultipartUpload` as any incomplete multipart upload will be billed
142
+
143
+
*`expiration` - (Optional) Specifies a period in the object's expire (documented below).
144
+
*`transition` - (Optional) Specifies a period in the object's transitions (documented below).
145
+
146
+
At least one of `abort_incomplete_multipart_upload_days`, `expiration`, `transition` must be specified.
147
+
148
+
The `expiration` object supports the following
149
+
150
+
*`days` (Optional) Specifies the number of days after object creation when the specific rule action takes effect.
151
+
152
+
~> **Important:** If versioning is enabled, this rule only deletes the current version of an object.
153
+
154
+
The `transition` object supports the following
155
+
156
+
*`days` (Optional) Specifies the number of days after object creation when the specific rule action takes effect.
157
+
*`storage_class` (Required) Specifies the Scaleway [storage class](https://www.scaleway.com/en/docs/storage/object/concepts/#storage-class)`STANDARD`, `GLACIER`, `ONEZONE_IA` to which you want the object to transition.
158
+
159
+
~> **Important:**`ONEZONE_IA` is only available in `fr-par` region. The storage class `GLACIER` is not available in `pl-waw` region.
160
+
43
161
The `versioning` object supports the following:
44
162
45
163
*`enabled` - (Optional) Enable versioning. Once you version-enable a bucket, it can never return to an unversioned state. You can, however, suspend versioning on that bucket.
@@ -50,6 +168,7 @@ In addition to all above arguments, the following attribute is exported:
50
168
51
169
*`id` - The unique name of the bucket.
52
170
*`endpoint` - The endpoint URL of the bucket
171
+
*`region` - The Scaleway region this bucket resides in.
0 commit comments