From 96d6c8bf381a573c44ac2d9b877f2b05e43521e8 Mon Sep 17 00:00:00 2001 From: Matt Reeves Date: Thu, 9 Jan 2025 22:40:00 -0500 Subject: [PATCH] fix tofu s3 backend --- .forgejo/workflows/tofu.yml | 14 +++++++++----- terraform/main.tf | 2 -- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/.forgejo/workflows/tofu.yml b/.forgejo/workflows/tofu.yml index 4ef90ef..6527aeb 100644 --- a/.forgejo/workflows/tofu.yml +++ b/.forgejo/workflows/tofu.yml @@ -76,6 +76,9 @@ jobs: - name: Run OpenTofu Init working-directory: ./terraform + env: + AWS_ACCESS_KEY_ID: ${{ steps.bitwarden-secrets.outputs.aws_access_key_id }} + AWS_SECRET_ACCESS_KEY: ${{ steps.bitwarden-secrets.outputs.aws_secret_access_key }} run: | tofu init -var-file=terraform.tfvars @@ -83,14 +86,15 @@ jobs: - name: Run OpenTofu Plan id: plan working-directory: ./terraform + env: + AWS_ACCESS_KEY_ID: ${{ steps.bitwarden-secrets.outputs.aws_access_key_id }} + AWS_SECRET_ACCESS_KEY: ${{ steps.bitwarden-secrets.outputs.aws_secret_access_key }} run: tofu plan -no-color - - name: Display Plan Output - run: | - echo "Plan output:" - echo "${{ steps.plan.outputs.stdout }}" - - name: Apply the Plan if: success() working-directory: ./terraform + env: + AWS_ACCESS_KEY_ID: ${{ steps.bitwarden-secrets.outputs.aws_access_key_id }} + AWS_SECRET_ACCESS_KEY: ${{ steps.bitwarden-secrets.outputs.aws_secret_access_key }} run: tofu apply -auto-approve diff --git a/terraform/main.tf b/terraform/main.tf index fd2e8b2..d6d505b 100644 --- a/terraform/main.tf +++ b/terraform/main.tf @@ -15,8 +15,6 @@ backend "s3" { endpoints = { s3 = var.s3_endpoint } - access_key = var.aws_access_key_id - secret_key = var.aws_secret_access_key } }