From b95e6427a0512002f0e5fd0079b845b07c1b7e7c Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 30 Dec 2025 19:01:12 +0000 Subject: [PATCH 1/2] Initial plan From 2a724f3c1ad84151c1f5792c1ba61c1017224ce5 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 30 Dec 2025 19:03:40 +0000 Subject: [PATCH 2/2] Replace fragile backend file manipulation with partial backend config Co-authored-by: aviggiano <3029017+aviggiano@users.noreply.github.com> --- .github/workflows/ci.yml | 6 ++---- infrastructure/backend.production.tf | 7 ------- infrastructure/backend.staging.tf | 7 ------- infrastructure/backend.tf | 8 ++++++++ 4 files changed, 10 insertions(+), 18 deletions(-) delete mode 100644 infrastructure/backend.production.tf delete mode 100644 infrastructure/backend.staging.tf create mode 100644 infrastructure/backend.tf diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 1b2dbb0..7ea2d85 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -88,8 +88,7 @@ jobs: - name: Validate run: | cd infrastructure - mv backend.production.tf backend.tf && rm backend.staging.tf - terraform init + terraform init -backend-config="bucket=recon-magic-framework-backend" terraform validate env: AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} @@ -117,8 +116,7 @@ jobs: - name: Deploy run: | cd infrastructure - mv backend.production.tf backend.tf && rm backend.staging.tf - terraform init + terraform init -backend-config="bucket=recon-magic-framework-backend" terraform apply -auto-approve env: AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} diff --git a/infrastructure/backend.production.tf b/infrastructure/backend.production.tf deleted file mode 100644 index c083c38..0000000 --- a/infrastructure/backend.production.tf +++ /dev/null @@ -1,7 +0,0 @@ -terraform { - backend "s3" { - bucket = "recon-magic-framework-backend" - key = "terraform.tfstate" - region = "us-east-1" - } -} diff --git a/infrastructure/backend.staging.tf b/infrastructure/backend.staging.tf deleted file mode 100644 index 4bb0ebf..0000000 --- a/infrastructure/backend.staging.tf +++ /dev/null @@ -1,7 +0,0 @@ -terraform { - backend "s3" { - bucket = "staging-recon-magic-framework" - key = "terraform.tfstate" - region = "us-east-1" - } -} diff --git a/infrastructure/backend.tf b/infrastructure/backend.tf new file mode 100644 index 0000000..36ce552 --- /dev/null +++ b/infrastructure/backend.tf @@ -0,0 +1,8 @@ +terraform { + backend "s3" { + # Backend configuration will be provided via -backend-config flags + # during terraform init to support multiple environments + key = "terraform.tfstate" + region = "us-east-1" + } +}