-
Notifications
You must be signed in to change notification settings - Fork 0
/
dns.tf
92 lines (72 loc) · 2.13 KB
/
dns.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
resource "azurerm_dns_zone" "zone" {
name = "danielsteinke.com"
resource_group_name = azurerm_resource_group.rg.name
provisioner "local-exec" {
command = <<CMD
make dns-sync GD_API_KEY=${var.gd_api_key} GD_API_SECRET=${var.gd_api_secret} \
GD_SHOPPER_ID=${var.gd_shopper_id} TARGET_DOMAIN=${var.target_domain} NS_DATA=${jsonencode(azurerm_dns_zone.zone.name_servers)}
CMD
}
}
resource "time_sleep" "wait_two_minutes" {
depends_on = [azurerm_dns_zone.zone]
create_duration = "2m"
}
resource "azurerm_dns_mx_record" "mx" {
zone_name = azurerm_dns_zone.zone.name
resource_group_name = azurerm_resource_group.rg.name
record {
preference = 10
exchange = "mx01.mail.icloud.com"
}
name = "@"
record {
preference = 10
exchange = "mx02.mail.icloud.com"
}
ttl = 300
}
resource "azurerm_dns_txt_record" "txt" {
zone_name = azurerm_dns_zone.zone.name
resource_group_name = azurerm_resource_group.rg.name
name = "@"
record {
value = "v=spf1 include:icloud.com ~all"
}
ttl = 300
}
resource "azurerm_dns_cname_record" "dkim" {
zone_name = azurerm_dns_zone.zone.name
resource_group_name = azurerm_resource_group.rg.name
name = "sig1._domainkey"
record = "sig1.dkim.danielsteinke.com.at.icloudmailadmin.com."
ttl = 300
}
resource "azurerm_dns_a_record" "apex" {
zone_name = azurerm_dns_zone.zone.name
resource_group_name = azurerm_resource_group.rg.name
name = "@"
target_resource_id = azurerm_cdn_endpoint.endpoint.id
ttl = 300
}
resource "azurerm_dns_a_record" "www" {
zone_name = azurerm_dns_zone.zone.name
resource_group_name = azurerm_resource_group.rg.name
name = "www"
target_resource_id = azurerm_cdn_endpoint.endpoint.id
ttl = 300
}
resource "azurerm_dns_cname_record" "cdnverify_www" {
zone_name = azurerm_dns_zone.zone.name
resource_group_name = azurerm_resource_group.rg.name
name = "cdnverify.www"
record = "cdnverify.${azurerm_cdn_endpoint.endpoint.fqdn}"
ttl = 300
}
resource "azurerm_dns_cname_record" "cdnverify_apex" {
zone_name = azurerm_dns_zone.zone.name
resource_group_name = azurerm_resource_group.rg.name
name = "cdnverify"
record = "cdnverify.${azurerm_cdn_endpoint.endpoint.fqdn}"
ttl = 300
}