From cc924eebe1566211b835b9eed070693d04049112 Mon Sep 17 00:00:00 2001
From: woowahan-neo <jaeyeonling@woowahan.com>
Date: Thu, 9 Jan 2025 09:45:15 +0900
Subject: [PATCH] fix: add aws key

---
 .github/workflows/terraform.yml | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)

diff --git a/.github/workflows/terraform.yml b/.github/workflows/terraform.yml
index c53cecdd7..fdf071e99 100644
--- a/.github/workflows/terraform.yml
+++ b/.github/workflows/terraform.yml
@@ -21,14 +21,12 @@ jobs:
         with:
           terraform_version: 1.10.3
 
-      - name: Select workspace
-        run: |
-          ENVIRONMENT=${{ github.event.inputs.environment }}
-          terraform workspace select "$ENVIRONMENT" || terraform workspace new "$ENVIRONMENT"
-
       - name: Terraform Init and Apply
         env:
           TF_API_TOKEN: ${{ secrets.TF_API_TOKEN }}
+          AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
+          AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
+        working-directory: terraform/environments/${{ github.event.inputs.environment }}
         run: |
           terraform init
           terraform plan -out=tfplan