From 9f58854d94c19dd6a364b57e9bcc807078fbc892 Mon Sep 17 00:00:00 2001 From: BEW111 Date: Sun, 18 Aug 2024 13:58:18 -0400 Subject: [PATCH] rebase --- infrastructure/backend/create_client_env.sh | 3 +++ infrastructure/client/main.tf | 14 +++++++------- 2 files changed, 10 insertions(+), 7 deletions(-) create mode 100755 infrastructure/backend/create_client_env.sh diff --git a/infrastructure/backend/create_client_env.sh b/infrastructure/backend/create_client_env.sh new file mode 100755 index 00000000..06733cc9 --- /dev/null +++ b/infrastructure/backend/create_client_env.sh @@ -0,0 +1,3 @@ +ENV_FILE="../../client/.env" +ALB_DNS=$(terraform output -raw alb_dns_name) +echo "REACT_APP_BACKEND_URL=http://$ALB_DNS" > $ENV_FILE \ No newline at end of file diff --git a/infrastructure/client/main.tf b/infrastructure/client/main.tf index fa000942..9b3ae01b 100644 --- a/infrastructure/client/main.tf +++ b/infrastructure/client/main.tf @@ -7,7 +7,7 @@ resource "local_file" "dotenv" { } provider "aws" { - region = "us-west-1" # Set your desired region + region = "us-west-1" # Set your desired region access_key = var.aws_access_key_id secret_key = var.aws_secret_access_key } @@ -121,17 +121,17 @@ resource "aws_cloudfront_distribution" "cdn" { # Handle 403 errors by serving index.html with a 200 status code custom_error_response { - error_code = 403 - response_code = 200 - response_page_path = "/index.html" + error_code = 403 + response_code = 200 + response_page_path = "/index.html" } # Default root object default_root_object = "index.html" - enabled = true - is_ipv6_enabled = true - price_class = "PriceClass_100" + enabled = true + is_ipv6_enabled = true + price_class = "PriceClass_100" restrictions { geo_restriction {