Skip to content

rso_bucket (Resource)

An S3-compatible object storage bucket. Use it with any S3 client through endpoint, with path-style addressing and an rso_bucket_key. A bucket must be empty before it can be destroyed.

Example Usage

# An S3-compatible bucket and an access key for it.
resource "rso_bucket" "assets" {
  name = "tf-example-assets"
}

resource "rso_bucket_key" "ci" {
  name = "tf-example-ci"
}

# Point any S3 client at these, with path-style addressing:
#   aws --endpoint-url <endpoint> s3 ls s3://<bucket>
output "bucket" {
  value = rso_bucket.assets.bucket
}

output "endpoint" {
  value = rso_bucket.assets.endpoint
}

output "access_key_id" {
  value = rso_bucket_key.ci.access_key_id
}

output "secret_access_key" {
  value     = rso_bucket_key.ci.secret_access_key
  sensitive = true
}

Schema

Required

  • name (String) Short name, unique within the tenant: 3-40 lowercase letters, digits and dashes. Changing it creates a new bucket.

Read-Only

  • bucket (String) Full bucket name to use with S3 clients (the short name with the tenant's prefix).
  • endpoint (String) S3 endpoint URL.
  • id (String) The ID of this resource.
  • region (String) Region to configure in S3 clients.

Import

Import is supported using the following syntax:

# Import an existing bucket by its short name.
terraform import rso_bucket.assets assets