-
-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathmain.tf
More file actions
137 lines (115 loc) · 4.61 KB
/
main.tf
File metadata and controls
137 lines (115 loc) · 4.61 KB
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
locals {
metadata = {
package = "terraform-aws-domain"
version = trimspace(file("${path.module}/../../VERSION"))
module = basename(path.module)
name = var.name
}
module_tags = var.module_tags_enabled ? {
"module.terraform.io/package" = local.metadata.package
"module.terraform.io/version" = local.metadata.version
"module.terraform.io/name" = local.metadata.module
"module.terraform.io/full-name" = "${local.metadata.package}/${local.metadata.module}"
"module.terraform.io/instance" = local.metadata.name
} : {}
}
locals {
transfer_lock_unsupported_tlds = [".fi"]
}
###################################################
# Registred Domain in Route53 Registry
###################################################
# INFO: Not supported attributes
# - `name_server.glue_ips`
resource "aws_route53domains_registered_domain" "this" {
domain_name = var.name
auto_renew = var.auto_renew_enabled
transfer_lock = (anytrue([
for tld in local.transfer_lock_unsupported_tlds :
endswith(var.name, tld)]
) ? false : var.transfer_lock_enabled)
## Name Servers
dynamic "name_server" {
for_each = var.name_servers
content {
name = name_server.value
}
}
## Privacy Protection
admin_privacy = var.admin_contact.privacy_protection_enabled
billing_privacy = var.billing_contact.privacy_protection_enabled
registrant_privacy = var.registrant_contact.privacy_protection_enabled
tech_privacy = var.technical_contact.privacy_protection_enabled
## Contacts
admin_contact {
contact_type = var.admin_contact.type
organization_name = var.admin_contact.organization
first_name = var.admin_contact.first_name
last_name = var.admin_contact.last_name
email = var.admin_contact.email
phone_number = var.admin_contact.phone
fax = var.admin_contact.fax
country_code = var.admin_contact.country_code
state = var.admin_contact.state
city = var.admin_contact.city
address_line_1 = var.admin_contact.address_line_1
address_line_2 = var.admin_contact.address_line_2
zip_code = var.admin_contact.postal_code
extra_params = var.admin_contact.extra_params
}
billing_contact {
contact_type = var.billing_contact.type
organization_name = var.billing_contact.organization
first_name = var.billing_contact.first_name
last_name = var.billing_contact.last_name
email = var.billing_contact.email
phone_number = var.billing_contact.phone
fax = var.billing_contact.fax
country_code = var.billing_contact.country_code
state = var.billing_contact.state
city = var.billing_contact.city
address_line_1 = var.billing_contact.address_line_1
address_line_2 = var.billing_contact.address_line_2
zip_code = var.billing_contact.postal_code
extra_params = var.admin_contact.extra_params
}
registrant_contact {
contact_type = var.registrant_contact.type
organization_name = var.registrant_contact.organization
first_name = var.registrant_contact.first_name
last_name = var.registrant_contact.last_name
email = var.registrant_contact.email
phone_number = var.registrant_contact.phone
fax = var.registrant_contact.fax
country_code = var.registrant_contact.country_code
state = var.registrant_contact.state
city = var.registrant_contact.city
address_line_1 = var.registrant_contact.address_line_1
address_line_2 = var.registrant_contact.address_line_2
zip_code = var.registrant_contact.postal_code
extra_params = var.admin_contact.extra_params
}
tech_contact {
contact_type = var.technical_contact.type
organization_name = var.technical_contact.organization
first_name = var.technical_contact.first_name
last_name = var.technical_contact.last_name
email = var.technical_contact.email
phone_number = var.technical_contact.phone
fax = var.technical_contact.fax
country_code = var.technical_contact.country_code
state = var.technical_contact.state
city = var.technical_contact.city
address_line_1 = var.technical_contact.address_line_1
address_line_2 = var.technical_contact.address_line_2
zip_code = var.technical_contact.postal_code
extra_params = var.admin_contact.extra_params
}
tags = merge(
{
"Name" = local.metadata.name
},
local.module_tags,
var.tags,
)
}