Skip to content

Commit f7285d6

Browse files
authored
Merge pull request #838 from rust-lang/add-weights-to-index-crates-io
add weights to index.crates.io
2 parents 9771f77 + 06684ba commit f7285d6

File tree

5 files changed

+12
-14
lines changed

5 files changed

+12
-14
lines changed

terragrunt/accounts/legacy/crates-io-prod/crates-io/terragrunt.hcl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ inputs = {
2828

2929
static_cloudfront_weight = 0
3030
static_fastly_weight = 255
31+
index_cloudfront_weight = 255
3132
index_fastly_weight = 0
3233

3334
cdn_log_event_queue_arn = "arn:aws:sqs:us-west-1:365596307002:cdn-log-event-queue"
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
2427cd75d8a03281142d155f4b3ce0edccc40468
1+
cde68e691d767d64d44c1ee03818264d19412cd9

terragrunt/accounts/legacy/crates-io-staging/crates-io/terragrunt.hcl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ inputs = {
2727

2828
static_cloudfront_weight = 0
2929
static_fastly_weight = 100
30+
index_cloudfront_weight = 100
3031
index_fastly_weight = 0
3132

3233
cdn_log_event_queue_arn = "arn:aws:sqs:us-west-1:359172468976:cdn-log-event-queue"

terragrunt/modules/crates-io/_terraform.tf

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -82,11 +82,10 @@ variable "static_fastly_weight" {
8282
type = number
8383
}
8484

85-
# TODO: uncomment
86-
# variable "index_cloudfront_weight" {
87-
# description = "Weight of the traffic for index.crates.io that is routed through CloudFront"
88-
# type = number
89-
# }
85+
variable "index_cloudfront_weight" {
86+
description = "Weight of the traffic for index.crates.io that is routed through CloudFront"
87+
type = number
88+
}
9089

9190
variable "index_fastly_weight" {
9291
description = "Weight of the traffic for index.crates.io that is routed through Fastly"

terragrunt/modules/crates-io/cloudfront-index.tf

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -96,14 +96,11 @@ resource "aws_route53_record" "index" {
9696
name = var.index_domain_name
9797
type = "CNAME"
9898
ttl = 300
99-
records = [aws_cloudfront_distribution.index.domain_name]
100-
# TODO replace the records
101-
# records = [aws_route53_record.cloudfront_index_domain.fqdn]
99+
records = [aws_route53_record.cloudfront_index_domain.fqdn]
102100

103-
# TODO: uncomment
104-
# weighted_routing_policy {
105-
# weight = var.index_cloudfront_weight
106-
# }
101+
weighted_routing_policy {
102+
weight = var.index_cloudfront_weight
103+
}
107104

108-
# set_identifier = "cloudfront"
105+
set_identifier = "cloudfront"
109106
}

0 commit comments

Comments
 (0)