-
-
Notifications
You must be signed in to change notification settings - Fork 100
/
variables.tf
230 lines (204 loc) · 8.04 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
variable "bucket_name" {
type = string
description = <<-EOT
Bucket name. If provided, the bucket will be created with this name
instead of generating the name from the context.
EOT
default = ""
nullable = false
}
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 "acl" {
type = string
description = <<-EOT
The [canned ACL](https://docs.aws.amazon.com/AmazonS3/latest/dev/acl-overview.html#canned-acl) to apply.
Deprecated by AWS in favor of bucket policies.
Automatically disabled if `s3_object_ownership` is set to "BucketOwnerEnforced".
Defaults to "private" for backwards compatibility, but we recommend setting `s3_object_ownership` to "BucketOwnerEnforced" instead.
EOT
default = "log-delivery-write"
}
variable "grants" {
type = list(object({
id = string
type = string
permissions = list(string)
uri = string
}))
description = <<-EOT
A list of policy grants for the bucket, taking a list of permissions.
Conflicts with `acl`. Set `acl` to `null` to use this.
Deprecated by AWS in favor of bucket policies, but still required for some log delivery services.
Automatically disabled if `s3_object_ownership` is set to "BucketOwnerEnforced".
EOT
default = []
nullable = false
}
variable "source_policy_documents" {
type = list(string)
description = <<-EOT
List of IAM policy documents that are merged together into the exported document.
Statements defined in source_policy_documents must have unique SIDs.
Statement having SIDs that match policy SIDs generated by this module will override them.
EOT
default = []
nullable = false
}
variable "s3_object_ownership" {
type = string
description = "Specifies the S3 object ownership control. Valid values are `ObjectWriter`, `BucketOwnerPreferred`, and 'BucketOwnerEnforced'."
default = "BucketOwnerPreferred"
nullable = false
}
variable "force_destroy" {
type = bool
default = false
description = <<-EOT
When `true`, permits a non-empty S3 bucket to be deleted by first deleting all objects in the bucket.
THESE OBJECTS ARE NOT RECOVERABLE even if they were versioned and stored in Glacier.
Must be set `false` unless `force_destroy_enabled` is also `true`.
EOT
nullable = false
}
variable "versioning_enabled" {
type = bool
description = "Enable object versioning, keeping multiple variants of an object in the same bucket"
default = true
nullable = false
}
variable "sse_algorithm" {
type = string
default = "AES256"
description = "The server-side encryption algorithm to use. Valid values are AES256 and aws:kms"
nullable = false
}
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"
nullable = false
}
variable "bucket_key_enabled" {
type = bool
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
default = false
nullable = false
}
variable "block_public_acls" {
type = bool
description = "Set to `false` to disable the blocking of new public access lists on the bucket"
default = true
nullable = false
}
variable "block_public_policy" {
type = bool
description = "Set to `false` to disable the blocking of new public policies on the bucket"
default = true
nullable = false
}
variable "ignore_public_acls" {
type = bool
description = "Set to `false` to disable the ignoring of public access lists on the bucket"
default = true
nullable = false
}
variable "restrict_public_buckets" {
type = bool
description = "Set to `false` to disable the restricting of making the bucket public"
default = true
nullable = false
}
variable "access_log_bucket_name" {
type = string
description = "Name of the S3 bucket where S3 access logs will be sent to"
default = ""
nullable = false
}
variable "access_log_bucket_prefix" {
type = string
description = "Prefix to prepend to the current S3 bucket name, where S3 access logs will be sent to"
default = "logs/"
nullable = false
}
variable "allow_encrypted_uploads_only" {
type = bool
description = "Set to `true` to prevent uploads of unencrypted objects to S3 bucket"
default = false
nullable = false
}
variable "allow_ssl_requests_only" {
type = bool
description = "Set to `true` to require requests to use Secure Socket Layer (HTTPS/SSL). This will explicitly deny access to HTTP requests"
default = true
nullable = false
}
variable "bucket_notifications_enabled" {
type = bool
description = "Send notifications for the object created events. Used for 3rd-party log collection from a bucket"
default = false
nullable = false
}
variable "bucket_notifications_type" {
type = string
description = "Type of the notification configuration. Only SQS is supported."
default = "SQS"
nullable = false
}
variable "bucket_notifications_prefix" {
type = string
description = "Prefix filter. Used to manage object notifications"
default = ""
nullable = false
}
variable "lifecycle_configuration_rules" {
type = list(object({
enabled = bool
id = string
abort_incomplete_multipart_upload_days = number
# `filter_and` is the `and` configuration block inside the `filter` configuration.
# This is the only place you should specify a prefix.
filter_and = optional(object({
object_size_greater_than = optional(number) # integer >= 0
object_size_less_than = optional(number) # integer >= 1
prefix = optional(string)
tags = optional(map(string))
}))
expiration = optional(object({
date = optional(string) # string, RFC3339 time format, GMT
days = optional(number) # integer > 0
expired_object_delete_marker = optional(bool)
}))
noncurrent_version_expiration = optional(object({
newer_noncurrent_versions = optional(number) # integer > 0
noncurrent_days = optional(number) # integer >= 0
}))
transition = optional(list(object({
date = optional(string) # string, RFC3339 time format, GMT
days = optional(number) # integer >= 0
storage_class = string # string/enum, one of GLACIER, STANDARD_IA, ONEZONE_IA, INTELLIGENT_TIERING, DEEP_ARCHIVE, GLACIER_IR.
})), [])
noncurrent_version_transition = optional(list(object({
newer_noncurrent_versions = optional(number) # integer >= 0
noncurrent_days = optional(number) # integer >= 0
storage_class = string # string/enum, one of GLACIER, STANDARD_IA, ONEZONE_IA, INTELLIGENT_TIERING, DEEP_ARCHIVE, GLACIER_IR.
})), [])
}))
description = <<-EOT
A list of S3 bucket v2 lifecycle rules, as specified in [terraform-aws-s3-bucket](https://github.com/cloudposse/terraform-aws-s3-bucket)"
These rules are not affected by the deprecated `lifecycle_rule_enabled` flag.
**NOTE:** Unless you also set `lifecycle_rule_enabled = false` you will also get the default deprecated rules set on your bucket.
EOT
default = []
nullable = false
}