You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
ci: core apply fails — the Cloudflare credential is on the plan step but not the apply step #916
Regression from #912 (be64c41e). main has no R2 bucket and apply (core)
is red.
Error: failed to make http request
with cloudflare_r2_bucket.sccache[0], on r2.tf line 57
400 {"success":false,"errors":[{"code":9106,
"message":"Missing X-Auth-Key, X-Auth-Email or Authorization headers"}]}
plan (core) passed and the apply jobs own terraform plan (to a file)passed. Onlyterraform applyfailed, because #912 putCLOUDFLARE_API_TOKENandTF_VAR_cloudflare_account_idin the env of the **plan-to-file step** and the apply step carries onlyDIR`.
Why a saved plan still needs the credential
Not a Terraform quirk — the direct consequence of a decision recorded in versions.tf. Variable values are baked into the plan file; provider
credentials deliberately are not, which is exactly why the provider reads CLOUDFLARE_API_TOKEN from the environment instead of taking it as a Terraform
variable (a variable would land in the plan file and in state). So the token has
to be present at plan AND at apply.
TF_VAR_cloudflare_account_id was not the problem — it is in the plan file —
but it moves too, because splitting the two across steps is how they drift.
Fix
Both values move to the apply jobs **job-level** env:`, so plan-to-file and
apply cannot disagree. Fixing the class, not the instance.
Also records the exception in the workflow header, which asserts "NO REPOSITORY
SECRETS, by design and not by omission". That claim survives — this is an Environment secret on infra-apply-core (protected_branches: true),
reachable by one job on main, and every objection the header raises is about
reach. What does not survive is the expiry argument: a Cloudflare token is
long-lived where every AWS identity here lasts an hour. Cloudflare has no OIDC,
so that is the floor rather than a shortcut.
Not in scope
apply (prod) is also red on the same run, from the WAFv2 § rejection in #555
— pre-existing, and #913 fixes it.
Activity