From bc8ca3ead36e13b71272845baf80d01adee63e41 Mon Sep 17 00:00:00 2001 From: Jun-te Kim Date: Tue, 19 May 2026 12:55:30 +0000 Subject: [PATCH] deployment from infrastructure --- .dockerignore | 2 +- .github/workflows/deploy_terraform.yml | 46 +++++++++---------- Dockerfile.test.dockerignore | 2 +- .../terraform/lambda/_template/README.md | 2 +- .../lambda_with_api_gateway/variables.tf | 2 +- 5 files changed, 27 insertions(+), 27 deletions(-) diff --git a/.dockerignore b/.dockerignore index 0c7d7749..90436ffc 100644 --- a/.dockerignore +++ b/.dockerignore @@ -6,7 +6,7 @@ backend/.idea/* backend/.env recommendations/tests/* model_data/tests/* -infrastructure/* +deployment/* data_collection/* node_modules/* conservation_areas/* diff --git a/.github/workflows/deploy_terraform.yml b/.github/workflows/deploy_terraform.yml index bd014e3d..923fc0a9 100644 --- a/.github/workflows/deploy_terraform.yml +++ b/.github/workflows/deploy_terraform.yml @@ -62,20 +62,20 @@ jobs: - uses: hashicorp/setup-terraform@v3 - name: Terraform Init - working-directory: infrastructure/terraform/shared + working-directory: deployment/terraform/shared run: terraform init -reconfigure - name: Terraform Workspace - working-directory: infrastructure/terraform/shared + working-directory: deployment/terraform/shared run: terraform workspace select ${STAGE} || terraform workspace new ${STAGE} - name: Terraform Plan - working-directory: infrastructure/terraform/shared + working-directory: deployment/terraform/shared run: terraform plan -var-file=${STAGE}.tfvars -out=tfplan - name: Terraform Apply if: env.TERRAFORM_APPLY == 'true' - working-directory: infrastructure/terraform/shared + working-directory: deployment/terraform/shared run: terraform apply -auto-approve tfplan # ============================================================ @@ -101,7 +101,7 @@ jobs: uses: ./.github/workflows/_deploy_lambda.yml with: lambda_name: ara_engine - lambda_path: infrastructure/terraform/lambda/engine + lambda_path: deployment/terraform/lambda/engine stage: ${{ needs.determine_stage.outputs.stage }} ecr_repo: engine-${{ needs.determine_stage.outputs.stage }} image_digest: ${{ needs.ara_engine_image.outputs.image_digest }} @@ -150,7 +150,7 @@ jobs: uses: ./.github/workflows/_deploy_lambda.yml with: lambda_name: address2uprn - lambda_path: infrastructure/terraform/lambda/address2UPRN + lambda_path: deployment/terraform/lambda/address2UPRN stage: ${{ needs.determine_stage.outputs.stage }} ecr_repo: address2uprn-${{ needs.determine_stage.outputs.stage }} image_digest: ${{ needs.address2uprn_image.outputs.image_digest }} @@ -191,7 +191,7 @@ jobs: uses: ./.github/workflows/_deploy_lambda.yml with: lambda_name: postcodeSplitter - lambda_path: infrastructure/terraform/lambda/postcodeSplitter + lambda_path: deployment/terraform/lambda/postcodeSplitter stage: ${{ needs.determine_stage.outputs.stage }} ecr_repo: postcode_splitter-${{ needs.determine_stage.outputs.stage }} image_digest: ${{ needs.postcodeSplitter_image.outputs.image_digest }} @@ -231,7 +231,7 @@ jobs: uses: ./.github/workflows/_deploy_lambda.yml with: lambda_name: bulk_address2uprn_combiner - lambda_path: infrastructure/terraform/lambda/bulk_address2uprn_combiner + lambda_path: deployment/terraform/lambda/bulk_address2uprn_combiner stage: ${{ needs.determine_stage.outputs.stage }} ecr_repo: bulk_address2uprn_combiner-${{ needs.determine_stage.outputs.stage }} image_digest: ${{ needs.bulk_address2uprn_combiner_image.outputs.image_digest }} @@ -271,7 +271,7 @@ jobs: uses: ./.github/workflows/_deploy_lambda.yml with: lambda_name: condition-etl - lambda_path: infrastructure/terraform/lambda/condition-etl + lambda_path: deployment/terraform/lambda/condition-etl stage: ${{ needs.determine_stage.outputs.stage }} ecr_repo: condition-etl-${{ needs.determine_stage.outputs.stage }} image_digest: ${{ needs.condition_etl_image.outputs.image_digest }} @@ -311,7 +311,7 @@ jobs: uses: ./.github/workflows/_deploy_lambda.yml with: lambda_name: categorisation - lambda_path: infrastructure/terraform/lambda/categorisation + lambda_path: deployment/terraform/lambda/categorisation stage: ${{ needs.determine_stage.outputs.stage }} ecr_repo: categorisation-${{ needs.determine_stage.outputs.stage }} image_digest: ${{ needs.categorisation_image.outputs.image_digest }} @@ -351,7 +351,7 @@ jobs: uses: ./.github/workflows/_deploy_lambda.yml with: lambda_name: ordnanceSurvey - lambda_path: infrastructure/terraform/lambda/ordnanceSurvey + lambda_path: deployment/terraform/lambda/ordnanceSurvey stage: ${{ needs.determine_stage.outputs.stage }} ecr_repo: ordnance-${{ needs.determine_stage.outputs.stage }} image_digest: ${{ needs.ordnanceSurvey_image.outputs.image_digest }} @@ -386,7 +386,7 @@ jobs: uses: ./.github/workflows/_deploy_lambda.yml with: lambda_name: pashub_to_ara - lambda_path: infrastructure/terraform/lambda/pashub_to_ara + lambda_path: deployment/terraform/lambda/pashub_to_ara stage: ${{ needs.determine_stage.outputs.stage }} ecr_repo: pashub_to_ara-${{ needs.determine_stage.outputs.stage }} image_digest: ${{ needs.pashub_to_ara_image.outputs.image_digest }} @@ -419,7 +419,7 @@ jobs: uses: ./.github/workflows/_deploy_lambda.yml with: lambda_name: ara_fast_api - lambda_path: infrastructure/terraform/lambda/fast-api + lambda_path: deployment/terraform/lambda/fast-api stage: ${{ needs.determine_stage.outputs.stage }} terraform_apply: ${{ needs.determine_stage.outputs.terraform_apply }} secrets: @@ -458,17 +458,17 @@ jobs: - uses: hashicorp/setup-terraform@v3 - name: Terraform Init - working-directory: infrastructure/terraform/cdn_certificate + working-directory: deployment/terraform/cdn_certificate run: terraform init -reconfigure - name: Terraform Workspace - working-directory: infrastructure/terraform/cdn_certificate + working-directory: deployment/terraform/cdn_certificate run: | terraform workspace select $STAGE \ || terraform workspace new $STAGE - name: Terraform Plan - working-directory: infrastructure/terraform/cdn_certificate + working-directory: deployment/terraform/cdn_certificate run: | terraform plan \ -var="stage=${STAGE}" \ @@ -476,7 +476,7 @@ jobs: - name: Terraform Apply if: env.TERRAFORM_APPLY == 'true' - working-directory: infrastructure/terraform/cdn_certificate + working-directory: deployment/terraform/cdn_certificate run: terraform apply -auto-approve tfplan @@ -503,17 +503,17 @@ jobs: - uses: hashicorp/setup-terraform@v3 - name: Terraform Init - working-directory: infrastructure/terraform/cdn + working-directory: deployment/terraform/cdn run: terraform init -reconfigure - name: Terraform Workspace - working-directory: infrastructure/terraform/cdn + working-directory: deployment/terraform/cdn run: | terraform workspace select $STAGE \ || terraform workspace new $STAGE - name: Terraform Plan - working-directory: infrastructure/terraform/cdn + working-directory: deployment/terraform/cdn run: | terraform plan \ -var="stage=${STAGE}" \ @@ -521,7 +521,7 @@ jobs: - name: Terraform Apply if: env.TERRAFORM_APPLY == 'true' - working-directory: infrastructure/terraform/cdn + working-directory: deployment/terraform/cdn run: terraform apply -auto-approve tfplan # ============================================================ @@ -562,7 +562,7 @@ jobs: uses: ./.github/workflows/_deploy_lambda.yml with: lambda_name: magic_plan - lambda_path: infrastructure/terraform/lambda/magic_plan + lambda_path: deployment/terraform/lambda/magic_plan stage: ${{ needs.determine_stage.outputs.stage }} ecr_repo: magic-plan-${{ needs.determine_stage.outputs.stage }} image_digest: ${{ needs.magic_plan_image.outputs.image_digest }} @@ -585,7 +585,7 @@ jobs: uses: ./.github/workflows/_deploy_lambda.yml with: lambda_name: hubspot-etl-to-ara - lambda_path: infrastructure/terraform/lambda/hubspot_deal_etl + lambda_path: deployment/terraform/lambda/hubspot_deal_etl stage: ${{ needs.determine_stage.outputs.stage }} ecr_repo: hubspot-etl-${{ needs.determine_stage.outputs.stage }} image_digest: ${{ needs.hubspot_etl_image.outputs.image_digest }} diff --git a/Dockerfile.test.dockerignore b/Dockerfile.test.dockerignore index 4f79c6ee..ed05c399 100644 --- a/Dockerfile.test.dockerignore +++ b/Dockerfile.test.dockerignore @@ -4,7 +4,7 @@ model_data/local_data/ backend/node_modules/ backend/.idea/ backend/.env -infrastructure/ +deployment/ data_collection/ node_modules/ conservation_areas/ diff --git a/infrastructure/terraform/lambda/_template/README.md b/infrastructure/terraform/lambda/_template/README.md index 5bb10627..f2a8638a 100644 --- a/infrastructure/terraform/lambda/_template/README.md +++ b/infrastructure/terraform/lambda/_template/README.md @@ -10,7 +10,7 @@ ### 2. Add infrastructure prerequisites (shared stack) - Add a new ECR repository in: - infrastructure/terraform/shared/main.tf + deployment/terraform/shared/main.tf - Create a PR to deploy this to main then dev in order to deploy the shared stack diff --git a/infrastructure/terraform/modules/lambda_with_api_gateway/variables.tf b/infrastructure/terraform/modules/lambda_with_api_gateway/variables.tf index 95e5acd9..b5d0515a 100644 --- a/infrastructure/terraform/modules/lambda_with_api_gateway/variables.tf +++ b/infrastructure/terraform/modules/lambda_with_api_gateway/variables.tf @@ -11,7 +11,7 @@ variable "zip_excludes" { "**/*.pyc", "**/.pytest_cache/**", "**/tests/**", - "**/infrastructure/**" + "**/deployment/**" ] }