From fa05d40c7b12f3f3f5a77134aafa5b5f3b924210 Mon Sep 17 00:00:00 2001 From: Angel Abad Date: Mon, 29 May 2023 08:37:53 +0200 Subject: [PATCH] Update pre-commit for tflint use, and make it happy --- .pre-commit-config.yaml | 1 + examples/complete/README.md | 8 ++++++-- examples/complete/versions.tf | 13 +++++++++++++ examples/simple/README.md | 8 ++++++-- examples/simple/versions.tf | 13 +++++++++++++ 5 files changed, 39 insertions(+), 4 deletions(-) create mode 100644 examples/complete/versions.tf create mode 100644 examples/simple/versions.tf diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index d01adbc..4ea6f4a 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -4,6 +4,7 @@ repos: hooks: - id: terraform_fmt - id: terraform_docs + - id: terraform_tflint - repo: https://github.com/pre-commit/pre-commit-hooks rev: v4.4.0 # Use the ref you want to point at hooks: diff --git a/examples/complete/README.md b/examples/complete/README.md index 6a27c05..adf5af9 100644 --- a/examples/complete/README.md +++ b/examples/complete/README.md @@ -19,13 +19,17 @@ Note that this example may create resources which can cost money (Msk Cluster, f ## Requirements -No requirements. +| Name | Version | +|------|---------| +| [terraform](#requirement\_terraform) | >= 0.15 | +| [aws](#requirement\_aws) | >= 4.16 | +| [random](#requirement\_random) | >= 2.1 | ## Providers | Name | Version | |------|---------| -| [aws](#provider\_aws) | n/a | +| [aws](#provider\_aws) | >= 4.16 | ## Modules diff --git a/examples/complete/versions.tf b/examples/complete/versions.tf new file mode 100644 index 0000000..1255a07 --- /dev/null +++ b/examples/complete/versions.tf @@ -0,0 +1,13 @@ +terraform { + required_version = ">= 0.15" + required_providers { + aws = { + source = "hashicorp/aws" + version = ">= 4.16" + } + random = { + source = "hashicorp/random" + version = ">= 2.1" + } + } +} diff --git a/examples/simple/README.md b/examples/simple/README.md index 30dfd55..f33bd89 100644 --- a/examples/simple/README.md +++ b/examples/simple/README.md @@ -18,13 +18,17 @@ Note that this example may create resources which can cost money (Msk Cluster, f ## Requirements -No requirements. +| Name | Version | +|------|---------| +| [terraform](#requirement\_terraform) | >= 0.15 | +| [aws](#requirement\_aws) | >= 4.16 | +| [random](#requirement\_random) | >= 2.1 | ## Providers | Name | Version | |------|---------| -| [aws](#provider\_aws) | n/a | +| [aws](#provider\_aws) | >= 4.16 | ## Modules diff --git a/examples/simple/versions.tf b/examples/simple/versions.tf new file mode 100644 index 0000000..1255a07 --- /dev/null +++ b/examples/simple/versions.tf @@ -0,0 +1,13 @@ +terraform { + required_version = ">= 0.15" + required_providers { + aws = { + source = "hashicorp/aws" + version = ">= 4.16" + } + random = { + source = "hashicorp/random" + version = ">= 2.1" + } + } +}