-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvariables.tf
65 lines (55 loc) · 1.4 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
variable "zone_id" {
description = "Zone ID for the zone to put records in"
type = string
}
variable "domain" {
description = "apex domain name of the DNS settings"
type = string
}
variable "verification_code" {
description = "verification code"
type = string
}
variable "ttl" {
description = "TTL in seconds. Between 60 and 86400 seconds, or 1 for Automatic"
type = number
default = 1
}
variable "allow_overwrite" {
description = "Enable/disable overwriting records"
type = bool
default = false
}
variable "tags" {
description = "tags for DNS records"
type = list(string)
default = []
}
variable "subdomain_mx" {
description = "MX records for Subdomain Addressing"
type = bool
default = false
}
variable "dmarc" {
description = "email address for DMARC rua"
type = object({
p = string
rua = optional(object({
mailto = optional(list(string))
}))
})
default = {
p = "quarantine"
}
validation {
error_message = "DMARC policy should be one of these: [none,quarantine,reject]"
condition = contains(["none", "quarantine", "reject"], var.dmarc.p)
}
validation {
error_message = "DMARC policy emails in `mailto` should be valid"
condition = alltrue([
for a in coalesce(try(var.dmarc.rua.mailto, null), []) :
can(regex("^[^@]+@[^@]+\\.[^@]+$", a))
])
}
}