qumulo_s3_bucket (Resource)¶
Manages an S3 bucket on a Qumulo cluster.
Example Usage¶
Installation¶
terraform {
required_providers {
qumulo = {
source = "qumulo-terraform-registry.s3.us-east-1.amazonaws.com/qumulo/qumulo"
version = "~> 1.0"
}
}
}
Basic Bucket¶
resource "qumulo_s3_bucket" "data" {
connection_profile = "prod"
name = "my-bucket"
path = "/data/s3/my-bucket"
create_fs_path = true
}
Bucket with Versioning¶
resource "qumulo_s3_bucket" "versioned" {
connection_profile = "prod"
name = "versioned-bucket"
path = "/data/s3/versioned"
create_fs_path = true
versioning = "Enabled"
}
Bucket with Object Lock¶
resource "qumulo_s3_bucket" "locked" {
connection_profile = "prod"
name = "locked-bucket"
path = "/data/s3/locked"
create_fs_path = true
object_lock_enabled = true
private = true
lock_config {
enabled = true
default_retention {
units = "DAYS"
value = 30
}
}
}
Multi-Cluster with for_each¶
variable "clusters" {
type = set(string)
default = ["prod", "dr"]
}
resource "qumulo_s3_bucket" "data" {
for_each = var.clusters
connection_profile = each.value
name = "data-bucket"
create_fs_path = true
}
Schema¶
Required¶
connection_profile(String) Name of a connection profile defined in the provider block.
Connection profiles centralize cluster credentials at the provider level. Define profiles in the provider block:
provider "qumulo" {
connection_profiles = [
{
name = "prod"
endpoint = "https://cluster.example.com:8000"
username = "admin"
password = var.cluster_password
insecure_skip_verify = true # For self-signed certificates
}
]
}
name (String) The name of the S3 bucket. Must be unique on the cluster.
Optional¶
create_fs_path(Boolean) Create the bucket root directory if it doesn't exist. Defaults to false.delete_root_dir(Boolean) Delete the bucket root directory when the bucket is destroyed. WARNING: This will delete all data in the directory. Defaults to false.lock_config(Block, Optional) Object Lock configuration for the bucket. Requires object_lock_enabled = true. (see below for nested schema)object_lock_enabled(Boolean) Enable Object Lock for the bucket. Once enabled, this cannot be disabled. Defaults to false.path(String) The absolute path to the bucket root directory. If not specified, uses the S3 base_path setting with the bucket name appended.private(Boolean) Create a private bucket with restrictive default policy. By default, buckets allow all S3 API users to read/write objects. Defaults to false.versioning(String) The versioning state of the bucket: 'Unversioned', 'Enabled', or 'Suspended'. Note: Values are case sensitive. Defaults to 'Unversioned'.
Read-Only¶
creation_time(String) The creation time of the bucket in ISO 8601 format.
Nested Schema for lock_config¶
Optional:
default_retention(Block, Optional) Default retention period for objects in the bucket. (see below for nested schema)enabled(Boolean) Enable Object Lock for the bucket.
Nested Schema for lock_config.default_retention¶
Optional:
units(String) The units of the retention period: 'DAYS' or 'YEARS'. Required when default_retention is specified.value(Number) The number of days or years for the retention period. Required when default_retention is specified.