Azure Verified Modules (AVM) — Terraform
Core workflow and checklists for AVM-compliant Terraform modules.
Upstream source: AVM Terraform Requirements
| Reference | Content |
|---|---|
| references/avm-requirements.md | Full TFFR/TFNFR requirement specs |
| references/examples.md | Bad-vs-good HCL patterns |
| references/vnet-guide.md | VNet injection workflow + tier-specific examples |
Quick Reference — Key Rules
Module References (MUST)
- Registry source with pinned version:
source = "Azure/xxx/azurerm"+version = "1.2.3" - No git references. No non-AVM modules.
Providers (MUST)
azurerm ~> 4.0and/orazapi ~> 2.0only- No
providerblocks in modules (exceptconfiguration_aliases)
Code Style (MUST)
- Lower
snake_casingeverywhere for_eachwithmap()orset()using static keys onlyignore_changesnot quoted (e.g.,[tags]not["tags"])- Dynamic blocks for conditional nested objects
- Block ordering: meta-args top → arguments alphabetical → meta-args bottom
coalesce()/try()for defaults instead of ternary
Variables (MUST)
- No
enabled/module_depends_onvariables - Every variable has
typeanddescription; required first (alphabetical), then optional - Collections:
nullable = false - No
sensitive = false(it's the default); no default values for sensitive inputs - Deprecated → move to
deprecated_variables.tfwithDEPRECATEDprefix
Outputs (MUST)
- Output only discrete computed attributes (not entire resource objects)
sensitive = truefor confidential data- Deprecated → move to
deprecated_outputs.tf
Breaking Changes (MUST)
- New resources in minor/patch: feature toggle variable with
default = false - Renamed resources:
movedblocks (no destroy/recreate) - Review all changes against TFNFR35 breaking change list
VNet Injection — Mandatory Verification
Verify exact networking requirements from official docs before writing any VNet injection, subnet delegation, or NSG config. Requirements differ across tiers/SKUs within the same service — wrong config leads to cryptic failures (MethodNotAllowedInPricingTier), subnet delegation conflicts, or missing NSG rules.
Follow the step-by-step verification workflow and tier-specific HCL examples in references/vnet-guide.md.
Quick Compliance Check
Before submitting, verify:
- Sources & providers — Registry-pinned sources, correct provider versions,
.terraform-docs.yml, CODEOWNERS - Code style — snake_casing, block ordering, dynamic blocks, static
for_eachkeys - Variables/outputs — AVM conventions (ordering, typing, sensitivity, deprecation)
- VNet config — Verified from official docs for exact tier/SKU (full checklist)
- Breaking changes — New resources gated by feature toggle; changes reviewed per TFNFR35
- Tests — terraform validate/fmt/test, terrafmt, Checkov, tflint
For full requirement details, see references/avm-requirements.md. For bad-vs-good HCL examples, see references/examples.md.