diff --git a/.githooks/pre-commit b/.githooks/pre-commit index 98253d7..1489b2b 100755 --- a/.githooks/pre-commit +++ b/.githooks/pre-commit @@ -46,6 +46,11 @@ if command_exists ./node_modules/.bin/prettier; then echo "$files" | xargs ./node_modules/.bin/prettier --ignore-unknown --write fi +if command_exists tflint; then + tflint --init + tflint --config "$(pwd)/.tflint.hcl" --color --recursive +fi + # Add the modified/prettified files to staging echo "$files" | xargs git add diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f1c2f66..696a8ac 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -85,6 +85,21 @@ jobs: git diff --exit-code --color=always || ( echo "Terraform docs are out-of-date. See the diff above." && exit 1 ) + tflint: + runs-on: ubuntu-latest + + env: + TFLINT_CONFIG_FILE: "${{ github.workspace }}/.tflint.hcl" + + steps: + - uses: actions/checkout@v4 + - uses: terraform-linters/setup-tflint@v4 + with: + tflint_version: "latest" + + - run: tflint --init + - run: tflint --color --recursive + prettier: runs-on: ubuntu-latest steps: diff --git a/.tflint.hcl b/.tflint.hcl new file mode 100644 index 0000000..4e0dd53 --- /dev/null +++ b/.tflint.hcl @@ -0,0 +1,25 @@ +tflint { + required_version = ">= 0.53.0" +} + +config { + plugin_dir = "~/.tflint.d/plugins" + call_module_type = "local" +} + +plugin "terraform" { + enabled = true + preset = "all" +} + +plugin "aws" { + enabled = true + version = "0.38.0" + source = "github.com/terraform-linters/tflint-ruleset-aws" +} + +plugin "azurerm" { + enabled = true + version = "0.27.0" + source = "github.com/terraform-linters/tflint-ruleset-azurerm" +} diff --git a/asset-account/terraform/stack-set/README.md b/asset-account/terraform/stack-set/README.md index 82ddbc0..b45a7d8 100644 --- a/asset-account/terraform/stack-set/README.md +++ b/asset-account/terraform/stack-set/README.md @@ -65,10 +65,10 @@ No modules. | [managed_execution](#input_managed_execution) | [See docs here](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/cloudformation_stack_set#managed_execution-1) |
object({
active = optional(bool)
}) | `null` | no |
| [operation_preferences](#input_operation_preferences) | [See docs here](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/cloudformation_stack_instances#operation_preferences) | object({
concurrency_mode = optional(string)
failure_tolerance_count = optional(number)
failure_tolerance_percentage = optional(number)
max_concurrent_count = optional(number)
max_concurrent_percentage = optional(number)
# Region settings are not supported, because
# there must be at most one stack per account
# in a single region.
}) | `null` | no |
| [permission_model](#input_permission_model) | [See docs here](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/cloudformation_stack_set#permission_model-1) | `string` | `null` | no |
-| [region](#input_region) | The AWS region where the Elastio Asset Account stack instances will be deployed.