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
name(String) Bucket name. A NEW bucket takes 3 to 63 characters: lowercase letters, digits and hyphens, starting and ending with a letter or a digit. An existing bucket created over S3 with dots in its name can still be imported.
S3 cannot rename a bucket: changing this field replaces the bucket, and the old one is deleted only if it is empty.
Optional
object_lock(Boolean) S3 Object Lock for the bucket. Chosen only when the bucket is created; defaultfalse. Changing it later is refused on the plan rather than replacing the bucket: Object Lock is switched on for an existing bucket over S3 (PutObjectLockConfiguration), and it cannot be switched off at all. If you switched it on over S3, writeobject_lock = truehere.
Read-Only
created_at(String) When the bucket was created, RFC 3339.id(String) The bucket name.versioning(String) S3 versioning of the bucket as the platform reports it:off,enabledorsuspended. Only read here - versioning is set over S3 (for exampleaws_s3_bucket_versioning); a bucket with Object Lock is always versioned.
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.