From ab21d73bb97f1eae26e615da66cfea15c7eefdea Mon Sep 17 00:00:00 2001 From: David Date: Fri, 22 Nov 2024 16:05:39 -0500 Subject: [PATCH 1/3] remove qualified provider script --- infrastructure/deploy.py | 6 ------ 1 file changed, 6 deletions(-) diff --git a/infrastructure/deploy.py b/infrastructure/deploy.py index c913bdf7..69189a7e 100644 --- a/infrastructure/deploy.py +++ b/infrastructure/deploy.py @@ -8,7 +8,6 @@ import time from init_terraform import init_terraform -from replace_provider import replace_provider PRIVATE_KEY_FILE_PATH = "scpca-portal-key.pem" PUBLIC_KEY_FILE_PATH = "scpca-portal-key.pub" @@ -241,11 +240,6 @@ def restart_api_if_still_running(args, api_ip_address): if init_code != 0: exit(init_code) - replace_provider_code = replace_provider("hashicorp", "aws") - - if replace_provider_code != 0: - exit(replace_provider_code) - terraform_code, terraform_output = run_terraform(args) if terraform_code != 0: exit(terraform_code) From 454bee96e52a39b4a9cbe52cb965242ca125adad Mon Sep 17 00:00:00 2001 From: David Date: Fri, 22 Nov 2024 16:07:11 -0500 Subject: [PATCH 2/3] terraform 0.14.0 --- .github/workflows/deploy_prod_backend.yml | 2 +- .github/workflows/deploy_staging_backend.yml | 2 +- infrastructure/provider.tf | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/deploy_prod_backend.yml b/.github/workflows/deploy_prod_backend.yml index 7678ed12..d3b92530 100644 --- a/.github/workflows/deploy_prod_backend.yml +++ b/.github/workflows/deploy_prod_backend.yml @@ -33,7 +33,7 @@ jobs: - name: Setup Terraform uses: hashicorp/setup-terraform@v3 with: - terraform_version: 0.13.0 + terraform_version: 0.14.0 - name: Deploy run: cd infrastructure && python3 deploy.py -e prod -u deployer -d ccdl -v $(git rev-parse HEAD) diff --git a/.github/workflows/deploy_staging_backend.yml b/.github/workflows/deploy_staging_backend.yml index 0c6b77a9..c16ca970 100644 --- a/.github/workflows/deploy_staging_backend.yml +++ b/.github/workflows/deploy_staging_backend.yml @@ -33,7 +33,7 @@ jobs: - name: Setup Terraform uses: hashicorp/setup-terraform@v3 with: - terraform_version: 0.13.0 + terraform_version: 0.14.0 - name: Deploy run: cd infrastructure && python3 deploy.py -e staging -u deployer -d ccdlstaging -v $(git rev-parse HEAD) diff --git a/infrastructure/provider.tf b/infrastructure/provider.tf index b6d037b9..795e6919 100644 --- a/infrastructure/provider.tf +++ b/infrastructure/provider.tf @@ -6,7 +6,7 @@ terraform { # version = "~> 5.0.0" } } - required_version = "0.13.0" + required_version = "0.14.0" } provider "aws" { From a029bac904a479f753ac8f9b584cacf5e6b95d4d Mon Sep 17 00:00:00 2001 From: David Date: Fri, 22 Nov 2024 16:24:14 -0500 Subject: [PATCH 3/3] add quotes to regex for terraform outputs --- infrastructure/deploy.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/infrastructure/deploy.py b/infrastructure/deploy.py index 69189a7e..272ee56f 100644 --- a/infrastructure/deploy.py +++ b/infrastructure/deploy.py @@ -245,7 +245,7 @@ def restart_api_if_still_running(args, api_ip_address): exit(terraform_code) ip_address_match = re.match( - r".*\napi_server_1_ip = (\d+\.\d+\.\d+\.\d+)\n.*", terraform_output, re.DOTALL + r".*\napi_server_1_ip = \"(\d+\.\d+\.\d+\.\d+)\"\n.*", terraform_output, re.DOTALL ) if ip_address_match: