From 0fa4bb2a039db325994dd1fba23b2e3fa975e1db Mon Sep 17 00:00:00 2001 From: leej3 Date: Thu, 31 Oct 2024 14:56:30 +0000 Subject: [PATCH] try to fix region issue --- .github/workflows/deploy-opentofu.yml | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/.github/workflows/deploy-opentofu.yml b/.github/workflows/deploy-opentofu.yml index 6a95f2fd..1b0c1d7f 100644 --- a/.github/workflows/deploy-opentofu.yml +++ b/.github/workflows/deploy-opentofu.yml @@ -16,7 +16,12 @@ on: type: choice options: - staging - - production + - production + aws_region: + description: 'AWS region' + type: string + required: false + default: 'us-east-1' pull_request: branches: - main @@ -61,8 +66,8 @@ jobs: - name: Configure AWS credentials uses: aws-actions/configure-aws-credentials@v4 with: - aws-region: ${{ secrets.AWS_REGION }} - role-to-assume: arn:aws:iam::${{ secrets.AWS_ACCOUNT_ID }}:role/github-actions-role-shared + aws-region: ${{ inputs.aws_region }} + role-to-assume: arn:aws:iam::${{ env.TF_VAR_AWS_ACCOUNT_ID }}:role/github-actions-role-shared - name: Setup OpenTofu uses: opentofu/setup-opentofu@v1 @@ -97,8 +102,8 @@ jobs: - name: Configure AWS credentials uses: aws-actions/configure-aws-credentials@v4 with: - aws-region: ${{ secrets.AWS_REGION }} - role-to-assume: arn:aws:iam::${{ secrets.AWS_ACCOUNT_ID }}:role/github-actions-role-shared + aws-region: ${{ inputs.aws_region }} + role-to-assume: arn:aws:iam::${{ env.TF_VAR_AWS_ACCOUNT_ID }}:role/github-actions-role-shared - name: Setup OpenTofu uses: opentofu/setup-opentofu@v1