Skip to content

infra: declare the R2 sccache bucket and its lifecycle rule in Terraform #910

Closed

Description

@athvin

First half of #909. Creates the bucket; does not repoint rust.yml, which
waits until the bucket exists and the two scoped credentials are in GitHub
secrets. Splitting them avoids the race where rust.yml on main runs against
a bucket whose apply has not finished.

  • infra/terraform/envs/core/r2.tf — cloudflare_r2_bucket (er-ci-sccache,
    enam, Standard) plus cloudflare_r2_bucket_lifecycle matching
    sccache.tfs 14-day expiry and 1-day multipart abort
  • envs/core/versions.tf — the cloudflare/cloudflare ~> 5.0 provider, pinned
    to the same major envs/dev already carries, and provider "cloudflare" {}
    reading CLOUDFLARE_API_TOKEN from the environment so the token never reaches
    the plan file or state

Opt-in gated on var.cloudflare_account_id (null by default), the ses.tf
pattern: without a token the provider cannot authenticate and the WHOLE core
plan fails, leaving every resource that does plan cleanly unchecked. The gate
matters more here than for SES because this bucket is on the critical path of
every compile job, so the counts should come out as soon as #908 gives CI a
scoped read-only token.

Does NOT delete sccache.tf — the S3 bucket and both OIDC roles stay until the
migration is measured, because they are the rollback.

Activity

  1. added 2 commits that reference this issue on Nov 8, 2026
    9269a64
    f57eae4
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions