-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathroute53.tf
More file actions
31 lines (27 loc) · 770 Bytes
/
route53.tf
File metadata and controls
31 lines (27 loc) · 770 Bytes
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
resource "aws_route53_zone" "sakuten" {
name = "${var.domain}"
}
resource "aws_route53_record" "root" {
zone_id = "${aws_route53_zone.sakuten.zone_id}"
name = "${var.domain}"
type = "A"
ttl = "300"
records = ["104.198.14.52"] // Netlify's load balancer
}
resource "aws_route53_record" "www" {
zone_id = "${aws_route53_zone.sakuten.zone_id}"
name = "www.${var.domain}"
type = "CNAME"
ttl = "300"
records = ["${var.netlify_domain}"]
}
resource "aws_route53_record" "api" {
zone_id = "${aws_route53_zone.sakuten.zone_id}"
name = "api.${var.domain}"
type = "A"
alias {
name = "${aws_alb.main.dns_name}"
zone_id = "${aws_alb.main.zone_id}"
evaluate_target_health = true
}
}