CloudflareStatic-verified

An R2 Bucket that Stays Private, Cleans Up, and Can Lock Objects

R2 has no versioning: an overwrite or delete is the end of the object, and the only control that refuses deletion is a bucket lock rule, which a bucket without one needs to accept by name. Abandoned multipart uploads bill until a lifecycle rule aborts them. Private with no domain attached, lock rules taken, incomplete uploads freed after a week, and the EU or FedRAMP jurisdiction set at creation.

terraformEdge & DNScloudflare

Compare Object Storage across clouds →

cloudflare-r2-bucketvizier v1.2.0

Verification

Static-verified

Passed: validated and lint-clean (provider-schema-validated for AWS/Azure/GCP; Terraform-language lint elsewhere).

Conformance

  • Static validation (fmt · validate · tflint)
  • No applicable security policies for this provider
  • Plan tests (mocked: validation rules · outputs)

Provenance

  • SHA-256 checksum
  • Signature (pending)

Functional

  • Live test pending (no cloud run yet)

Last verified 2026-09-14 · how we verify

Use it from the registry

terraform · opentofu
module "r2_bucket" {
  source  = "www.iac-bazaar.com/iac-bazaar/cloudflare-r2-bucket/cloudflare"
  version = "1.0.0"
}

Needs a registry token from /account/tokens. The module itself is free; the account is what identifies you. Full setup: registry docs.

Inputs & outputs

Create a free account to read this module's contract

The declared contract - every input name, type, default and description, plus every output - is shown to signed-in accounts, not to anonymous visitors.

A free account sees the contract of every module in the catalogue. There is no subscription and nothing to buy - the modules are free to download, and they run under Vizier.

Documentation

cloudflare-r2-bucket

An R2 bucket that stays private, cleans up after itself, and can lock objects against deletion. Works with Terraform and OpenTofu (>= 1.6), cloudflare provider >= 5.0, < 6.0.

R2 has no versioning. The control it offers instead is bucket lock: a rule that refuses deletion of matching objects for a period, by anyone. A bucket with no lock rule needs accept_deletable_objects.

A bucket is private until a domain is attached. This module attaches none; cloudflare_r2_custom_domain or cloudflare_r2_managed_domain would.

Abandoned multipart uploads bill until something aborts them. Aborted after seven days here.

jurisdiction is a rule, location a hint. Both immutable.

Verification

Static validation runs tofu fmt, init, validate, tflint and checkov. This module has not yet had a live test, so it is published as statically validated with its live test pending and does not carry the live-tested mark.

Usage code & full reference need an account

The complete copy-paste usage, the full input/output reference, and operational notes are free with an account - shown here and bundled in the download. Sign in and this section fills in.

  • Usage

Related modules

Static validatedLive test pending

scaleway-object-bucket

Versioning is off by default and one-way; object lock can only be decided at creation; the bucket's own ACL attribute is deprecated, so a private ACL is written separately or never set; and abandoned uploads bill until a rule aborts them. Versioning on and off by name, lock with a default retention when asked, the private ACL explicit, incomplete uploads freed after a week, old versions expiring.

View module
Static validatedLive test pending

tencent-cos-bucket

A COS bucket name carries the account's APPID; versioning is off by default and once on can only be suspended; encryption at rest is off until an algorithm is named; and abandoned multipart uploads bill until a rule aborts them. The two name halves joined, private with public by name, versioning on, AES256 or your KMS key, object lock decided at creation, incomplete uploads freed after a week.

View module
Static validatedLive test pending

ibm-cos-bucket

Versioning is off by default; encryption is IBM-managed unless a Key Protect root key is given; allowed_ip is an allow list nobody sets, so any address that authenticates reaches the bucket; and a WORM retention rule cannot be removed once set. Versioning on with off by name, your root key when given, allowed ranges taken, retention optional, incomplete uploads freed after a week.

View module
Static validatedLive test pending

do-spaces-bucket

A public-read ACL is a bucket listing on the internet, versioning is off by default, and an abandoned multipart upload bills until a lifecycle rule aborts it. Private with a policy that denies anonymous and non-TLS access, versioning on with superseded versions expiring so the bill stops growing, incomplete uploads freed after a week, and public read or no versioning accepted by name.

View module
Live-tested

aws-s3-bucket

Private S3 bucket with encryption, versioning, public-access block, and TLS-only policy.

View module
Static validatedLive test pending

huawei-obs-bucket

Public access is two switches: a private ACL still leaves a bucket policy free to grant anonymous reads, and only Block Public Access refuses both; versioning and encryption are both off by default; abandoned uploads bill until a rule aborts them. Private ACL plus BPA with public by name, versioning on, encrypted with the region's key or yours, incomplete uploads freed after a week.

View module