From b33fcc8723ed94b5d5e858a36008517f5803fbbe Mon Sep 17 00:00:00 2001 From: Priyesh Mistry Date: Thu, 9 Jan 2025 14:31:41 +0000 Subject: [PATCH 01/26] feat: adding .terraform artifact upload --- .../terraform-plan-and-apply-aws.yml | 23 ++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) diff --git a/.github/workflows/terraform-plan-and-apply-aws.yml b/.github/workflows/terraform-plan-and-apply-aws.yml index 93dab7f..aeeed69 100644 --- a/.github/workflows/terraform-plan-and-apply-aws.yml +++ b/.github/workflows/terraform-plan-and-apply-aws.yml @@ -435,6 +435,15 @@ jobs: compression-level: 9 path: "tfplan*" retention-days: 14 + + - name: Upload TF Providers and Modules + uses: actions/upload-artifact@v4 + with: + name: tf-providers-modules + compression-level: 9 + path: ${{ inputs.working-directory }}/.terraform + retention-days: 14 + - name: Optional Additional Directory Upload if: inputs.additional-dir-optional && inputs.additional-dir != '' run: | @@ -727,9 +736,17 @@ 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: 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 .terraform + uses: actions/download-artifact@v4 + with: + name: tf-providers-modules + path: ${{ inputs.working-directory }}/.terraform + - name: Download tfplan uses: actions/download-artifact@v4 with: From d96cf9e27e5a6193c9d3f436ef42620af075ada9 Mon Sep 17 00:00:00 2001 From: Priyesh Mistry Date: Thu, 9 Jan 2025 14:35:10 +0000 Subject: [PATCH 02/26] chore: remove work dir --- .github/workflows/terraform-plan-and-apply-aws.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/terraform-plan-and-apply-aws.yml b/.github/workflows/terraform-plan-and-apply-aws.yml index aeeed69..6fb13f7 100644 --- a/.github/workflows/terraform-plan-and-apply-aws.yml +++ b/.github/workflows/terraform-plan-and-apply-aws.yml @@ -441,7 +441,7 @@ jobs: with: name: tf-providers-modules compression-level: 9 - path: ${{ inputs.working-directory }}/.terraform + path: .terraform retention-days: 14 - name: Optional Additional Directory Upload From 7a9317252fbb9117a2b24f79eab7a9e8f5f4f024 Mon Sep 17 00:00:00 2001 From: Priyesh Mistry Date: Thu, 9 Jan 2025 14:37:40 +0000 Subject: [PATCH 03/26] chore: add hidden --- .github/workflows/terraform-plan-and-apply-aws.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/terraform-plan-and-apply-aws.yml b/.github/workflows/terraform-plan-and-apply-aws.yml index 6fb13f7..0170a5b 100644 --- a/.github/workflows/terraform-plan-and-apply-aws.yml +++ b/.github/workflows/terraform-plan-and-apply-aws.yml @@ -442,6 +442,7 @@ jobs: name: tf-providers-modules compression-level: 9 path: .terraform + include-hidden-files: true retention-days: 14 - name: Optional Additional Directory Upload From 18dc7020e461bffad288717ba425bb95f97fd771 Mon Sep 17 00:00:00 2001 From: Priyesh Mistry Date: Thu, 9 Jan 2025 14:52:07 +0000 Subject: [PATCH 04/26] chore: test apply --- .github/workflows/terraform-plan-and-apply-aws.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/terraform-plan-and-apply-aws.yml b/.github/workflows/terraform-plan-and-apply-aws.yml index 0170a5b..ffe6ff0 100644 --- a/.github/workflows/terraform-plan-and-apply-aws.yml +++ b/.github/workflows/terraform-plan-and-apply-aws.yml @@ -673,7 +673,7 @@ jobs: terraform-apply: name: "Terraform Apply" - if: github.ref == 'refs/heads/main' && contains(fromJSON('["push", "schedule"]'), github.event_name) && inputs.enable-terraform-apply +# if: github.ref == 'refs/heads/main' && contains(fromJSON('["push", "schedule"]'), github.event_name) && inputs.enable-terraform-apply environment: ${{ inputs.environment }} runs-on: ${{ inputs.runs-on }} defaults: From 04b7dab8e1684532adc793a957706cafe1025e30 Mon Sep 17 00:00:00 2001 From: Priyesh Mistry Date: Thu, 9 Jan 2025 15:02:56 +0000 Subject: [PATCH 05/26] chore: tarring .terraform --- .github/workflows/terraform-plan-and-apply-aws.yml | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/.github/workflows/terraform-plan-and-apply-aws.yml b/.github/workflows/terraform-plan-and-apply-aws.yml index ffe6ff0..636b47b 100644 --- a/.github/workflows/terraform-plan-and-apply-aws.yml +++ b/.github/workflows/terraform-plan-and-apply-aws.yml @@ -436,13 +436,15 @@ jobs: path: "tfplan*" retention-days: 14 + - name: 'Tar files' + run: tar -cvf .terraform.tar .terraform + - name: Upload TF Providers and Modules uses: actions/upload-artifact@v4 with: name: tf-providers-modules compression-level: 9 - path: .terraform - include-hidden-files: true + path: .terraform.tar retention-days: 14 - name: Optional Additional Directory Upload @@ -742,11 +744,11 @@ jobs: # 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 .terraform + - name: Download TF Providers and Modules uses: actions/download-artifact@v4 with: name: tf-providers-modules - path: ${{ inputs.working-directory }}/.terraform + path: ${{ inputs.working-directory }} - name: Download tfplan uses: actions/download-artifact@v4 From 109b5f880df8d152932b2b8089005dd040956216 Mon Sep 17 00:00:00 2001 From: Priyesh Mistry Date: Thu, 9 Jan 2025 15:06:05 +0000 Subject: [PATCH 06/26] chore: tarring .terraform include hidden --- .github/workflows/terraform-plan-and-apply-aws.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/terraform-plan-and-apply-aws.yml b/.github/workflows/terraform-plan-and-apply-aws.yml index 636b47b..90e4c22 100644 --- a/.github/workflows/terraform-plan-and-apply-aws.yml +++ b/.github/workflows/terraform-plan-and-apply-aws.yml @@ -445,6 +445,7 @@ jobs: name: tf-providers-modules compression-level: 9 path: .terraform.tar + include-hidden-files: 'true' retention-days: 14 - name: Optional Additional Directory Upload From b30d40b5568e0ba12fe026cb446976184ac9924c Mon Sep 17 00:00:00 2001 From: Priyesh Mistry Date: Thu, 9 Jan 2025 15:10:08 +0000 Subject: [PATCH 07/26] chore: tarring .terraform include hidden --- .github/workflows/terraform-plan-and-apply-aws.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/terraform-plan-and-apply-aws.yml b/.github/workflows/terraform-plan-and-apply-aws.yml index 90e4c22..131be36 100644 --- a/.github/workflows/terraform-plan-and-apply-aws.yml +++ b/.github/workflows/terraform-plan-and-apply-aws.yml @@ -749,7 +749,7 @@ jobs: uses: actions/download-artifact@v4 with: name: tf-providers-modules - path: ${{ inputs.working-directory }} + path: ${{ inputs.working-directory }}/.terraform - name: Download tfplan uses: actions/download-artifact@v4 From 1105e923a8427c6724a0795665a74debe0546ea1 Mon Sep 17 00:00:00 2001 From: Priyesh Mistry Date: Thu, 9 Jan 2025 15:27:08 +0000 Subject: [PATCH 08/26] chore: remove tarring --- .github/workflows/terraform-plan-and-apply-aws.yml | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/.github/workflows/terraform-plan-and-apply-aws.yml b/.github/workflows/terraform-plan-and-apply-aws.yml index 131be36..9c31069 100644 --- a/.github/workflows/terraform-plan-and-apply-aws.yml +++ b/.github/workflows/terraform-plan-and-apply-aws.yml @@ -436,15 +436,12 @@ jobs: path: "tfplan*" retention-days: 14 - - name: 'Tar files' - run: tar -cvf .terraform.tar .terraform - - name: Upload TF Providers and Modules uses: actions/upload-artifact@v4 with: name: tf-providers-modules compression-level: 9 - path: .terraform.tar + path: .terraform include-hidden-files: 'true' retention-days: 14 @@ -741,9 +738,9 @@ jobs: 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: 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 From 44bc409535a322500a6f90656fc018fc74541581 Mon Sep 17 00:00:00 2001 From: Priyesh Mistry Date: Thu, 9 Jan 2025 15:30:09 +0000 Subject: [PATCH 09/26] chore: switch steps --- .github/workflows/terraform-plan-and-apply-aws.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/terraform-plan-and-apply-aws.yml b/.github/workflows/terraform-plan-and-apply-aws.yml index 9c31069..046d61e 100644 --- a/.github/workflows/terraform-plan-and-apply-aws.yml +++ b/.github/workflows/terraform-plan-and-apply-aws.yml @@ -738,16 +738,16 @@ jobs: 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 path: ${{ inputs.working-directory }}/.terraform + - 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 tfplan uses: actions/download-artifact@v4 with: From 44e0f94c228a2c98e3df679038f738aa7269e64b Mon Sep 17 00:00:00 2001 From: Priyesh Mistry Date: Thu, 9 Jan 2025 15:41:39 +0000 Subject: [PATCH 10/26] chore: remove download path --- .github/workflows/terraform-plan-and-apply-aws.yml | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/.github/workflows/terraform-plan-and-apply-aws.yml b/.github/workflows/terraform-plan-and-apply-aws.yml index 046d61e..5a5db7f 100644 --- a/.github/workflows/terraform-plan-and-apply-aws.yml +++ b/.github/workflows/terraform-plan-and-apply-aws.yml @@ -742,11 +742,10 @@ jobs: uses: actions/download-artifact@v4 with: name: tf-providers-modules - path: ${{ inputs.working-directory }}/.terraform - - 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: 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 tfplan uses: actions/download-artifact@v4 From a7390f68037f863c930a7c7e5af9d5e4521fb9e3 Mon Sep 17 00:00:00 2001 From: Priyesh Mistry Date: Thu, 9 Jan 2025 16:28:11 +0000 Subject: [PATCH 11/26] chore: debug --- .github/workflows/terraform-plan-and-apply-aws.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/terraform-plan-and-apply-aws.yml b/.github/workflows/terraform-plan-and-apply-aws.yml index 5a5db7f..a71b79d 100644 --- a/.github/workflows/terraform-plan-and-apply-aws.yml +++ b/.github/workflows/terraform-plan-and-apply-aws.yml @@ -757,6 +757,10 @@ jobs: with: name: additional-dir-${{ inputs.environment }} path: ${{ inputs.additional-dir }} + + - name: Setup tmate session + uses: mxschmitt/action-tmate@v3 + - name: Terraform Apply run: | terraform apply \ From db695982d957edb8cd6799f9555c4e638a8726a6 Mon Sep 17 00:00:00 2001 From: Priyesh Mistry Date: Thu, 9 Jan 2025 16:38:32 +0000 Subject: [PATCH 12/26] chore: debug --- .github/workflows/terraform-plan-and-apply-aws.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/terraform-plan-and-apply-aws.yml b/.github/workflows/terraform-plan-and-apply-aws.yml index a71b79d..143106e 100644 --- a/.github/workflows/terraform-plan-and-apply-aws.yml +++ b/.github/workflows/terraform-plan-and-apply-aws.yml @@ -742,6 +742,7 @@ jobs: uses: actions/download-artifact@v4 with: name: tf-providers-modules + path: .terraform # - name: Terraform Init # id: init From f0f8df674de37f88701176128cfe2b9ccbedcbe8 Mon Sep 17 00:00:00 2001 From: Priyesh Mistry Date: Fri, 10 Jan 2025 10:44:28 +0000 Subject: [PATCH 13/26] chore: adding tarring --- .github/workflows/terraform-plan-and-apply-aws.yml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/.github/workflows/terraform-plan-and-apply-aws.yml b/.github/workflows/terraform-plan-and-apply-aws.yml index 143106e..8f33bd1 100644 --- a/.github/workflows/terraform-plan-and-apply-aws.yml +++ b/.github/workflows/terraform-plan-and-apply-aws.yml @@ -436,12 +436,15 @@ jobs: path: "tfplan*" retention-days: 14 + - name: Tar 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: 9 - path: .terraform + path: .terraform.tar include-hidden-files: 'true' retention-days: 14 @@ -742,7 +745,7 @@ jobs: uses: actions/download-artifact@v4 with: name: tf-providers-modules - path: .terraform + path: .terraform.tar # - name: Terraform Init # id: init From 869dd9fd9dd771bacae28013e730c5517a7b41dc Mon Sep 17 00:00:00 2001 From: Priyesh Mistry Date: Fri, 10 Jan 2025 10:46:49 +0000 Subject: [PATCH 14/26] chore: adding tarring --- .github/workflows/terraform-plan-and-apply-aws.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/terraform-plan-and-apply-aws.yml b/.github/workflows/terraform-plan-and-apply-aws.yml index 8f33bd1..f8e3e98 100644 --- a/.github/workflows/terraform-plan-and-apply-aws.yml +++ b/.github/workflows/terraform-plan-and-apply-aws.yml @@ -444,7 +444,7 @@ jobs: with: name: tf-providers-modules compression-level: 9 - path: .terraform.tar + path: tf-providers-modules.tar include-hidden-files: 'true' retention-days: 14 From fe06a88a2d54f9a3505de1914fe826af72618f2c Mon Sep 17 00:00:00 2001 From: Priyesh Mistry Date: Fri, 10 Jan 2025 10:56:30 +0000 Subject: [PATCH 15/26] chore: adding tarring --- .github/workflows/terraform-plan-and-apply-aws.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/terraform-plan-and-apply-aws.yml b/.github/workflows/terraform-plan-and-apply-aws.yml index f8e3e98..a2e1e92 100644 --- a/.github/workflows/terraform-plan-and-apply-aws.yml +++ b/.github/workflows/terraform-plan-and-apply-aws.yml @@ -745,7 +745,7 @@ jobs: uses: actions/download-artifact@v4 with: name: tf-providers-modules - path: .terraform.tar + path: .terraform # - name: Terraform Init # id: init From f4f991d558231e15517e5f04d297f7e9d6e8fbba Mon Sep 17 00:00:00 2001 From: Priyesh Mistry Date: Fri, 10 Jan 2025 11:09:08 +0000 Subject: [PATCH 16/26] chore: adding tarring --- .github/workflows/terraform-plan-and-apply-aws.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/terraform-plan-and-apply-aws.yml b/.github/workflows/terraform-plan-and-apply-aws.yml index a2e1e92..56e9c09 100644 --- a/.github/workflows/terraform-plan-and-apply-aws.yml +++ b/.github/workflows/terraform-plan-and-apply-aws.yml @@ -745,7 +745,9 @@ jobs: uses: actions/download-artifact@v4 with: name: tf-providers-modules - path: .terraform + +# - name: Extract Tar TF Providers and Modules +# run: tar -xvf tf-providers-modules.tar # - name: Terraform Init # id: init From 86c5cd089769eec8e8a3419aaabb459875e50d89 Mon Sep 17 00:00:00 2001 From: Priyesh Mistry Date: Fri, 10 Jan 2025 11:13:47 +0000 Subject: [PATCH 17/26] chore: adding tarring --- .github/workflows/terraform-plan-and-apply-aws.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/terraform-plan-and-apply-aws.yml b/.github/workflows/terraform-plan-and-apply-aws.yml index 56e9c09..ca48b0a 100644 --- a/.github/workflows/terraform-plan-and-apply-aws.yml +++ b/.github/workflows/terraform-plan-and-apply-aws.yml @@ -745,6 +745,7 @@ jobs: uses: actions/download-artifact@v4 with: name: tf-providers-modules + path: tf-providers-modules.tar # - name: Extract Tar TF Providers and Modules # run: tar -xvf tf-providers-modules.tar From ef43280443698f5175bab23d7ae1e831265e76bf Mon Sep 17 00:00:00 2001 From: Priyesh Mistry Date: Fri, 10 Jan 2025 11:23:53 +0000 Subject: [PATCH 18/26] chore: adding tarring --- .github/workflows/terraform-plan-and-apply-aws.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/terraform-plan-and-apply-aws.yml b/.github/workflows/terraform-plan-and-apply-aws.yml index ca48b0a..22825b6 100644 --- a/.github/workflows/terraform-plan-and-apply-aws.yml +++ b/.github/workflows/terraform-plan-and-apply-aws.yml @@ -745,7 +745,7 @@ jobs: uses: actions/download-artifact@v4 with: name: tf-providers-modules - path: tf-providers-modules.tar + path: . # - name: Extract Tar TF Providers and Modules # run: tar -xvf tf-providers-modules.tar From 822bfe05b2203fec9991de2df9c1732969fea89f Mon Sep 17 00:00:00 2001 From: Priyesh Mistry Date: Fri, 10 Jan 2025 11:30:46 +0000 Subject: [PATCH 19/26] chore: tidying up tarring --- .github/workflows/terraform-plan-and-apply-aws.yml | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/.github/workflows/terraform-plan-and-apply-aws.yml b/.github/workflows/terraform-plan-and-apply-aws.yml index 22825b6..83c824f 100644 --- a/.github/workflows/terraform-plan-and-apply-aws.yml +++ b/.github/workflows/terraform-plan-and-apply-aws.yml @@ -745,14 +745,9 @@ jobs: uses: actions/download-artifact@v4 with: name: tf-providers-modules - path: . -# - name: Extract Tar TF Providers and Modules -# run: tar -xvf tf-providers-modules.tar - -# - 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: Extract Tar TF Providers and Modules + run: tar -xvf tf-providers-modules.tar - name: Download tfplan uses: actions/download-artifact@v4 From b9cd197251ac0a319f3f4dc3f0996dbe04f96083 Mon Sep 17 00:00:00 2001 From: Priyesh Mistry Date: Fri, 10 Jan 2025 11:50:07 +0000 Subject: [PATCH 20/26] chre: tidy up --- .github/workflows/terraform-plan-and-apply-aws.yml | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/.github/workflows/terraform-plan-and-apply-aws.yml b/.github/workflows/terraform-plan-and-apply-aws.yml index 83c824f..ac777d0 100644 --- a/.github/workflows/terraform-plan-and-apply-aws.yml +++ b/.github/workflows/terraform-plan-and-apply-aws.yml @@ -435,10 +435,8 @@ jobs: compression-level: 9 path: "tfplan*" retention-days: 14 - - name: Tar TF Providers and Modules run: tar -cvf tf-providers-modules.tar .terraform - - name: Upload TF Providers and Modules uses: actions/upload-artifact@v4 with: @@ -447,7 +445,6 @@ jobs: 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: | @@ -676,7 +673,7 @@ jobs: terraform-apply: name: "Terraform Apply" -# if: github.ref == 'refs/heads/main' && contains(fromJSON('["push", "schedule"]'), github.event_name) && inputs.enable-terraform-apply + if: github.ref == 'refs/heads/main' && contains(fromJSON('["push", "schedule"]'), github.event_name) && inputs.enable-terraform-apply environment: ${{ inputs.environment }} runs-on: ${{ inputs.runs-on }} defaults: @@ -740,15 +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: 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: @@ -759,10 +753,6 @@ jobs: with: name: additional-dir-${{ inputs.environment }} path: ${{ inputs.additional-dir }} - - - name: Setup tmate session - uses: mxschmitt/action-tmate@v3 - - name: Terraform Apply run: | terraform apply \ From acb3333adbe4e5395949791f0546ad2e156f15d3 Mon Sep 17 00:00:00 2001 From: Priyesh Mistry Date: Fri, 10 Jan 2025 11:55:16 +0000 Subject: [PATCH 21/26] chore: testing adjusted compression level --- .github/workflows/terraform-plan-and-apply-aws.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/terraform-plan-and-apply-aws.yml b/.github/workflows/terraform-plan-and-apply-aws.yml index ac777d0..7accf78 100644 --- a/.github/workflows/terraform-plan-and-apply-aws.yml +++ b/.github/workflows/terraform-plan-and-apply-aws.yml @@ -435,13 +435,13 @@ jobs: compression-level: 9 path: "tfplan*" retention-days: 14 - - name: Tar TF Providers and Modules + - 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: 9 + compression-level: 0 path: tf-providers-modules.tar include-hidden-files: 'true' retention-days: 14 @@ -673,7 +673,7 @@ jobs: terraform-apply: name: "Terraform Apply" - if: github.ref == 'refs/heads/main' && contains(fromJSON('["push", "schedule"]'), github.event_name) && inputs.enable-terraform-apply +# if: github.ref == 'refs/heads/main' && contains(fromJSON('["push", "schedule"]'), github.event_name) && inputs.enable-terraform-apply environment: ${{ inputs.environment }} runs-on: ${{ inputs.runs-on }} defaults: From e2c98c92d0a053f45a5a60230ab78e988f77a6d4 Mon Sep 17 00:00:00 2001 From: Priyesh Mistry Date: Fri, 10 Jan 2025 13:00:49 +0000 Subject: [PATCH 22/26] chore: testing adjusted compression level 6 --- .github/workflows/terraform-plan-and-apply-aws.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/terraform-plan-and-apply-aws.yml b/.github/workflows/terraform-plan-and-apply-aws.yml index 7accf78..22dae80 100644 --- a/.github/workflows/terraform-plan-and-apply-aws.yml +++ b/.github/workflows/terraform-plan-and-apply-aws.yml @@ -441,7 +441,7 @@ jobs: uses: actions/upload-artifact@v4 with: name: tf-providers-modules - compression-level: 0 + compression-level: 6 path: tf-providers-modules.tar include-hidden-files: 'true' retention-days: 14 From 3e250fb226ebb6f4c808d8640b1d7c290a07fdf1 Mon Sep 17 00:00:00 2001 From: Priyesh Mistry Date: Fri, 10 Jan 2025 13:04:08 +0000 Subject: [PATCH 23/26] chore: testing adjusted compression level 5 --- .github/workflows/terraform-plan-and-apply-aws.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/terraform-plan-and-apply-aws.yml b/.github/workflows/terraform-plan-and-apply-aws.yml index 22dae80..f589716 100644 --- a/.github/workflows/terraform-plan-and-apply-aws.yml +++ b/.github/workflows/terraform-plan-and-apply-aws.yml @@ -441,7 +441,7 @@ jobs: uses: actions/upload-artifact@v4 with: name: tf-providers-modules - compression-level: 6 + compression-level: 5 path: tf-providers-modules.tar include-hidden-files: 'true' retention-days: 14 From b10273e9068f7e27ca61c85609242d6c1aaf9cd6 Mon Sep 17 00:00:00 2001 From: Priyesh Mistry Date: Fri, 10 Jan 2025 13:08:56 +0000 Subject: [PATCH 24/26] chore: testing adjusted compression level 3 --- .github/workflows/terraform-plan-and-apply-aws.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/terraform-plan-and-apply-aws.yml b/.github/workflows/terraform-plan-and-apply-aws.yml index f589716..f0e18f2 100644 --- a/.github/workflows/terraform-plan-and-apply-aws.yml +++ b/.github/workflows/terraform-plan-and-apply-aws.yml @@ -441,7 +441,7 @@ jobs: uses: actions/upload-artifact@v4 with: name: tf-providers-modules - compression-level: 5 + compression-level: 3 path: tf-providers-modules.tar include-hidden-files: 'true' retention-days: 14 From d93781a1ecfb481be2b89769c77c820fb59da6b6 Mon Sep 17 00:00:00 2001 From: Priyesh Mistry Date: Fri, 10 Jan 2025 13:12:37 +0000 Subject: [PATCH 25/26] chore: adjusted compression level 5 --- .github/workflows/terraform-plan-and-apply-aws.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/terraform-plan-and-apply-aws.yml b/.github/workflows/terraform-plan-and-apply-aws.yml index f0e18f2..f589716 100644 --- a/.github/workflows/terraform-plan-and-apply-aws.yml +++ b/.github/workflows/terraform-plan-and-apply-aws.yml @@ -441,7 +441,7 @@ jobs: uses: actions/upload-artifact@v4 with: name: tf-providers-modules - compression-level: 3 + compression-level: 5 path: tf-providers-modules.tar include-hidden-files: 'true' retention-days: 14 From c1c44c34af1641f672ba3f956717809e7d19aac8 Mon Sep 17 00:00:00 2001 From: Priyesh Mistry Date: Mon, 13 Jan 2025 13:18:48 +0000 Subject: [PATCH 26/26] chore: tidy up --- .github/workflows/terraform-plan-and-apply-aws.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/terraform-plan-and-apply-aws.yml b/.github/workflows/terraform-plan-and-apply-aws.yml index f589716..6d20f3e 100644 --- a/.github/workflows/terraform-plan-and-apply-aws.yml +++ b/.github/workflows/terraform-plan-and-apply-aws.yml @@ -673,7 +673,7 @@ jobs: terraform-apply: name: "Terraform Apply" -# if: github.ref == 'refs/heads/main' && contains(fromJSON('["push", "schedule"]'), github.event_name) && inputs.enable-terraform-apply + if: github.ref == 'refs/heads/main' && contains(fromJSON('["push", "schedule"]'), github.event_name) && inputs.enable-terraform-apply environment: ${{ inputs.environment }} runs-on: ${{ inputs.runs-on }} defaults: