-
Notifications
You must be signed in to change notification settings - Fork 80
/
Copy pathcode.gov.tf
127 lines (96 loc) · 3.26 KB
/
code.gov.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
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
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
resource "aws_route53_zone" "code_toplevel" {
name = "code.gov"
tags = {
Project = "dns"
}
}
resource "aws_route53_record" "code_gov_apex" {
zone_id = aws_route53_zone.code_toplevel.zone_id
name = "code.gov."
type = "A"
alias {
name = "d28gtishnkqf7k.cloudfront.net."
zone_id = local.cloud_gov_cloudfront_zone_id
evaluate_target_health = false
}
}
resource "aws_route53_record" "code_gov_apex_aaaa" {
zone_id = aws_route53_zone.code_toplevel.zone_id
name = "code.gov."
type = "AAAA"
alias {
name = "d28gtishnkqf7k.cloudfront.net."
zone_id = local.cloud_gov_cloudfront_zone_id
evaluate_target_health = false
}
}
## CNAME Acme Challenge Record for code.gov
resource "aws_route53_record" "code_gov__acme-challenge_code_gov_cname" {
zone_id = aws_route53_zone.code_toplevel.zone_id
name = "_acme-challenge"
type = "CNAME"
ttl = 300
records = ["_acme-challenge.code.gov.external-domains-production.cloud.gov."]
}
## CNAME for www.code.gov
resource "aws_route53_record" "code_gov_www_code_gov_cname" {
zone_id = aws_route53_zone.code_toplevel.zone_id
name = "www"
type = "CNAME"
ttl = 300
records = ["www.code.gov.external-domains-production.cloud.gov."]
}
## CNAME Acme Challenge Record for www.code.gov
resource "aws_route53_record" "code_gov__acme-challenge_www_code_gov_cname" {
zone_id = aws_route53_zone.code_toplevel.zone_id
name = "_acme-challenge.www"
type = "CNAME"
ttl = 300
records = ["_acme-challenge.www.code.gov.external-domains-production.cloud.gov."]
}
## CNAME for staging.code.gov
resource "aws_route53_record" "code_gov_staging_code_gov_cname" {
zone_id = aws_route53_zone.code_toplevel.zone_id
name = "staging"
type = "CNAME"
ttl = 300
records = ["staging.code.gov.external-domains-production.cloud.gov."]
}
## CNAME Acme Challenge Record for staging.code.gov
resource "aws_route53_record" "code_gov__acme-challenge_staging_code_gov_cname" {
zone_id = aws_route53_zone.code_toplevel.zone_id
name = "_acme-challenge.staging"
type = "CNAME"
ttl = 300
records = ["_acme-challenge.staging.code.gov.external-domains-production.cloud.gov."]
}
## CNAME for api.code.gov
resource "aws_route53_record" "code_gov_api_code_gov_cname" {
zone_id = aws_route53_zone.code_toplevel.zone_id
name = "api"
type = "CNAME"
ttl = 300
records = ["api.code.gov.external-domains-production.cloud.gov."]
}
## CNAME Acme Challenge Record for api.code.gov
resource "aws_route53_record" "code_gov__acme-challenge_api_code_gov_cname" {
zone_id = aws_route53_zone.code_toplevel.zone_id
name = "_acme-challenge.api"
type = "CNAME"
ttl = 300
records = ["_acme-challenge.api.code.gov.external-domains-production.cloud.gov."]
}
# resource "aws_route53_record" "code_gov_api_cname" {
# zone_id = aws_route53_zone.code_toplevel.zone_id
# name = "api.code.gov."
# type = "CNAME"
# ttl = 300
# records = ["api-code-gov.domains.api.data.gov"]
# }
module "code_gov__email_security" {
source = "./email_security"
zone_id = aws_route53_zone.code_toplevel.zone_id
}
output "code_ns" {
value = aws_route53_zone.code_toplevel.name_servers
}