-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvariables.tf
60 lines (56 loc) · 1.31 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
variable "project_id" {
description = "GCP project id"
type = string
}
variable "location" {
description = "GCP location"
type = string
default = "europe-west1"
}
variable "labels" {
description = "Bucket labels"
type = map(string)
default = {}
}
variable "buckets_config" {
description = "Data lake configuration per bucket"
type = list(
object({
bucket_name = string
autoclass = optional(bool, true)
lifecycle_rules = optional(list(
object({
delay = number
storage_class = string
})
), [])
iam_rules = optional(list(
object({
role = string
principals = list(string)
})
), [])
notification_topic = optional(string, null)
regex_validation = optional(string, ".*")
})
)
validation {
condition = alltrue([
for bucket_config in var.buckets_config : !(bucket_config.autoclass == true && length(bucket_config.lifecycle_rules) != 0)
])
error_message = "Autoclass cannot be true while lifecyle_rules are defined"
}
}
variable "naming_convention" {
description = "Naming convention for each bucket"
type = object(
{
prefix = string
suffix = string
}
)
default = {
prefix = ""
suffix = ""
}
}