Skip to content

feat: add TFFR8 spec for AzAPI ignore_body_changes variable - #2865

Draft
Jared Holgate (jaredfholgate) wants to merge 1 commit into
mainfrom
jaredfholgate-azapi-ignore-body-changes-spec
Draft

feat: add TFFR8 spec for AzAPI ignore_body_changes variable#2865
Jared Holgate (jaredfholgate) wants to merge 1 commit into
mainfrom
jaredfholgate-azapi-ignore-body-changes-spec

Conversation

@jaredfholgate

Copy link
Copy Markdown
Member

Description

Adds a new Terraform functional specification, TFFR8, requiring every module and submodule to expose an ignore_body_changes variable — the same way retry and timeouts are exposed today under TFFR7.

This is based on Azure/terraform-provider-azapi#1192, which re-introduces the write-only ignore_body_changes property on azapi_resource. It lets consumers suppress drift on specific body paths using values derived from variables, which lifecycle.ignore_changes cannot do because it requires static paths.

Design decisions

Scoped, not cascaded. retry and timeouts are resource-agnostic, so a parent passes them to every submodule unchanged. ignore_body_changes values are dot-notation paths into one specific resource's body, so a blanket cascade would push meaningless paths at a different resource. TFFR8 therefore follows the nested-slot model from TFFR6 resource_types: each module owns a slot per resource it manages, plus a slot per submodule mirroring that submodule's own variable.

Empty lists collapse to null. ignore_body_changes is a write-only attribute, so a non-null value requires Terraform 1.11 or later. An empty list is still non-null and would break every module for consumers on Terraform 1.6–1.10. The spec requires collapsing empty to null so AVM's required_version = "~> 1.6" baseline (TFNFR25) stays valid for anyone not using the feature.

Separate spec rather than extending TFFR7. The scoping model differs enough that folding it into TFFR7 would muddy that spec. TFFR8 is cross-referenced from TFFR7 with an explanation of why they are separate.

Changes

File Change
…/shared/functional/TFFR8.md New. The spec (priority 20080, MUST, all three module classes)
…/interfaces/tf/int.ignore_body_changes.schema.tf New. Authoritative variable declaration, azapi_resource usage, submodule cascade
…/interfaces/tf/int.ignore_body_changes.input.tf New. Consumer input example
specs/terraform/interfaces.md New AzAPI ignore_body_changes section
…/functional/TFFR7.md Cross-reference to TFFR8
…/non-functional/TFRMNFR1.md TFFR8 added to the submodule requirements list; both for_each examples updated
contributing/terraform/composition.md TFFR8 row added to the required AzAPI patterns table
…/functional/TFFR3.md Permitted AzAPI floor raised >= 2.0>= 2.12
…/non-functional/TFNFR25.md, TFNFR26.md, TFNFR27.md Example constraints ~> 2.9~> 2.12

Note on the provider version floor

ignore_body_changes is merged into azapi main but not yet released — the latest release is v2.11.0, so this lands in v2.12.0. The TFFR3 floor bump and the ~> 2.12 examples assume that version number and should be re-confirmed before merge.

Validation

Site builds cleanly with the CI-pinned Hugo version (0.136.5). TFFR8 renders, both includes resolve, cross-references from TFFR3/TFFR7/TFRMNFR1 link correctly, and the spec auto-appears in the res/ptn/utl spec indexes.

Adds a new Terraform functional specification requiring every module and
submodule to expose an `ignore_body_changes` variable, following the same
pattern used for `retry` and `timeouts` (TFFR7).

The variable uses the nested-slot model from `resource_types` (TFFR6)
rather than a blanket cascade, because `ignore_body_changes` paths are
scoped to a specific resource body and are not resource-agnostic.

Based on Azure/terraform-provider-azapi#1192, which re-introduces the
write-only `ignore_body_changes` property on `azapi_resource`.

- Add TFFR8 spec (priority 20080)
- Add int.ignore_body_changes.schema.tf and .input.tf interface includes
- Document the interface in the Terraform interfaces page
- Cross-reference from TFFR3, TFFR7, TFRMNFR1 and composition.md
- Raise the permitted AzAPI provider floor to >= 2.12

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
The `ignore_body_changes` variable **MUST**:

- Be a single `object({...})` (not a `map(list(string))`) so typos at call sites error at plan time and the full override surface is visible in the variable declaration.
- Default the variable itself to `{}` and be `nullable = false`, per [TFNFR20]({{% siteparam base %}}/spec/TFNFR20) and [TFNFR21]({{% siteparam base %}}/spec/TFNFR21).

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is a non-nullable field compatible with the specification on 37 that a consumer using earlier versions pass null for the ignore_body_changes field to prevent breaking?

I'm unfamiliar with how this works, maybe a null value from downstream is mapped to { } as specified in this line


### Applying the variable

`ignore_body_changes` is an attribute (not a block) on `azapi_resource`, so the relevant field of the variable is assigned directly. The assignment **MUST** collapse an empty list to `null` so that the write-only argument is absent when the feature is unused:

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, I think this might address my comment on 54. Will leave open so you can confirm for my own understanding

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants