From 1eb1456ba7d1434bcfdcdbde6829fd1b6f8b49c0 Mon Sep 17 00:00:00 2001 From: ActuarySailor <24359398+actuarysailor@users.noreply.github.com> Date: Fri, 15 Aug 2025 21:51:34 -0400 Subject: [PATCH 01/14] chore: Retry logic for terraform validate --- .pre-commit-hooks.yaml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.pre-commit-hooks.yaml b/.pre-commit-hooks.yaml index 507d7e2ed..67bcc072b 100644 --- a/.pre-commit-hooks.yaml +++ b/.pre-commit-hooks.yaml @@ -196,12 +196,13 @@ name: Terraform validate (Docker) description: >- Validates all Terraform configuration files using Docker. + Automatically runs 'terraform init' and retries validation if provider/module errors are detected. NOTE: Requires Docker to be available. Use 'skip' in .pre-commit-config.yaml if running on pre-commit.ci or other environments without Docker. require_serial: true entry: ghcr.io/actuarysailor/pre-commit-terraform-tools:latest language: docker_image - args: [terraform, validate] + args: [/usr/bin/hooks/terraform_validate.sh, --hook-config=--retry-once-with-cleanup=true] pass_filenames: false files: \.(tf|tofu|tfvars|terraform\.lock\.hcl)$ exclude: \.terraform/.*$ From 989472e42bd4069ac045bb3481c65ff07490df99 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Sat, 16 Aug 2025 02:01:56 +0000 Subject: [PATCH 02/14] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- .pre-commit-hooks.yaml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.pre-commit-hooks.yaml b/.pre-commit-hooks.yaml index 67bcc072b..f9696133e 100644 --- a/.pre-commit-hooks.yaml +++ b/.pre-commit-hooks.yaml @@ -196,7 +196,8 @@ name: Terraform validate (Docker) description: >- Validates all Terraform configuration files using Docker. - Automatically runs 'terraform init' and retries validation if provider/module errors are detected. + Automatically runs 'terraform init' and retries validation if provider/module + errors are detected. NOTE: Requires Docker to be available. Use 'skip' in .pre-commit-config.yaml if running on pre-commit.ci or other environments without Docker. require_serial: true From 4fdc60d5bd768ae05b9e61e83d09976dd8f01d70 Mon Sep 17 00:00:00 2001 From: ActuarySailor <24359398+actuarysailor@users.noreply.github.com> Date: Fri, 15 Aug 2025 22:10:37 -0400 Subject: [PATCH 03/14] chore: Linting --- examples/.pre-commit-config-docker.yaml | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/examples/.pre-commit-config-docker.yaml b/examples/.pre-commit-config-docker.yaml index bbe1a4ba6..a85a68697 100644 --- a/examples/.pre-commit-config-docker.yaml +++ b/examples/.pre-commit-config-docker.yaml @@ -3,9 +3,15 @@ # Skip Docker hooks on pre-commit.ci (which doesn't support Docker) ci: - skip: [terraform_fmt_docker, terraform_validate_docker, terraform_tflint_docker, - terraform_docs_docker, terraform_checkov_docker, terraform_trivy_docker, - infracost_breakdown_docker] + skip: [ + terraform_fmt_docker, + terraform_validate_docker, + terraform_tflint_docker, + terraform_docs_docker, + terraform_checkov_docker, + terraform_trivy_docker, + infracost_breakdown_docker + ] repos: - repo: https://github.com/actuarysailor/pre-commit-terraform From 26e2d3a9ae82f55ff7bb09578102805bd06cf04a Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Sat, 16 Aug 2025 02:11:01 +0000 Subject: [PATCH 04/14] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- examples/.pre-commit-config-docker.yaml | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/examples/.pre-commit-config-docker.yaml b/examples/.pre-commit-config-docker.yaml index a85a68697..bbe1a4ba6 100644 --- a/examples/.pre-commit-config-docker.yaml +++ b/examples/.pre-commit-config-docker.yaml @@ -3,15 +3,9 @@ # Skip Docker hooks on pre-commit.ci (which doesn't support Docker) ci: - skip: [ - terraform_fmt_docker, - terraform_validate_docker, - terraform_tflint_docker, - terraform_docs_docker, - terraform_checkov_docker, - terraform_trivy_docker, - infracost_breakdown_docker - ] + skip: [terraform_fmt_docker, terraform_validate_docker, terraform_tflint_docker, + terraform_docs_docker, terraform_checkov_docker, terraform_trivy_docker, + infracost_breakdown_docker] repos: - repo: https://github.com/actuarysailor/pre-commit-terraform From 0ee1b2935c9cf53fed3dad834fe71658c5713865 Mon Sep 17 00:00:00 2001 From: ActuarySailor <24359398+actuarysailor@users.noreply.github.com> Date: Fri, 15 Aug 2025 22:33:13 -0400 Subject: [PATCH 05/14] chore: One more tweak --- .pre-commit-hooks.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pre-commit-hooks.yaml b/.pre-commit-hooks.yaml index f9696133e..123e83984 100644 --- a/.pre-commit-hooks.yaml +++ b/.pre-commit-hooks.yaml @@ -203,7 +203,7 @@ require_serial: true entry: ghcr.io/actuarysailor/pre-commit-terraform-tools:latest language: docker_image - args: [/usr/bin/hooks/terraform_validate.sh, --hook-config=--retry-once-with-cleanup=true] + args: [bash, -c, "/usr/bin/hooks/terraform_validate.sh --hook-config=--retry-once-with-cleanup=true"] pass_filenames: false files: \.(tf|tofu|tfvars|terraform\.lock\.hcl)$ exclude: \.terraform/.*$ From 9c1d24d78727a1cad4df25f72cbd6ff48ff95722 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Sat, 16 Aug 2025 02:33:37 +0000 Subject: [PATCH 06/14] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- .pre-commit-hooks.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pre-commit-hooks.yaml b/.pre-commit-hooks.yaml index 123e83984..91be8c5c0 100644 --- a/.pre-commit-hooks.yaml +++ b/.pre-commit-hooks.yaml @@ -203,7 +203,7 @@ require_serial: true entry: ghcr.io/actuarysailor/pre-commit-terraform-tools:latest language: docker_image - args: [bash, -c, "/usr/bin/hooks/terraform_validate.sh --hook-config=--retry-once-with-cleanup=true"] + args: [bash, -c, /usr/bin/hooks/terraform_validate.sh --hook-config=--retry-once-with-cleanup=true] pass_filenames: false files: \.(tf|tofu|tfvars|terraform\.lock\.hcl)$ exclude: \.terraform/.*$ From 027bd5a9646e1251297b005418ae1e1886541427 Mon Sep 17 00:00:00 2001 From: ActuarySailor <24359398+actuarysailor@users.noreply.github.com> Date: Fri, 15 Aug 2025 22:44:52 -0400 Subject: [PATCH 07/14] ci: One more tweak --- .pre-commit-hooks.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pre-commit-hooks.yaml b/.pre-commit-hooks.yaml index 91be8c5c0..494733b60 100644 --- a/.pre-commit-hooks.yaml +++ b/.pre-commit-hooks.yaml @@ -203,7 +203,7 @@ require_serial: true entry: ghcr.io/actuarysailor/pre-commit-terraform-tools:latest language: docker_image - args: [bash, -c, /usr/bin/hooks/terraform_validate.sh --hook-config=--retry-once-with-cleanup=true] + args: [bash, -c, "/usr/bin/hooks/terraform_validate.sh --hook-config=--retry-once-with-cleanup=true --hook-config=--parallelism-ci-cpu-cores=2"] pass_filenames: false files: \.(tf|tofu|tfvars|terraform\.lock\.hcl)$ exclude: \.terraform/.*$ From 90abcdb5cd53541152652d917b0480ce6405ddfc Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Sat, 16 Aug 2025 02:45:16 +0000 Subject: [PATCH 08/14] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- .pre-commit-hooks.yaml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.pre-commit-hooks.yaml b/.pre-commit-hooks.yaml index 494733b60..a8f6d91e3 100644 --- a/.pre-commit-hooks.yaml +++ b/.pre-commit-hooks.yaml @@ -203,7 +203,8 @@ require_serial: true entry: ghcr.io/actuarysailor/pre-commit-terraform-tools:latest language: docker_image - args: [bash, -c, "/usr/bin/hooks/terraform_validate.sh --hook-config=--retry-once-with-cleanup=true --hook-config=--parallelism-ci-cpu-cores=2"] + args: [bash, -c, /usr/bin/hooks/terraform_validate.sh --hook-config=--retry-once-with-cleanup=true + --hook-config=--parallelism-ci-cpu-cores=2] pass_filenames: false files: \.(tf|tofu|tfvars|terraform\.lock\.hcl)$ exclude: \.terraform/.*$ From c727f5e9c01955b135f6287acc107c4b703c387c Mon Sep 17 00:00:00 2001 From: ActuarySailor <24359398+actuarysailor@users.noreply.github.com> Date: Fri, 15 Aug 2025 22:47:43 -0400 Subject: [PATCH 09/14] chore: Temporary hack to use specific version --- .pre-commit-hooks.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pre-commit-hooks.yaml b/.pre-commit-hooks.yaml index a8f6d91e3..1ff3c518e 100644 --- a/.pre-commit-hooks.yaml +++ b/.pre-commit-hooks.yaml @@ -201,7 +201,7 @@ NOTE: Requires Docker to be available. Use 'skip' in .pre-commit-config.yaml if running on pre-commit.ci or other environments without Docker. require_serial: true - entry: ghcr.io/actuarysailor/pre-commit-terraform-tools:latest + entry: ghcr.io/actuarysailor/pre-commit-terraform-tools:sha-26e2d3a language: docker_image args: [bash, -c, /usr/bin/hooks/terraform_validate.sh --hook-config=--retry-once-with-cleanup=true --hook-config=--parallelism-ci-cpu-cores=2] From 5bd3444dd3d388b03eaa68c57420b4b9e5f433a0 Mon Sep 17 00:00:00 2001 From: ActuarySailor <24359398+actuarysailor@users.noreply.github.com> Date: Fri, 15 Aug 2025 23:12:12 -0400 Subject: [PATCH 10/14] chore: Fixing hook still --- .pre-commit-hooks.yaml | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/.pre-commit-hooks.yaml b/.pre-commit-hooks.yaml index 1ff3c518e..3ab93a0be 100644 --- a/.pre-commit-hooks.yaml +++ b/.pre-commit-hooks.yaml @@ -203,8 +203,12 @@ require_serial: true entry: ghcr.io/actuarysailor/pre-commit-terraform-tools:sha-26e2d3a language: docker_image - args: [bash, -c, /usr/bin/hooks/terraform_validate.sh --hook-config=--retry-once-with-cleanup=true - --hook-config=--parallelism-ci-cpu-cores=2] + args: + - /usr/bin/hooks/terraform_validate.sh + - --hook-config=--retry-once-with-cleanup=true + - --hook-config=--parallelism-ci-cpu-cores=2 + - -- + - . pass_filenames: false files: \.(tf|tofu|tfvars|terraform\.lock\.hcl)$ exclude: \.terraform/.*$ From 28c5bfadb1f6b4f8d10e0cc45f2a1d82ddd2e32a Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Sat, 16 Aug 2025 03:12:37 +0000 Subject: [PATCH 11/14] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- .pre-commit-hooks.yaml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.pre-commit-hooks.yaml b/.pre-commit-hooks.yaml index 3ab93a0be..0545e8c14 100644 --- a/.pre-commit-hooks.yaml +++ b/.pre-commit-hooks.yaml @@ -203,12 +203,12 @@ require_serial: true entry: ghcr.io/actuarysailor/pre-commit-terraform-tools:sha-26e2d3a language: docker_image - args: - - /usr/bin/hooks/terraform_validate.sh - - --hook-config=--retry-once-with-cleanup=true - - --hook-config=--parallelism-ci-cpu-cores=2 - - -- - - . + args: + - /usr/bin/hooks/terraform_validate.sh + - --hook-config=--retry-once-with-cleanup=true + - --hook-config=--parallelism-ci-cpu-cores=2 + - -- + - . pass_filenames: false files: \.(tf|tofu|tfvars|terraform\.lock\.hcl)$ exclude: \.terraform/.*$ From 4b405546222cb4f65e89cfbbd6a9a024ae0ae574 Mon Sep 17 00:00:00 2001 From: ActuarySailor <24359398+actuarysailor@users.noreply.github.com> Date: Sat, 16 Aug 2025 00:33:44 -0400 Subject: [PATCH 12/14] chore: Fixing lint nightmare --- examples/.pre-commit-config-docker.yaml | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/examples/.pre-commit-config-docker.yaml b/examples/.pre-commit-config-docker.yaml index bbe1a4ba6..aad8464ec 100644 --- a/examples/.pre-commit-config-docker.yaml +++ b/examples/.pre-commit-config-docker.yaml @@ -3,9 +3,14 @@ # Skip Docker hooks on pre-commit.ci (which doesn't support Docker) ci: - skip: [terraform_fmt_docker, terraform_validate_docker, terraform_tflint_docker, - terraform_docs_docker, terraform_checkov_docker, terraform_trivy_docker, - infracost_breakdown_docker] + skip: + - terraform_fmt_docker + - terraform_validate_docker + - terraform_tflint_docker + - terraform_docs_docker + - terraform_checkov_docker + - terraform_trivy_docker + - infracost_breakdown_docker repos: - repo: https://github.com/actuarysailor/pre-commit-terraform From 647b9a1581c81aede349976ba09f768149f67550 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Sat, 16 Aug 2025 04:34:09 +0000 Subject: [PATCH 13/14] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- examples/.pre-commit-config-docker.yaml | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/examples/.pre-commit-config-docker.yaml b/examples/.pre-commit-config-docker.yaml index aad8464ec..91294d672 100644 --- a/examples/.pre-commit-config-docker.yaml +++ b/examples/.pre-commit-config-docker.yaml @@ -3,14 +3,14 @@ # Skip Docker hooks on pre-commit.ci (which doesn't support Docker) ci: - skip: - - terraform_fmt_docker - - terraform_validate_docker - - terraform_tflint_docker - - terraform_docs_docker - - terraform_checkov_docker - - terraform_trivy_docker - - infracost_breakdown_docker + skip: + - terraform_fmt_docker + - terraform_validate_docker + - terraform_tflint_docker + - terraform_docs_docker + - terraform_checkov_docker + - terraform_trivy_docker + - infracost_breakdown_docker repos: - repo: https://github.com/actuarysailor/pre-commit-terraform From b3e14c8ea8f39abeea958e9e29c198b9c80d9f41 Mon Sep 17 00:00:00 2001 From: ActuarySailor <24359398+actuarysailor@users.noreply.github.com> Date: Sat, 16 Aug 2025 00:40:15 -0400 Subject: [PATCH 14/14] chore: Restore latest docker image --- .pre-commit-hooks.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pre-commit-hooks.yaml b/.pre-commit-hooks.yaml index 0545e8c14..bc5c5882f 100644 --- a/.pre-commit-hooks.yaml +++ b/.pre-commit-hooks.yaml @@ -201,7 +201,7 @@ NOTE: Requires Docker to be available. Use 'skip' in .pre-commit-config.yaml if running on pre-commit.ci or other environments without Docker. require_serial: true - entry: ghcr.io/actuarysailor/pre-commit-terraform-tools:sha-26e2d3a + entry: ghcr.io/actuarysailor/pre-commit-terraform-tools:latest language: docker_image args: - /usr/bin/hooks/terraform_validate.sh