-
Notifications
You must be signed in to change notification settings - Fork 12
/
Copy pathvariables.tf
365 lines (308 loc) · 10.9 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
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
#Module : LABEL
#Description : Terraform label module variables.
variable "name" {
type = string
default = ""
description = "Name (e.g. `app` or `cluster`)."
}
variable "repository" {
type = string
default = "https://github.com/clouddrove/terraform-aws-s3"
description = "Terraform current module repo"
}
variable "environment" {
type = string
default = ""
description = "Environment (e.g. `prod`, `dev`, `staging`)."
}
variable "label_order" {
type = list(any)
default = []
description = "Label order, e.g. `name`,`application`."
}
variable "managedby" {
type = string
default = "[email protected]"
description = "ManagedBy, eg 'CloudDrove'."
}
# Module : S3 BUCKET
# Description : Terraform S3 Bucket module variables.
variable "enabled" {
type = bool
default = true
description = "Conditionally create S3 bucket."
}
variable "versioning" {
type = bool
default = true
description = "Enable Versioning of S3."
}
variable "acl" {
type = string
default = null
description = "Canned ACL to apply to the S3 bucket."
}
variable "enable_server_side_encryption" {
type = bool
default = false
description = "Enable enable_server_side_encryption"
}
variable "sse_algorithm" {
type = string
default = "AES256"
description = "The server-side encryption algorithm to use. Valid values are AES256 and aws:kms."
}
variable "enable_kms" {
type = bool
default = false
description = "Enable enable_server_side_encryption"
}
variable "kms_master_key_id" {
type = string
default = ""
description = "The AWS KMS master key ID 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 "enable_lifecycle_configuration_rules" {
type = bool
default = false
description = "enable or disable lifecycle_configuration_rules"
}
variable "lifecycle_configuration_rules" {
type = list(object({
id = string
enabled = bool
filter = any
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 = null
description = "A list of lifecycle rules"
}
# Module : S3 BUCKET POLICY
# Description : Terraform S3 Bucket Policy module variables.
variable "aws_iam_policy_document" {
type = string
default = ""
sensitive = true
description = "The text of the policy. Although this is a bucket policy rather than an IAM policy, the aws_iam_policy_document data source may be used, so long as it specifies a principal. For more information about building AWS IAM policy documents with Terraform, see the AWS IAM Policy Document Guide. Note: Bucket policies are limited to 20 KB in size."
}
variable "bucket_policy" {
type = bool
default = false
description = "Conditionally create S3 bucket policy."
}
variable "force_destroy" {
type = bool
default = false
description = "A boolean 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 "bucket_prefix" {
type = string
default = null
description = " (Optional, Forces new resource) Creates a unique bucket name beginning with the specified prefix."
}
variable "expected_bucket_owner" {
type = string
default = null
description = "The account ID of the expected bucket owner"
}
variable "owner" {
type = map(string)
default = {}
description = "Bucket owner's display name and ID. Conflicts with `acl`"
}
variable "grants" {
type = list(object({
id = string
type = string
permissions = list(string)
uri = string
}))
default = null
description = "ACL Policy grant.conflict with acl.set acl null to use this"
}
variable "acl_grants" {
type = list(object({
id = string
type = string
permission = string
uri = string
}))
default = null
description = "A list of policy grants for the bucket. Conflicts with `acl`. Set `acl` to `null` to use this."
}
variable "owner_id" {
type = string
default = ""
description = "The canonical user ID associated with the AWS account."
}
variable "logging" {
type = bool
default = false
description = "Logging Object to enable and disable logging"
}
variable "target_bucket" {
type = string
default = ""
description = "The bucket where you want Amazon S3 to store server access logs."
}
variable "target_prefix" {
type = string
default = ""
description = "A prefix for all log object keys."
}
variable "acceleration_status" {
type = bool
default = false
description = "Sets the accelerate configuration of an existing bucket. Can be Enabled or Suspended"
}
variable "request_payer" {
type = string
default = null
description = "(Optional) Specifies who should bear the cost of Amazon S3 data transfer. Can be either BucketOwner or Requester. By default, the owner of the S3 bucket would incur the costs of any data transfer. See Requester Pays Buckets developer guide for more information."
}
variable "website" {
type = any # map(string)
default = {}
description = "Map containing static web-site hosting or redirect configuration."
}
variable "object_lock_configuration" {
type = object({
mode = string #Valid values are GOVERNANCE and COMPLIANCE.
days = number
years = number
})
default = null
description = "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 "cors_rule" {
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 = "CORS Configuration specification for this bucket"
}
variable "replication_configuration" {
type = any
default = {}
description = "Map containing cross-region replication configuration."
}
variable "attach_public_policy" {
type = bool
default = true
description = "Controls if a user defined public bucket policy will be attached (set to `false` to allow upstream to apply defaults to the bucket)"
}
variable "block_public_acls" {
type = bool
default = true
description = "Whether Amazon S3 should block public ACLs for this bucket."
}
variable "block_public_policy" {
type = bool
default = true
description = "Whether Amazon S3 should block public bucket policies for this bucket."
}
variable "ignore_public_acls" {
description = "Whether Amazon S3 should ignore public ACLs for this bucket."
type = bool
default = true
}
variable "restrict_public_buckets" {
description = "Whether Amazon S3 should restrict public bucket policies for this bucket."
type = bool
default = true
}
variable "control_object_ownership" {
description = "Whether to manage S3 Bucket Ownership Controls on this bucket."
type = bool
default = false
}
variable "object_ownership" {
description = "Object ownership. Valid values: BucketOwnerEnforced, BucketOwnerPreferred or ObjectWriter. 'BucketOwnerEnforced': ACLs are disabled, and the bucket owner automatically owns and has full control over every object in the bucket. 'BucketOwnerPreferred': Objects uploaded to the bucket change ownership to the bucket owner if the objects are uploaded with the bucket-owner-full-control canned ACL. 'ObjectWriter': The uploading account will own the object if the object is uploaded with the bucket-owner-full-control canned ACL."
type = string
default = "ObjectWriter"
}
variable "configuration_status" {
type = string
default = "Enabled"
description = "Versioning state of the bucket. Valid values: Enabled, Suspended, or Disabled. Disabled should only be used when creating or importing resources that correspond to unversioned S3 buckets."
}
variable "versioning_status" {
type = string
default = "Enabled"
description = "Required if versioning_configuration mfa_delete is enabled) Concatenation of the authentication device's serial number, a space, and the value that is displayed on your authentication device."
}
variable "object_lock_enabled" {
type = bool
default = false
description = "Whether S3 bucket should have an Object Lock configuration enabled."
}
variable "analytics_configuration" {
type = any
default = {}
description = "Map containing bucket analytics configuration."
}
variable "vpc_endpoints" {
type = any
default = []
}
variable "timeouts" {
description = "Define maximum timeout for creating, updating, and deleting VPC endpoint resources"
type = map(string)
default = {}
}
variable "s3_name" {
type = string
default = null
description = "name of s3 bucket"
}
variable "only_https_traffic" {
type = bool
default = true
description = "This veriables use for only https traffic."
}
variable "block_http_bucket_policy" {
type = any
default = null
description = "Custome bucket policy to block https traffic"
}
variable "mfa_delete" {
type = string
default = "Disabled"
description = "Specifies whether MFA delete is enabled in the bucket versioning configuration. Valid values: Enabled or Disabled."
}
variable "intelligent_tiering" {
type = any
default = {}
description = "Map containing intelligent tiering configuration."
}
variable "metric_configuration" {
type = any
default = []
description = "Map containing bucket metric configuration."
}
variable "inventory_configuration" {
type = any
default = {}
description = "Map containing S3 inventory configuration."
}
variable "mfa" {
type = string
default = null
description = "Optional, Required if versioning_configuration mfa_delete is enabled) Concatenation of the authentication device's serial number, a space, and the value that is displayed on your authentication device."
}