-
Notifications
You must be signed in to change notification settings - Fork 0
/
cloudflare.tf
69 lines (63 loc) · 1.99 KB
/
cloudflare.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
# Zone info
data "cloudflare_zones" "dj_domain" {
filter {
name = local.domain_name
}
}
# A record for AWS server
resource "cloudflare_record" "aws_web" {
zone_id = lookup(data.cloudflare_zones.dj_domain.zones[0], "id")
name = local.domain_name
value = aws_instance.web.public_ip
type = "A"
ttl = 1
proxied = true
}
# Unique a record for AWS server
# Easier for debugging since direct link to aws- would not need this in prod
resource "cloudflare_record" "aws_unqiue_web" {
zone_id = lookup(data.cloudflare_zones.dj_domain.zones[0], "id")
name = "aws-app"
value = aws_instance.web.public_ip
type = "A"
ttl = 1
proxied = true
}
# A record for ibm cloud k8s
resource "cloudflare_record" "ibmcloud_web" {
zone_id = lookup(data.cloudflare_zones.dj_domain.zones[0], "id")
name = local.domain_name
value = data.ibm_container_cluster_worker.dj_cluster_solo_worker.public_ip
type = "A"
ttl = 1
proxied = true
}
# Unique a record for ibmcloud k8s
# Easier for debugging since direct link to ibm cloud- would not need this in prod
resource "cloudflare_record" "ibmcloud_unqiue_web" {
zone_id = lookup(data.cloudflare_zones.dj_domain.zones[0], "id")
name = "ibmcloud-app"
value = data.ibm_container_cluster_worker.dj_cluster_solo_worker.public_ip
type = "A"
ttl = 1
proxied = true
}
# A record for azure vm
resource "cloudflare_record" "azure_web" {
zone_id = lookup(data.cloudflare_zones.dj_domain.zones[0], "id")
name = local.domain_name
value = azurerm_linux_virtual_machine.web_server.public_ip_address
type = "A"
ttl = 1
proxied = true
}
# Unique a record for azure vm
# Easier for debugging since direct link to azure- would not need this in prod
resource "cloudflare_record" "azure_unqiue_web" {
zone_id = lookup(data.cloudflare_zones.dj_domain.zones[0], "id")
name = "azure-app"
value = azurerm_linux_virtual_machine.web_server.public_ip_address
type = "A"
ttl = 1
proxied = true
}