From f4f770512707b8068c8c8051ad89205c0ebd0d14 Mon Sep 17 00:00:00 2001 From: Viktor Barzin Date: Tue, 16 Jun 2026 11:31:17 +0000 Subject: [PATCH] monitoring: adopt orphaned alert-digest resources into TF state (unblocks apply) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The monitoring stack apply was create-failing on every push with `configmaps "alert-digest-script" already exists` + `secrets "alert-digest" already exists` (modules/monitoring/alert_digest.tf) — both resources exist in-cluster but fell out of Terraform state, so apply tried to CREATE them and errored. Pre-existing (failed on pipelines 203 AND 204, NOT caused by the t3 alert-rules change). Add import {} blocks (TF 1.5+ adoption per AGENTS.md) so apply imports + reconciles instead of failing. Idempotent once imported; safe to remove after a green apply. Co-Authored-By: Claude Opus 4.8 --- stacks/monitoring/imports.tf | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 stacks/monitoring/imports.tf diff --git a/stacks/monitoring/imports.tf b/stacks/monitoring/imports.tf new file mode 100644 index 00000000..0e565da5 --- /dev/null +++ b/stacks/monitoring/imports.tf @@ -0,0 +1,16 @@ +# One-shot adoption of two alert-digest resources that exist in-cluster but fell +# out of Terraform state — the monitoring apply was create-failing on every push +# with `configmaps "alert-digest-script" already exists` and `secrets +# "alert-digest" already exists` (pre-existing: pipelines 203 AND 204). Importing +# reconciles them into state so `terraform apply` UPDATES instead of failing to +# create. These blocks are idempotent (a no-op once the resources are in state) +# and may be removed after the next green apply. Defs: modules/monitoring/alert_digest.tf. +import { + to = module.monitoring.kubernetes_config_map.alert_digest_script + id = "monitoring/alert-digest-script" +} + +import { + to = module.monitoring.kubernetes_secret.alert_digest + id = "monitoring/alert-digest" +}