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 {