Skip to content

Commit 5fe9fb7

Browse files
authored
Merge pull request #827 from rust-lang/docs-rs-switch-cdn-traffic-to-faslty
docs-rs: switch cdn traffic to fastly
2 parents e24336f + 7e78f59 commit 5fe9fb7

File tree

3 files changed

+18
-14
lines changed

3 files changed

+18
-14
lines changed

terraform/docs-rs/cloudfront.tf

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -163,17 +163,3 @@ data "aws_route53_zone" "webapp" {
163163
// Convert foo.bar.baz into bar.baz
164164
name = join(".", reverse(slice(reverse(split(".", local.domain_name)), 0, 2)))
165165
}
166-
167-
resource "aws_route53_record" "webapp_apex" {
168-
for_each = toset(local.domain_is_apex ? ["A", "AAAA"] : [])
169-
170-
zone_id = data.aws_route53_zone.webapp.id
171-
name = local.domain_name
172-
type = each.value
173-
174-
alias {
175-
name = aws_cloudfront_distribution.webapp.domain_name
176-
zone_id = aws_cloudfront_distribution.webapp.hosted_zone_id
177-
evaluate_target_health = false
178-
}
179-
}

terraform/docs-rs/fastly.tf

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,3 +86,17 @@ resource "aws_route53_record" "fastly_domain" {
8686
records = concat(module.fastly_tls_subscription_globalsign.destinations, module.fastly_tls_subscription_globalsign_docs_rs.destinations)
8787
ttl = 60
8888
}
89+
90+
data "fastly_tls_configuration" "docs_rs_tls" {
91+
id = module.fastly_tls_subscription_globalsign_docs_rs.tls_configuration_id
92+
}
93+
94+
resource "aws_route53_record" "webapp_apex" {
95+
for_each = toset(["AAAA", "A"])
96+
zone_id = data.aws_route53_zone.webapp.id
97+
name = local.domain_name
98+
type = each.value
99+
ttl = 60
100+
101+
records = [for dns_record in data.fastly_tls_configuration.docs_rs_tls.dns_records : dns_record.record_value if dns_record.record_type == each.value]
102+
}

terraform/fastly-tls-subscription/outputs.tf

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,3 +15,7 @@ output "destinations" {
1515
# Prefix address pools for Fastly to enable IPv6 support
1616
value = [for pool in local.address_pools : "dualstack.${pool}"]
1717
}
18+
19+
output "tls_configuration_id" {
20+
value = fastly_tls_subscription.subscription.configuration_id
21+
}

0 commit comments

Comments
 (0)