fix(iac): import existing EU R2 bucket into state #13

Merged
arcodange merged 1 commits from arcodange/r2-state-import into main 2026-06-24 13:19:58 +02:00
Owner

What

Adds a one-time config-driven import block for cloudflare_r2_bucket.arcodange_tf.

Why

Run #28 (on main, with #11 + #12) applied cleanly except R2 — OVH, the gitea-provider CA, and the cloudflare token-type fix all worked (ovh_cms_token, gitea_admin_token created). The only failure:

cloudflare_r2_bucket.arcodange_tf: Still creating... [3m+]
Error: ... you tried to create already exists, and you own

The arcodange-tf bucket exists in the EU jurisdiction (confirmed via the CF API). Its prior state entry lacked the jurisdiction, so cloudflare provider ≥5.20 read it as not-found, dropped it from state, and then couldn't recreate it. The provider's import ID format is <account_id>/<bucket_name>/<jurisdiction>, so re-importing with the /eu suffix reconciles the state:

import {
  to = cloudflare_r2_bucket.arcodange_tf
  id = "f7fcf28c0823cecb44e53b6e92d5144f/arcodange-tf/eu"
}

On the next apply, tofu adopts the real bucket instead of recreating it. No-op once in state; safe to remove afterward (I'll follow up with a cleanup PR once the run is green).

Validated locally: tofu validate → Success. Nothing destroyed (0 to destroy); the bucket itself was never touched.

🤖 Generated with Claude Code

## What Adds a one-time config-driven `import` block for `cloudflare_r2_bucket.arcodange_tf`. ## Why [Run #28](https://gitea.arcodange.lab/arcodange-org/factory/actions/runs/28) (on `main`, with #11 + #12) applied **cleanly except R2** — OVH, the gitea-provider CA, and the cloudflare token-type fix all worked (`ovh_cms_token`, `gitea_admin_token` created). The only failure: ``` cloudflare_r2_bucket.arcodange_tf: Still creating... [3m+] Error: ... you tried to create already exists, and you own ``` The `arcodange-tf` bucket **exists in the EU jurisdiction** (confirmed via the CF API). Its prior state entry lacked the jurisdiction, so cloudflare provider ≥5.20 read it as not-found, dropped it from state, and then couldn't recreate it. The provider's import ID format is `<account_id>/<bucket_name>/<jurisdiction>`, so re-importing with the `/eu` suffix reconciles the state: ```hcl import { to = cloudflare_r2_bucket.arcodange_tf id = "f7fcf28c0823cecb44e53b6e92d5144f/arcodange-tf/eu" } ``` On the next apply, tofu adopts the real bucket instead of recreating it. No-op once in state; safe to remove afterward (I'll follow up with a cleanup PR once the run is green). Validated locally: `tofu validate` → Success. Nothing destroyed (`0 to destroy`); the bucket itself was never touched. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
arcodange added 1 commit 2026-06-24 13:19:49 +02:00
Run #28 applied cleanly except cloudflare_r2_bucket.arcodange_tf: the bucket
exists in the EU jurisdiction, but its prior state entry lacked the jurisdiction,
so cloudflare provider >=5.20 read it as not-found, removed it from state, and
then failed to recreate it ("already exists"). Add a config-driven import block
with the jurisdiction-qualified id (<account_id>/<bucket_name>/<jurisdiction>) so
the next apply adopts the real bucket. No-op once reconciled; removable after.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
arcodange merged commit e2a79a08a7 into main 2026-06-24 13:19:58 +02:00
Sign in to join this conversation.
No Reviewers
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: arcodange-org/factory#13