-
-
Notifications
You must be signed in to change notification settings - Fork 839
/
Copy pathvariables.tf
302 lines (259 loc) · 10 KB
/
variables.tf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
variable "acl" {
type = string
default = "private"
description = "The [canned ACL](https://docs.aws.amazon.com/AmazonS3/latest/dev/acl-overview.html#canned-acl) to apply. We recommend `private` to avoid exposing sensitive information. Conflicts with `grants`."
}
variable "grants" {
type = list(object({
id = string
type = string
permissions = list(string)
uri = string
}))
default = null
description = "An ACL policy grant. Conflicts with `acl`. Set `acl` to `null` to use this."
}
variable "policy" {
type = string
default = ""
description = "A valid bucket policy JSON document. Note that if the policy document is not specific enough (but still valid), Terraform may view the policy as constantly changing in a terraform plan. In this case, please make sure you use the verbose/specific version of the policy"
}
variable "force_destroy" {
type = bool
default = false
description = "A boolean string that indicates all objects should be deleted from the bucket so that the bucket can be destroyed without error. These objects are not recoverable"
}
variable "versioning_enabled" {
type = bool
default = true
description = "A state of versioning. Versioning is a means of keeping multiple variants of an object in the same bucket"
}
variable "logging" {
type = object({
bucket_name = string
prefix = string
})
default = null
description = "Bucket access logging configuration."
}
variable "sse_algorithm" {
type = string
default = "AES256"
description = "The server-side encryption algorithm to use. Valid values are `AES256` and `aws:kms`"
}
variable "kms_master_key_arn" {
type = string
default = ""
description = "The AWS KMS master key ARN used for the `SSE-KMS` encryption. This can only be used when you set the value of `sse_algorithm` as `aws:kms`. The default aws/s3 AWS KMS master key is used if this element is absent while the `sse_algorithm` is `aws:kms`"
}
variable "user_enabled" {
type = bool
default = false
description = "Set to `true` to create an IAM user with permission to access the bucket"
}
variable "allowed_bucket_actions" {
type = list(string)
default = ["s3:PutObject", "s3:PutObjectAcl", "s3:GetObject", "s3:DeleteObject", "s3:ListBucket", "s3:ListBucketMultipartUploads", "s3:GetBucketLocation", "s3:AbortMultipartUpload"]
description = "List of actions the user is permitted to perform on the S3 bucket"
}
variable "allow_encrypted_uploads_only" {
type = bool
default = false
description = "Set to `true` to prevent uploads of unencrypted objects to S3 bucket"
}
variable "allow_ssl_requests_only" {
type = bool
default = false
description = "Set to `true` to require requests to use Secure Socket Layer (HTTPS/SSL). This will explicitly deny access to HTTP requests"
}
variable "lifecycle_rule_ids" {
type = list(string)
default = []
description = "A list of IDs to assign to corresponding `lifecycle_rules`"
}
variable "lifecycle_rules" {
type = list(object({
prefix = string
enabled = bool
tags = map(string)
enable_glacier_transition = bool
enable_deeparchive_transition = bool
enable_standard_ia_transition = bool
enable_current_object_expiration = bool
enable_noncurrent_version_expiration = bool
abort_incomplete_multipart_upload_days = number
noncurrent_version_glacier_transition_days = number
noncurrent_version_deeparchive_transition_days = number
noncurrent_version_expiration_days = number
standard_transition_days = number
glacier_transition_days = number
deeparchive_transition_days = number
expiration_days = number
}))
default = [{
enabled = false
prefix = ""
tags = {}
enable_glacier_transition = true
enable_deeparchive_transition = false
enable_standard_ia_transition = false
enable_current_object_expiration = true
enable_noncurrent_version_expiration = true
abort_incomplete_multipart_upload_days = 90
noncurrent_version_glacier_transition_days = 30
noncurrent_version_deeparchive_transition_days = 60
noncurrent_version_expiration_days = 90
standard_transition_days = 30
glacier_transition_days = 60
deeparchive_transition_days = 90
expiration_days = 90
}]
description = "A list of lifecycle rules"
}
variable "cors_rule_inputs" {
type = list(object({
allowed_headers = list(string)
allowed_methods = list(string)
allowed_origins = list(string)
expose_headers = list(string)
max_age_seconds = number
}))
default = null
description = "Specifies the allowed headers, methods, origins and exposed headers when using CORS on this bucket"
}
variable "block_public_acls" {
type = bool
default = true
description = "Set to `false` to disable the blocking of new public access lists on the bucket"
}
variable "block_public_policy" {
type = bool
default = true
description = "Set to `false` to disable the blocking of new public policies on the bucket"
}
variable "ignore_public_acls" {
type = bool
default = true
description = "Set to `false` to disable the ignoring of public access lists on the bucket"
}
variable "restrict_public_buckets" {
type = bool
default = true
description = "Set to `false` to disable the restricting of making the bucket public"
}
variable "s3_replication_enabled" {
type = bool
default = false
description = "Set this to true and specify `s3_replication_rules` to enable replication. `versioning_enabled` must also be `true`."
}
variable "s3_replica_bucket_arn" {
type = string
default = ""
description = <<-EOT
A single S3 bucket ARN to use for all replication rules.
Note: The destination bucket can be specified in the replication rule itself
(which allows for multiple destinations), in which case it will take precedence over this variable.
EOT
}
variable "s3_replication_rules" {
# type = list(object({
# id = string
# priority = number
# prefix = string
# status = string
# delete_marker_replication_status = string
# # destination_bucket is specified here rather than inside the destination object
# # to make it easier to work with the Terraform type system and create a list of consistent type.
# destination_bucket = string # destination bucket ARN, overrides s3_replica_bucket_arn
#
# destination = object({
# storage_class = string
# replica_kms_key_id = string
# access_control_translation = object({
# owner = string
# })
# account_id = string
# metrics = object({
# status = string
# })
# })
# source_selection_criteria = object({
# sse_kms_encrypted_objects = object({
# enabled = bool
# })
# })
# # filter.prefix overrides top level prefix
# filter = object({
# prefix = string
# tags = map(string)
# })
# }))
type = list(any)
default = null
description = "Specifies the replication rules for S3 bucket replication if enabled. You must also set s3_replication_enabled to true."
}
variable "replication_rules" {
type = list(any)
default = null
description = "DEPRECATED: Use s3_replication_rules instead."
}
variable "s3_replication_source_roles" {
type = list(string)
default = []
description = "Cross-account IAM Role ARNs that will be allowed to perform S3 replication to this bucket (for replication within the same AWS account, it's not necessary to adjust the bucket policy)."
}
variable "bucket_name" {
type = string
default = null
description = "Bucket name. If provided, the bucket will be created with this name instead of generating the name from the context"
}
variable "object_lock_configuration" {
type = object({
mode = string # Valid values are GOVERNANCE and COMPLIANCE.
days = number
years = number
})
default = null
description = "A configuration for S3 object locking. With S3 Object Lock, you can store objects using a `write once, read many` (WORM) model. Object Lock can help prevent objects from being deleted or overwritten for a fixed amount of time or indefinitely."
}
variable "website_inputs" {
type = list(object({
index_document = string
error_document = string
redirect_all_requests_to = string
routing_rules = string
}))
default = null
description = "Specifies the static website hosting configuration object."
}
variable "privileged_principal_arns" {
type = map(list(string))
default = {}
description = <<-EOT
(Optional) Map of IAM Principal ARNs to lists of S3 path prefixes to grant `privileged_principal_actions` permissions.
Resource list will include the bucket itself along with all the prefixes. Prefixes should not begin with '/'.
EOT
}
variable "privileged_principal_actions" {
type = list(string)
default = []
description = "List of actions to permit `privileged_principal_arns` to perform on bucket and bucket prefixes (see `privileged_principal_arns`)"
}
variable "transfer_acceleration_enabled" {
type = bool
default = false
description = "Set this to true to enable S3 Transfer Acceleration for the bucket."
}
variable "s3_object_ownership" {
type = string
default = "ObjectWriter"
description = "Specifies the S3 object ownership control. Valid values are `ObjectWriter`, `BucketOwnerPreferred`, and 'BucketOwnerEnforced'."
}
variable "bucket_key_enabled" {
type = bool
default = false
description = <<-EOT
Set this to true to use Amazon S3 Bucket Keys for SSE-KMS, which reduce the cost of AWS KMS requests.
For more information, see: https://docs.aws.amazon.com/AmazonS3/latest/userguide/bucket-key.html
EOT
}