Terraform provider reference / resources / object_storage_bucket

fiberax_object_storage_bucket (Resource)

A bucket of the object storage project.

This resource creates and deletes the bucket itself. Everything inside a bucket - objects, lifecycle rules, CORS, the bucket policy, versioning - is managed over the S3 protocol, for example with the aws provider pointed at the endpoint of the fiberax_object_storage data source.

Bucket names are unique across the whole storage, not only within your project: a name taken by anyone else cannot be created, and a name you free may be taken by another client.

Only an empty bucket is deleted. The platform does not delete objects for you: empty the bucket over S3 first (including old versions and delete markers), and remove its service accounts - Terraform does that first by itself when they reference the bucket. Deleting a bucket does not lower the bill: the project is billed for its reservation (fiberax_object_storage_reservation), not for buckets.

Example Usage

# An object storage project has a token of its own: give it a second provider configuration
# with an alias and the token written in it (FIBERAX_TOKEN is shared by every configuration).
provider "fiberax" {
  alias = "storage"
  token = var.storage_token
}

# While nothing is reserved yet (reserved_tb = 0), creating a bucket needs a payment method on the
# account, as ordering storage does: it is refused with client_has_debt or card_verification_required.
resource "fiberax_object_storage_bucket" "backups" {
  provider = fiberax.storage
  name     = "acme-backups"

  # Object Lock can only be chosen here, when the bucket is created.
  object_lock = false
}

Schema

Required

S3 cannot rename a bucket: changing this field replaces the bucket, and the old one is deleted only if it is empty.

Optional

Read-Only

Import

Import is supported using the following syntax:

The terraform import command can be used, for example:

# A bucket is imported by its name.
terraform import fiberax_object_storage_bucket.backups acme-backups

Generated from the provider schema for version 0.11.0. How to install the provider: Terraform provider.