From d96ad1c6b0876ab57b17443230cc45873a465fb3 Mon Sep 17 00:00:00 2001 From: Jun-te Kim Date: Tue, 3 Feb 2026 12:32:48 +0000 Subject: [PATCH] check if lambda plan works --- .github/workflows/_deploy_lambda.yml | 16 ++++++------ .github/workflows/deploy_terraform.yml | 34 ++++++++++++-------------- 2 files changed, 23 insertions(+), 27 deletions(-) diff --git a/.github/workflows/_deploy_lambda.yml b/.github/workflows/_deploy_lambda.yml index a218a3d7..5abbbd99 100644 --- a/.github/workflows/_deploy_lambda.yml +++ b/.github/workflows/_deploy_lambda.yml @@ -12,9 +12,6 @@ on: stage: required: true type: string - aws_region: - required: true - type: string image_digest: required: true type: string @@ -24,8 +21,9 @@ on: required: true AWS_SECRET_ACCESS_KEY: required: true - AWS_ACCOUNT_ID: - required: true + AWS_REGION: + required: true + jobs: deploy: @@ -38,7 +36,7 @@ jobs: with: aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} - aws-region: ${{ inputs.aws_region }} + aws-region: ${{ secrets.AWS_REGION }} - uses: hashicorp/setup-terraform@v3 @@ -57,7 +55,8 @@ jobs: run: | terraform plan \ -var="stage=${{ inputs.stage }}" \ - -var="image_digest=${{ inputs.image_digest }}" + -var="image_digest=${{ inputs.image_digest }}" \ + -out=lambdaplan # - name: Terraform Apply # working-directory: ${{ inputs.lambda_path }} @@ -65,4 +64,5 @@ jobs: # terraform apply \ # -auto-approve \ # -var="stage=${{ inputs.stage }}" \ - # -var="image_digest=${{ inputs.image_digest }}" + # -var="image_digest=${{ inputs.image_digest }}" \ + # lambdaplan diff --git a/.github/workflows/deploy_terraform.yml b/.github/workflows/deploy_terraform.yml index 4713c8c7..9fb3787f 100644 --- a/.github/workflows/deploy_terraform.yml +++ b/.github/workflows/deploy_terraform.yml @@ -83,22 +83,18 @@ jobs: AWS_SECRET_ACCESS_KEY: ${{ secrets.DEV_AWS_SECRET_ACCESS_KEY }} AWS_REGION: ${{ secrets.DEV_AWS_REGION }} - - - - # # # ============================================================ - # # # 3️⃣ Deploy Lambda (Terraform, immutable digest) - # # # ============================================================ - # deploy_lambda: - # needs: [image, determine_stage] - # uses: ./.github/workflows/_deploy_lambda.yml - # with: - # lambda_name: address2uprn - # lambda_path: infrastructure/terraform/lambda/address2uprn - # stage: ${{ needs.determine_stage.outputs.stage }} - # aws_region: ${{ secrets.DEV_AWS_REGION }} - # image_digest: ${{ needs.image.outputs.image_digest }} - # secrets: - # AWS_ACCESS_KEY_ID: ${{ secrets.DEV_AWS_ACCESS_KEY_ID }} - # AWS_SECRET_ACCESS_KEY: ${{ secrets.DEV_AWS_SECRET_ACCESS_KEY }} - # AWS_ACCOUNT_ID: ${{ secrets.AWS_ACCOUNT_ID }} + # # ============================================================ + # # 3️⃣ Deploy Lambda (Terraform, immutable digest) + # # ============================================================ + deploy_lambda: + needs: [image, determine_stage] + uses: ./.github/workflows/_deploy_lambda.yml + with: + lambda_name: address2uprn + lambda_path: infrastructure/terraform/lambda/address2uprn + stage: ${{ needs.determine_stage.outputs.stage }} + image_digest: ${{ needs.image.outputs.image_digest }} + secrets: + AWS_ACCESS_KEY_ID: ${{ secrets.DEV_AWS_ACCESS_KEY_ID }} + AWS_SECRET_ACCESS_KEY: ${{ secrets.DEV_AWS_SECRET_ACCESS_KEY }} + AWS_REGION: ${{ secrets.DEV_AWS_REGION }}