feat(resmgr): pcd_cluster_blueprint resource (write path) — validated live - #33
Merged
Conversation
Supersedes the earlier "not viable" call. That conclusion was wrong — it was an artifact of the single-blueprint CE lab, where I had created a SECOND blueprint (unsupported) whose PUT then 404'd. PCD supports one blueprint per region; against a demo env with a single real blueprint the write path works, validated end-to-end through the provider (import -> clean plan -> in-place PUT update of dns_domain_name -> revert -> state rm; verified via the API). Design (the write API requires the whole object): - All attributes are Optional+Computed and the full object is sent on every write. After a write, state keeps the user-configured (known) plan values and refreshes only unknowns from the server — so the server's re-serialization or normalization of a configured attribute (notably the storage_backends_json JSON blob) can't trip "inconsistent result after apply". Verified live with storage_backends_json set (previously a guaranteed failure). - storage_backends_json is Sensitive (plaintext driver credentials), required on create (PCD 500s a blueprint with no backends), and read back so writes preserve the current backends unless changed. - Delete is a no-op that only removes the resource from Terraform state: a region singleton is normally imported, so destroy should stop managing it, not delete the cluster-defining blueprint every host/cluster depends on. - name is ForceNew. Adversarial review found 6 issues; all fixed: the storage_backends_json / known-plan round-trip (keep known values), missing UseStateForUnknown on three bools, warn-not-error on post-write read-back failure, and the no-op delete.
PF9-pushkar
added a commit
that referenced
this pull request
Jul 14, 2026
feat(resmgr): pcd_cluster_blueprint resource (write path) — validated live
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.
Adds the
pcd_cluster_blueprintresource, and supersedes the earlier "not viable" decision (#32).Why the earlier call was wrong
That conclusion — "blueprint update has no working path" — was an artifact of the single-blueprint CE lab. PCD supports one blueprint per region; my earlier update test had created a second blueprint (a state PCD doesn't support), whose
PUT /blueprint/{name}then 404'd. Against a demo env with a single real blueprint (cluster-1), the write path works — verified end-to-end through the provider:terraform import cluster-1→ clean plan (round-trip correct)applychangingdns_domain_name→0 added, 1 changed, 0 destroyed, confirmed via the APIstate rm(detached, not deleted).cluster-1restored to its original state.Design
The write API requires the whole object, so all attributes are
Optional+Computedand the full object is sent on every write. After a write, state keeps the user-configured (known) plan values and refreshes only unknowns from the server — so the server's re-serialization/normalization of a configured attribute can't trip "inconsistent result after apply".storage_backends_jsonis Sensitive (plaintext driver credentials), required on create (PCD 500s a blueprint with no backends), and read back so writes preserve the current backends unless changed.destroyshould stop managing it, not delete the cluster-defining blueprint every host/cluster depends on.nameisForceNew.Adversarial review — 6 findings, all fixed
A per-lens review workflow (state-consistency / REST-API / lifecycle, each verified against framework + gophercloud source) found 6 issues, all fixed and re-validated live:
storage_backends_jsonround-trip → "inconsistent result after apply" when set → keep the known plan value. Re-tested with it set: apply succeeds, plan clean.UseStateForUnknown→ added.Testing
build / vet / gofmt / golangci-lint (0) / unit tests / terraform fmt / docs — all clean. Mutating acc tests stay opt-in (
PCD_ACC_RESMGR); the resource was validated manually against the demo env (safely, via import + in-place update + revert +state rm, never destroy).