TFFR5 - AzAPI - replace_triggers_refs

ID: TFFR5 - Category: Composition - AzAPI - replace_triggers_refs

This requirement is enforced by azapi_replace_triggers_refs.

Authors MUST omit replace_triggers_refs when no body properties require replacement.
When one or more body properties require replacement, authors MUST set replace_triggers_refs to a non-empty static list of JMESPath expressions that identify those paths.

Each expression MUST be valid JMESPath syntax, non-blank, and unique within the list.
Do not include name or location, as AzAPI already replaces the resource when either changes.
When the resource body is statically evaluable, every declared expression MUST resolve against that body.

This is to ensure that changes to properties that require replacement of the resource are handled correctly by Terraform.
Authors remain responsible for identifying every property that actually requires replacement. Current Bicep-generated schemas do not reliably preserve whether a property is create-only or updateable, so the rule validates declared paths but cannot prove that the list is semantically complete.

resource "azapi_resource" "example" {
  type      = "Microsoft.Example/resourceType@2021-01-01"
  name      = "example-resource"
  location  = "West US"
  replace_triggers_refs = [
    "properties.exampleProperty"
  ]
  body = {
    properties = {
      exampleProperty = "exampleValue"
    }
  }
}