From ad7ba2a5343fee9be5570befd886d44643fc5311 Mon Sep 17 00:00:00 2001 From: korenyoni <10080107+korenyoni@users.noreply.github.com> Date: Mon, 19 Aug 2024 13:55:30 -0400 Subject: [PATCH] feat: add IAM auth support, which is required for stack config templating as of atmos 1.18.2. --- action.yml | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/action.yml b/action.yml index 8784f97..95265ad 100644 --- a/action.yml +++ b/action.yml @@ -112,6 +112,11 @@ runs: echo "terraform-version=$(atmos describe config -f json | jq -r '.integrations.github.gitops["terraform-version"]')" >> $GITHUB_OUTPUT echo "group-by=$(atmos describe config -f json | jq -r '.integrations.github.gitops.matrix["group-by"]')" >> $GITHUB_OUTPUT echo "sort-by=$(atmos describe config -f json | jq -r '.integrations.github.gitops.matrix["sort-by"]')" >> $GITHUB_OUTPUT + echo "aws-region=$(atmos describe config -f json | jq -r '.integrations.github.gitops["artifact-storage"].region')" >> $GITHUB_OUTPUT + echo "terraform-state-role=$(atmos describe config -f json | jq -r '.integrations.github.gitops["artifact-storage"].role')" >> $GITHUB_OUTPUT + echo "terraform-state-table=$(atmos describe config -f json | jq -r '.integrations.github.gitops["artifact-storage"].table')" >> $GITHUB_OUTPUT + echo "terraform-state-bucket=$(atmos describe config -f json | jq -r '.integrations.github.gitops["artifact-storage"].bucket')" >> $GITHUB_OUTPUT + echo "terraform-plan-role=$(atmos describe config -f json | jq -r '.integrations.github.gitops.role.plan')" >> $GITHUB_OUTPUT - name: Install Terraform if: ${{ steps.config.outputs.terraform-version != '' && steps.config.outputs.terraform-version != 'null' }} @@ -143,6 +148,14 @@ runs: run: git checkout ${{ inputs.base-ref }} working-directory: base-ref + - name: Configure Plan AWS Credentials + uses: aws-actions/configure-aws-credentials@v4.0.2 + with: + aws-region: ${{ steps.config.outputs.aws-region }} + role-to-assume: ${{ steps.config.outputs.terraform-plan-role }} + role-session-name: "atmos-terraform-plan-gitops" + mask-aws-account-id: "no" + - name: atmos affected stacks for atmos pro id: affected-pro if: ${{ inputs.atmos-pro-upload == 'true' }}