diff --git a/.github/workflows/terraform-plan-and-apply-aws.yml b/.github/workflows/terraform-plan-and-apply-aws.yml index 93dab7f..6d20f3e 100644 --- a/.github/workflows/terraform-plan-and-apply-aws.yml +++ b/.github/workflows/terraform-plan-and-apply-aws.yml @@ -435,6 +435,16 @@ jobs: compression-level: 9 path: "tfplan*" retention-days: 14 + - name: Tar Archive TF Providers and Modules + run: tar -cvf tf-providers-modules.tar .terraform + - name: Upload TF Providers and Modules + uses: actions/upload-artifact@v4 + with: + name: tf-providers-modules + compression-level: 5 + path: tf-providers-modules.tar + include-hidden-files: 'true' + retention-days: 14 - name: Optional Additional Directory Upload if: inputs.additional-dir-optional && inputs.additional-dir != '' run: | @@ -727,9 +737,12 @@ jobs: if: inputs.enable-private-access run: | git config --global url."https://x-access-token:${{steps.get_workflow_token.outputs.token}}@github.com/".insteadOf "https://github.com/" - - name: Terraform Init - id: init - run: terraform -chdir=${{ inputs.terraform-dir }} init -backend-config="bucket=${{ inputs.aws-account-id }}-${{ inputs.aws-region }}-tfstate" -backend-config="key=${{ steps.state-key.outputs.name }}" -backend-config="encrypt=true" -backend-config="dynamodb_table=${{ inputs.aws-account-id }}-${{ inputs.aws-region }}-tflock" -backend-config="region=${{ inputs.aws-region }}" + - name: Download TF Providers and Modules + uses: actions/download-artifact@v4 + with: + name: tf-providers-modules + - name: Extract Tar TF Providers and Modules + run: tar -xvf tf-providers-modules.tar - name: Download tfplan uses: actions/download-artifact@v4 with: