-
Notifications
You must be signed in to change notification settings - Fork 16
/
Copy pathroute53-dns-failover.json
102 lines (102 loc) · 2.48 KB
/
route53-dns-failover.json
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
{
"AWSTemplateFormatVersion": "2010-09-09",
"Description": "'A' record to 'Alias' record DNS failover.",
"Parameters": {
"PrimaryRecord": {
"Type": "String",
"Description": "The primary record. A standard 'A' record to an IP address.",
"Default": "1.2.3.4"
},
"SecondaryRecord": {
"Type": "String",
"Description": "The secondary record (fallback). An alias 'A' record to a CloudFront distribution."
},
"DomainName": {
"Type": "String",
"Description": "The domain name.",
"Default": "example.com"
},
"HealthCheckPath": {
"Type": "String",
"Description": "The URL to perform the health check against.",
"Default": "/index.html"
},
"HostedZoneId": {
"Type": "String",
"Description": "The Route53 HostedZoneId to create these records in."
}
},
"Resources": {
"HealthCheck": {
"Type": "AWS::Route53::HealthCheck",
"Properties": {
"HealthCheckConfig": {
"FailureThreshold": 3,
"IPAddress": {
"Ref": "PrimaryRecord"
},
"FullyQualifiedDomainName": {
"Ref": "DomainName"
},
"Port": 80,
"RequestInterval": 30,
"ResourcePath": {
"Ref": "HealthCheckPath"
},
"Type": "HTTP"
},
"HealthCheckTags": [
{
"Key": "Name",
"Value": {
"Ref": "DomainName"
}
}
]
}
},
"ThePrimaryRecord": {
"Type": "AWS::Route53::RecordSet",
"Properties": {
"Failover": "PRIMARY",
"HealthCheckId": {
"Ref": "HealthCheck"
},
"HostedZoneId": {
"Ref": "HostedZoneId"
},
"Name": {
"Ref": "DomainName"
},
"ResourceRecords": [
{
"Ref": "PrimaryRecord"
}
],
"SetIdentifier": "primary-record",
"TTL": "60",
"Type": "A"
}
},
"TheSecondaryRecord": {
"Type": "AWS::Route53::RecordSet",
"Properties": {
"AliasTarget": {
"DNSName": {
"Ref": "SecondaryRecord"
},
"HostedZoneId": "Z2FDTNDATAQYW2"
},
"Failover": "SECONDARY",
"HostedZoneId": {
"Ref": "HostedZoneId"
},
"Name": {
"Ref": "DomainName"
},
"SetIdentifier": "secondary-record",
"Type": "A"
}
}
}
}