Skip to content

Commit e5223b4

Browse files
committed
terraform: disable cloudfront root object for crates.io on staging
There is a concern that setting the default root object to index.html for the crates.io webapp causes Fastboot to break: rust-lang/crates.io#1937 (comment) This adds a temporary feature flag to remove the default root object just from staging, without affecting production. After testing is done the feature flag will have to be removed, either disabling or enabling the root object both on staging and production.
1 parent a20506e commit e5223b4

File tree

3 files changed

+8
-1
lines changed

3 files changed

+8
-1
lines changed

terraform/services.tf

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,7 @@ module "service_cratesio" {
103103
iam_prefix = "crates-io"
104104

105105
logs_bucket = aws_s3_bucket.temp_logs_cratesio.bucket_domain_name
106+
temp_flag_root_object = true
106107
}
107108

108109
module "service_cratesio_staging" {
@@ -122,6 +123,8 @@ module "service_cratesio_staging" {
122123
webapp_origin_domain = "staging-crates-io.herokuapp.com"
123124

124125
iam_prefix = "staging-crates-io"
126+
127+
temp_flag_root_object = false
125128
}
126129

127130
module "service_docsrs" {

terraform/services/cratesio/cloudfront-webapp.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ resource "aws_cloudfront_distribution" "webapp" {
66
enabled = true
77
wait_for_deployment = false
88
is_ipv6_enabled = true
9-
default_root_object = "index.html"
9+
default_root_object = var.temp_flag_root_object ? "index.html" : null
1010
price_class = "PriceClass_All"
1111

1212
aliases = [var.webapp_domain_name]

terraform/services/cratesio/variables.tf

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,3 +36,7 @@ variable "logs_bucket" {
3636
type = string
3737
default = null
3838
}
39+
40+
variable "temp_flag_root_object" {
41+
type = bool
42+
}

0 commit comments

Comments
 (0)