-
Notifications
You must be signed in to change notification settings - Fork 0
/
dns.tf
35 lines (30 loc) · 913 Bytes
/
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
resource "aws_route53_zone" "primary" {
name = var.dns_name
}
resource "aws_route53_record" "minecraft" {
zone_id = aws_route53_zone.primary.zone_id
name = var.dns_name
type = "A"
ttl = "300"
records = [aws_instance.minecraft_server.public_ip]
}
resource "aws_route53_record" "www" {
zone_id = aws_route53_zone.primary.zone_id
name = var.webapp_dns_name
type = "A"
alias {
name = aws_cloudfront_distribution.www_distribution.domain_name
zone_id = aws_cloudfront_distribution.www_distribution.hosted_zone_id
evaluate_target_health = false
}
}
resource "aws_ssm_parameter" "minecraft_route53_zone_id" {
name = "minecraft_route53_zone_id"
type = "String"
value = aws_route53_zone.primary.id
}
resource "aws_ssm_parameter" "minecraft_dns_name" {
name = "minecraft_dns_name"
type = "String"
value = var.dns_name
}