Skip to content

Guard IAP brand and client against destructive replaces#12

Merged
phosphore merged 1 commit into
masterfrom
lorenzo/iap-brand-client-guardrails
Jul 7, 2026
Merged

Guard IAP brand and client against destructive replaces#12
phosphore merged 1 commit into
masterfrom
lorenzo/iap-brand-client-guardrails

Conversation

@phosphore

Copy link
Copy Markdown
Member

Why

During the 2026-07-07 incident (wavemm-iam#325 → GoogleCloudPlatform#327), changing admin_email forced a replacement of google_iap_brand. Brands can't be deleted or recreated (one per project, IAP OAuth Admin API deprecated), but the replace attempt deleted the live google_iap_client first, breaking every PAM login with Error 401: deleted_client for ~5.5h until the brand and a replacement client were imported back into state.

What

  • Brand: prevent_destroy = true (uncomments the existing hint) — any plan that would replace the brand now fails at plan time, before touching GCP.
  • Client: deletion_policy = "ABANDON" — destroys/replaces leave the client running in GCP and only remove it from state, so IAP never ends up pointing at a deleted client.

terraform validate passes (google provider v7). No change to the app sources zip, so bumping the submodule in wavemm-iam won't trigger a redeploy — only a metadata-only apply.

🤖 Generated with Claude Code

support_email changes force brand replacement, but brands can't be
deleted or recreated (one per project; IAP OAuth Admin API deprecated).
The replace attempt on 2026-07-07 deleted the live IAP client first and
broke all PAM logins with deleted_client until state was repaired.

- prevent_destroy on the brand: such plans now fail before touching GCP
- deletion_policy=ABANDON on the client: destroys/replaces leave the
  live client running in GCP and only drop it from state

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@phosphore phosphore merged commit 7735a0c into master Jul 7, 2026
1 check passed
@phosphore phosphore deleted the lorenzo/iap-brand-client-guardrails branch July 7, 2026 16:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants