From ffbb6212822662aeb352095a0026f1d927370d9a Mon Sep 17 00:00:00 2001 From: Jun-te Kim Date: Mon, 9 Feb 2026 12:26:59 +0000 Subject: [PATCH] made terraform apply work --- .github/workflows/_deploy_lambda.yml | 17 +++++++++-------- .github/workflows/deploy_terraform.yml | 2 ++ 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/.github/workflows/_deploy_lambda.yml b/.github/workflows/_deploy_lambda.yml index 8d399cde..d3a9f79a 100644 --- a/.github/workflows/_deploy_lambda.yml +++ b/.github/workflows/_deploy_lambda.yml @@ -23,6 +23,14 @@ on: required: true type: string + terraform_apply: + required: false + type: choice + default: 'false' + options: + - 'true' + - 'false' + secrets: AWS_ACCESS_KEY_ID: required: true @@ -86,14 +94,7 @@ jobs: -var="image_digest=${{ inputs.image_digest }}" \ -out=lambdaplan - - name: Wait for Approval - uses: trstringer/manual-approval@v1 - with: - secret: ${{ secrets.GITHUB_TOKEN }} - approvers: developers - issue-title: "Click to approve Terraform Apply for ${{ inputs.lambda_name }} (${{ inputs.stage }})" - issue-body: "Press approve to proceed with Terraform Apply" - - name: Terraform Apply + if: inputs.terraform_apply == 'true' || inputs.stage == 'dev' || inputs.stage == 'main' working-directory: ${{ inputs.lambda_path }} run: terraform apply -auto-approve lambdaplan diff --git a/.github/workflows/deploy_terraform.yml b/.github/workflows/deploy_terraform.yml index 4f941462..1356b341 100644 --- a/.github/workflows/deploy_terraform.yml +++ b/.github/workflows/deploy_terraform.yml @@ -133,6 +133,8 @@ jobs: stage: ${{ needs.determine_stage.outputs.stage }} ecr_repo: postcode_splitter-${{ needs.determine_stage.outputs.stage }} image_digest: ${{ needs.postcodeSplitter_image.outputs.image_digest }} + # This should not be deployed in production!!!! + terraform_apply: 'true' secrets: AWS_ACCESS_KEY_ID: ${{ secrets.DEV_AWS_ACCESS_KEY_ID }} AWS_SECRET_ACCESS_KEY: ${{ secrets.DEV_AWS_SECRET_ACCESS_KEY }}