Skip to content

fix(zone_dnssec): set status = "active" so migrated configs don't drift - #342

Merged
vaishakdinesh merged 1 commit into
mainfrom
dane/bugs-2130-zone-dnssec-status
Nov 2, 2026
Merged

vaishakdinesh merged 1 commit into
mainfrom
dane/bugs-2130-zone-dnssec-status

Conversation

@dknecht

@dknecht dknecht commented Nov 2, 2026

Copy link
Copy Markdown
Member

Description

cloudflare_zone_dnssec: write status = "active" when the v4 config has no status. An explicit status is left alone.

Motivation

Internal report BUGS-2130: after migrating, every plan shows

- status = "active" -> null

and the diff never goes away. Setting status = "active" by hand fixes it. In v4, status was computed-only and Create always enabled DNSSEC (UpdateZoneDNSSEC(... Status: active) unless already active/pending). In v5, status is Optional and not computed (internal/services/zone_dnssec/schema.go in 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 status being 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 set status = "disabled".

I left the status_to_null drift exemption alone. It also covers pending/disabled cases, which are out of scope here.

Type of change

  • New resource transformer
  • Fix to an existing transformer
  • CLI / framework change
  • Documentation
  • Test / CI
  • Refactoring (no behaviour change)

Testing

  • Unit tests: go test ./internal/resources/zone_dnssec/, with updated expectations plus a new case that keeps an existing status
  • Integration tests: TEST_RESOURCE=zone_dnssec go test ./integration/v4_to_v5 -run TestSingleResource, with the expected fixture updated
  • E2E tests (if applicable)
  • make lint-testdata passes

Checklist

  • I have read CONTRIBUTING.md
  • New resource transformers are registered in internal/registry/registry.go (n/a)
  • Testdata resource names use the cftftest prefix (unchanged)
  • Any # MIGRATION WARNING comments are documented in DIAGNOSTICS.md (n/a)

…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).
@dknecht
dknecht requested a review from a team as a code owner November 2, 2026 02:01
@vaishakdinesh
vaishakdinesh merged commit 4b03f46 into main Nov 2, 2026
11 checks passed
@vaishakdinesh
vaishakdinesh deleted the dane/bugs-2130-zone-dnssec-status branch November 2, 2026 21:12
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