Repository navigation
fix(zone_dnssec): set status = "active" so migrated configs don't drift - #342
Merged
Merged
Conversation
…ft (BUGS-2130) v4 always enabled DNSSEC and status was computed-only. In v5 status is optional and not computed, so a migrated config without it plans status = "active" -> null on every run. Write status = "active" when the config has none; leave an explicit status alone. Also fix the README, which described status being copied from state (removed in #241).
vaishakdinesh
approved these changes
Nov 2, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
cloudflare_zone_dnssec: writestatus = "active"when the v4 config has nostatus. An explicitstatusis left alone.Motivation
Internal report BUGS-2130: after migrating, every plan shows
and the diff never goes away. Setting
status = "active"by hand fixes it. In v4,statuswas computed-only and Create always enabled DNSSEC (UpdateZoneDNSSEC(... Status: active)unless already active/pending). In v5,statusisOptionaland not computed (internal/services/zone_dnssec/schema.goin the provider), so a config without it plans the API's"active"back to null on every refresh. That makes"active"the faithful translation of v4 behaviour.The README described
statusbeing copied from state. That went away with the state pipeline in #241, so I've corrected it. It now also covers the edge case where DNSSEC was disabled outside Terraform: the first v5 plan shows"disabled" -> "active", and the user can setstatus = "disabled".I left the
status_to_nulldrift exemption alone. It also coverspending/disabledcases, which are out of scope here.Type of change
Testing
go test ./internal/resources/zone_dnssec/, with updated expectations plus a new case that keeps an existingstatusTEST_RESOURCE=zone_dnssec go test ./integration/v4_to_v5 -run TestSingleResource, with the expected fixture updatedmake lint-testdatapassesChecklist
internal/registry/registry.go(n/a)cftftestprefix (unchanged)# MIGRATION WARNINGcomments are documented inDIAGNOSTICS.md(n/a)