diff --git a/terraform/services.tf b/terraform/services.tf index 39ea05cf..0c60059d 100644 --- a/terraform/services.tf +++ b/terraform/services.tf @@ -103,6 +103,7 @@ module "service_cratesio" { iam_prefix = "crates-io" logs_bucket = aws_s3_bucket.temp_logs_cratesio.bucket_domain_name + temp_flag_root_object = true } module "service_cratesio_staging" { @@ -122,6 +123,8 @@ module "service_cratesio_staging" { webapp_origin_domain = "staging-crates-io.herokuapp.com" iam_prefix = "staging-crates-io" + + temp_flag_root_object = false } module "service_docsrs" { diff --git a/terraform/services/cratesio/cloudfront-webapp.tf b/terraform/services/cratesio/cloudfront-webapp.tf index b2a54a8e..998cea8d 100644 --- a/terraform/services/cratesio/cloudfront-webapp.tf +++ b/terraform/services/cratesio/cloudfront-webapp.tf @@ -6,7 +6,7 @@ resource "aws_cloudfront_distribution" "webapp" { enabled = true wait_for_deployment = false is_ipv6_enabled = true - default_root_object = "index.html" + default_root_object = var.temp_flag_root_object ? "index.html" : null price_class = "PriceClass_All" aliases = [var.webapp_domain_name] diff --git a/terraform/services/cratesio/variables.tf b/terraform/services/cratesio/variables.tf index 4732f5a8..f2caced7 100644 --- a/terraform/services/cratesio/variables.tf +++ b/terraform/services/cratesio/variables.tf @@ -36,3 +36,7 @@ variable "logs_bucket" { type = string default = null } + +variable "temp_flag_root_object" { + type = bool +}