Skip to content

Repository files navigation

Azure Verified Modules TFLint Ruleset

Build Status

This repository contains the TFLint ruleset for Azure Verified Modules.

Embedded AzAPI tag capabilities

The azapi_resource_tag rule uses a standalone, embedded snapshot at internal/tagcapability/data/azapi_tags_v1.json; it does not download schemas at runtime or depend on the AzAPI provider. The snapshot records its MIT-licensed upstream sources and exact revisions. The weekly/manual Update AzAPI Tag Snapshot workflow regenerates it from azure-rest-api-specs through bicep-types-az, validates it, and opens or updates a deterministic PR only when the data changes.

Requirements

  • TFLint v0.62+
  • Go v1.26+

Installation

You can install a released plugin with tflint --init. Declare a config in .tflint.hcl, replacing X.Y.Z with the release version without the v prefix:

plugin "avm" {
  enabled = true

  version   = "X.Y.Z"
  source    = "github.com/Azure/tflint-ruleset-avm"
  signature = "attestation"
}

Rules

Name Enabled Severity Link
azapi_data_response_export_values true ERROR https://azure.github.io/Azure-Verified-Modules/specs/tf/a...
azapi_replace_triggers_refs true ERROR https://azure.github.io/Azure-Verified-Modules/spec/TFFR5/
azapi_resource_tag true ERROR https://aka.ms/avm/spec/TFFR9
azapi_response_export_values true ERROR https://azure.github.io/Azure-Verified-Modules/specs/tf/a...
customer_managed_key true ERROR https://azure.github.io/Azure-Verified-Modules/specs/tf/i...
deprecated_lock_interface true NOTICE https://azure.github.io/Azure-Verified-Modules/specs/tf/i...
deprecated_private_endpoints_interface true NOTICE https://azure.github.io/Azure-Verified-Modules/specs/tf/i...
deprecated_role_assignments_interface true NOTICE https://azure.github.io/Azure-Verified-Modules/specs/tf/i...
diagnostic_settings true ERROR https://azure.github.io/Azure-Verified-Modules/specs/tf/i...
ignore_body_changes true ERROR https://azure.github.io/Azure-Verified-Modules/spec/TFFR8/
location true ERROR https://azure.github.io/Azure-Verified-Modules/specs/tf/r...
lock true ERROR https://azure.github.io/Azure-Verified-Modules/specs/tf/i...
managed_identities true ERROR https://azure.github.io/Azure-Verified-Modules/specs/tf/i...
no_entire_resource_output_tffr2 true ERROR https://azure.github.io/Azure-Verified-Modules/specs/tf/r...
private_endpoints true ERROR https://azure.github.io/Azure-Verified-Modules/specs/tf/i...
private_endpoints_manage_dns_zone_group true ERROR https://azure.github.io/Azure-Verified-Modules/includes/i...
provider_azapi_version_constraint true ERROR -
provider_azurerm_disallowed true ERROR -
provider_azurerm_version_constraint true ERROR -
provider_modtm_version_constraint true ERROR -
required_module_source_tffr1 true ERROR https://azure.github.io/Azure-Verified-Modules/specs/terr...
required_module_source_tfnfr10 true ERROR https://azure.github.io/Azure-Verified-Modules/specs/terr...
required_output_rmfr7 true ERROR https://azure.github.io/Azure-Verified-Modules/specs/shar...
resource_types true ERROR https://azure.github.io/Azure-Verified-Modules/spec/TFFR6/
retry true ERROR https://azure.github.io/Azure-Verified-Modules/spec/TFFR7/
role_assignments true ERROR https://azure.github.io/Azure-Verified-Modules/specs/tf/i...
tags true ERROR https://azure.github.io/Azure-Verified-Modules/specs/tf/i...
terraform_heredoc_usage true NOTICE https://aka.ms/avm/spec/TFNFR40
terraform_module_provider_declaration true WARNING https://azure.github.io/Azure-Verified-Modules/spec/TFNFR27/
terraform_sensitive_variable_no_default true WARNING https://azure.github.io/Azure-Verified-Modules/spec/TFNFR23/
terraform_tf_file true ERROR https://azure.github.io/Azure-Verified-Modules/spec/TFNFR39/
timeouts true ERROR https://azure.github.io/Azure-Verified-Modules/spec/TFFR7/

See RULES.md for the full rules reference (same content, kept in sync automatically).

Regenerating the Rules Documentation

The full list of rules is generated automatically into RULES.md and mirrored into the ## Rules section above.

To regenerate after adding, removing, or modifying rules, run:

./scripts/update-readme.sh

This script:

  1. Runs go generate ./..., which executes cmd/rulesdoc to refresh RULES.md from rules.Rules.
  2. Splices the rules table from RULES.md into the <!-- RULES:START --> / <!-- RULES:END --> markers in README.md.

A GitHub Actions workflow (.github/workflows/rules-docs-check.yml) runs the same script on pull requests that touch rule sources and fails the build if README.md or RULES.md is out of date, so drift cannot land on main.

Building the plugin

Clone the repository locally and run the following command:

make

You can easily install the built plugin with the following:

make install

You can run the built plugin like the following:

$ cat << EOS > .tflint.hcl
plugin "avm" {
  enabled = true
}
EOS
$ tflint

Releasing

  1. Create and publish a GitHub pre-release with a vX.Y.Z tag and release notes.
  2. Queue the tflint-ruleset-avm release pipeline in github-private/azure/Azure-Verified-Modules with that tag.
  3. The pipeline builds every target in release/targets.json, Authenticode-signs the Windows binaries, packages and validates the assets, replaces the pre-release assets, and promotes the pre-release.
  4. Promotion triggers sign-checksums.yml, which validates the release assets and creates a GitHub Artifact Attestation for checksums.txt.

Release pipelines are manually queued and never run from a GitHub push or tag.

About

TFLint ruleset for Azure Verified Modules

Topics

Resources

Code of conduct

Security policy

Stars

16 stars

Watchers

4 watching

Forks

Releases

Packages

Used by

Contributors

Languages