-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrouting.tf
60 lines (50 loc) · 1.39 KB
/
routing.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
data "aws_route53_zone" "primary" {
name = "${var.hosted_zone}"
private_zone = false
}
resource "aws_route53_health_check" "hs-aws" {
fqdn = "${aws_elb.my_elb.dns_name}"
port = 80
type = "HTTP"
resource_path = "/"
failure_threshold = "2"
request_interval = "30"
tags = {
Name = "tf-aws-health-check"
}
}
resource "aws_route53_health_check" "hs-azure" {
fqdn = "${azurerm_public_ip.tcspubip.fqdn}"
port = 80
type = "HTTP"
resource_path = "/"
failure_threshold = "2"
request_interval = "30"
tags = {
Name = "tf-azure-health-check"
}
}
resource "aws_route53_record" "tf-aws" {
zone_id = "${data.aws_route53_zone.primary.zone_id}"
name = "tf"
type = "CNAME"
ttl = 30
health_check_id = "${aws_route53_health_check.hs-aws.id}"
weighted_routing_policy {
weight = 10
}
set_identifier = "aws"
records = ["${aws_elb.my_elb.dns_name}"]
}
resource "aws_route53_record" "tf-azure" {
zone_id = "${data.aws_route53_zone.primary.zone_id}"
name = "tf"
type = "CNAME"
ttl = 30
health_check_id = "${aws_route53_health_check.hs-azure.id}"
weighted_routing_policy {
weight = 10
}
set_identifier = "azure"
records = ["${azurerm_public_ip.tcspubip.fqdn}"]
}