avm-tf-submodules
Skill1 starsChanged 2 months agoMITView on GitHub
Use for AVM Terraform ARM subresources implemented as local submodules, including cardinality, parent_id, resource_types, retry, timeouts, ignore_body_changes, outputs, files, and tests.
232 other projects use a version of this.
Adopted by
Most recently taken up by
- Azure/terraform-azurerm-avm-ptn-commercial-marketplaceword for word, first seen Oct 25, 2026
- Azure/terraform-azurerm-avm-ptn-aca-lza-hosting-environmentword for word, first seen Oct 15, 2026
- Azure/terraform-azurerm-avm-res-dataprotection-backupvaultword for word, first seen Oct 10, 2026
- Azure/terraform-azure-avm-res-signalrservice-webpubsubword for word, first seen Oct 1, 2026
- Azure/terraform-azure-avm-res-insights-privatelinkscopeword for word, first seen Sep 30, 2026
- Azure/terraform-azure-avm-res-app-agentword for word, first seen Sep 28, 2026
Other versions232 projects use a version of this.
Word for word · 232
- Azure/terraform-azurerm-avm-ptn-alz★ 135100% same
- Azure/terraform-azurerm-avm-res-keyvault-vault★ 50100% same
- Azure/terraform-azurerm-avm-ptn-aks-production★ 44100% same
- Azure/terraform-azurerm-avm-ptn-aiml-landing-zone★ 42100% same
- Azure/terraform-azurerm-avm-ptn-cicd-agents-and-runners★ 42100% same
- Azure/terraform-azurerm-avm-res-compute-virtualmachine★ 42100% same
- Azure/terraform-azurerm-avm-res-containerservice-managedcluster★ 42100% same
- Azure/terraform-azurerm-avm-res-storage-storageaccount★ 39100% same
- Azure/terraform-azurerm-avm-res-web-site★ 34100% same
- Azure/terraform-azurerm-avm-res-network-privatednszone★ 32100% same
222 more not listed
Edited · 0
None found.
Wrote their own version · 0
None found.
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository15 other files it gives its agents.
- terraform/root/AGENTS.mdAGENTS.md
- terraform/root/.github/copilot-instructions.mdCopilot instructions
- avm-tf-azapiSkill
- avm-tf-classificationsSkill
- avm-tf-codestyleSkill
- avm-tf-conftestSkill
- avm-tf-documentationSkill
- avm-tf-interfacesSkill
- avm-tf-lifecycleSkill
- avm-tf-migrationSkill
- avm-tf-pattern-reviewSkill
- avm-tf-processSkill
- avm-tf-telemetrySkill
- avm-tf-testingSkill
- avm-tf-tflintSkill
The file
We split this skill into the rules it gives an agent
9 rules. About 0 are common, 7 are distinctive, and 2 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈7
Distinctive · estimate
This author's own choices. Worth a look.
2
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 57
Do not add count or for_each to the child's primary resource.
- Distinctive: line 61
Every submodule follows TFNFR39 and the applicable documentation, telemetry, and testing requirements:
- Distinctive: line 144
Document every owned-resource field and every nested submodule field in each variable description.
- Distinctive: line 150
Do not hard-code retry or timeout values that consumers cannot override.
- Distinctive: line 218
Prefer discrete outputs over whole-resource output objects.
- Distinctive: line 223
Add provider-mocked unit tests for child logic and parent aggregation.
- Distinctive: line 224
Add real-Azure integration coverage where ARM behavior matters.
- Distinctive: line 226
Verify parent and child resource IDs, nested interface propagation, and idempotency.
- Very specific: line 232
Prefer an in-place provider migration first, or publish explicit state migration steps and classify the extraction as breaking when …
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
AVM Terraform Submodules
TFRMNFR1 requires each ARM subresource to be implemented as a full local submodule under modules/<singular-name>/. Read TFRMNFR1 together with TFRMFR1, TFRMNFR2, TFFR6-TFFR8, TFNFR38, and TFNFR39 through https://azure.github.io/Azure-Verified-Modules/llms.txt.
Every new submodule that deploys an Azure resource MUST use AzAPI for every control-plane and supported direct Azure operation. Do not declare or configure hashicorp/azurerm, and do not create any azurerm_* resource or data source for convenience or supporting infrastructure in a submodule or its examples, tests, fixtures, or setup Terraform.
Cardinality
The parent owns for_each or count; the child primary resource owns one instance:
module "part" {
source = "./modules/part"
for_each = var.parts
name = each.value.name
parent_id = azapi_resource.this.id
resource_types = var.resource_types.example_widgets_parts
retry = var.retry
timeouts = var.timeouts
ignore_body_changes = var.ignore_body_changes.example_widgets_parts
}# modules/part/main.tf
resource "azapi_resource" "this" {
type = var.resource_types.example_widgets_parts
name = var.name
parent_id = var.parent_id
body = {
properties = var.properties
}
ignore_body_changes = length(var.ignore_body_changes.example_widgets_parts) > 0 ? var.ignore_body_changes.example_widgets_parts : null
response_export_values = []
retry = var.retry
dynamic "timeouts" {
for_each = var.timeouts == null ? [] : [var.timeouts]
content {
create = timeouts.value.create
read = timeouts.value.read
update = timeouts.value.update
delete = timeouts.value.delete
}
}
}Do not add count or for_each to the child's primary resource.
Required files
Every submodule follows TFNFR39 and the applicable documentation, telemetry, and testing requirements:
modules/part/
_footer.md
_header.md
main.tf
main.telemetry.tf
outputs.tf
README.md # generated
terraform.tf
variables.tf
locals.tf # when locals exist
tests/
unit/
integration/Additional files use canonical prefixes such as main.role_assignments.tf. The submodule declares every provider it consumes in its own terraform.tf; AzAPI is required. Each permitted azurerm_* resource or data-source block must independently implement one specific unsupported data-plane/non-ARM operation, document the exact block and AzAPI gap with an upstream AzAPI issue or pull request, and be replaced when support ships. One valid block does not authorize another.
Parent ID
Each submodule exposes required, non-null parent_id and assigns it to its primary resource:
variable "parent_id" {
type = string
nullable = false
description = "The fully-qualified ARM resource ID of the existing widget that will contain the part."
validation {
condition = can(provider::azapi::parse_resource_id("Microsoft.Example/widgets", var.parent_id))
error_message = "`parent_id` must be a valid widget resource ID."
}
}The parent normally passes azapi_resource.this.id. Do not replace this contract with resource_group_name, subscription IDs, or data-source reconstruction.
resource_types
The child owns its tested API-version default:
# modules/part/variables.tf
variable "resource_types" {
type = object({
example_widgets_parts = optional(string, "Microsoft.Example/widgets/parts@2024-01-01")
})
default = {}
nullable = false
description = <<DESCRIPTION
AzAPI resource types and API versions used by the part submodule.
- `example_widgets_parts` - Resource type and API version for the part.
DESCRIPTION
}The parent mirrors the complete child shape but does not repeat child string defaults:
variable "resource_types" {
type = object({
example_widgets = optional(string, "Microsoft.Example/widgets@2024-01-01")
example_widgets_parts = optional(object({
example_widgets_parts = optional(string)
}), {})
})
default = {}
nullable = false
description = <<DESCRIPTION
AzAPI resource types and API versions used by the module.
- `example_widgets` - Resource type and API version for the widget.
- `example_widgets_parts` - Resource-type overrides passed to the part submodule.
- `example_widgets_parts.example_widgets_parts` - Resource type and API-version override for the part.
DESCRIPTION
}Pass var.resource_types.example_widgets_parts unchanged to the child.
Document every owned-resource field and every nested submodule field in each variable description.
retry and timeouts
The parent cascades these resource-agnostic TFFR7 values unchanged. The child declares the same schemas and applies them to every AzAPI resource it owns.
Do not hard-code retry or timeout values that consumers cannot override.
ignore_body_changes
Paths are specific to one resource body, so the parent exposes a child-shaped nested slot:
variable "ignore_body_changes" {
type = object({
example_widgets = optional(list(string), [])
example_widgets_parts = optional(object({
example_widgets_parts = optional(list(string), [])
}), {})
})
default = {}
nullable = false
description = <<DESCRIPTION
Body-relative paths ignored for root and part resources. Paths use dot notation.
Changes take effect only after apply. Ignored configuration is not sent to Azure.
- `example_widgets` - Paths ignored on the widget resource.
- `example_widgets_parts` - Paths passed to the part submodule.
- `example_widgets_parts.example_widgets_parts` - Paths ignored on the part resource.
DESCRIPTION
}The child's variable contains its own field:
variable "ignore_body_changes" {
type = object({
example_widgets_parts = optional(list(string), [])
})
default = {}
nullable = false
description = <<DESCRIPTION
Body-relative paths ignored on the part resource. Paths use dot notation.
Changes take effect only after apply. Ignored configuration is not sent to Azure.
- `example_widgets_parts` - Paths ignored on the part resource.
DESCRIPTION
}Pass the nested slot unchanged. Do not pass the parent's example_widgets list to the child.
Outputs
The single-instance child exposes a scalar resource ID:
output "resource_id" {
value = azapi_resource.this.id
description = "The resource ID of the part."
}The parent aggregates naturally from the for_each module call:
output "part_resource_ids" {
value = { for key, part in module.part : key => part.resource_id }
description = "A map of part resource IDs keyed by the input map."
}Prefer discrete outputs over whole-resource output objects.
Documentation and tests
- Author
_header.mdand_footer.md; generate eachREADME.mdwithavm docsoravm pre-commit. - Add provider-mocked unit tests for child logic and parent aggregation.
- Add real-Azure integration coverage where ARM behavior matters.
- Exercise representative child instances through an E2E example.
- Verify parent and child resource IDs, nested interface propagation, and idempotency.
Migration warning
Extracting an existing root collection into a for_each submodule changes addresses from resource.type["key"] to module.child["key"].resource.this. A generic reusable moved block cannot preserve arbitrary consumer keys across that resource-to-module boundary.
Prefer an in-place provider migration first, or publish explicit state migration steps and classify the extraction as breaking when required. See avm-tf-migration.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

