Skip to content

Latest commit

 

History

History
83 lines (59 loc) · 2.76 KB

bucket.md

File metadata and controls

83 lines (59 loc) · 2.76 KB
page_title cozystack_bucket Resource - cozystack
subcategory
description A Cozystack S3-compatible bucket, provisioned inside a tenant namespace.

cozystack_bucket (Resource)

A Cozystack S3-compatible bucket, provisioned inside a tenant namespace.

Example Usage

resource "cozystack_bucket" "assets" {
  name      = "assets"
  namespace = "tenant-root"

  users = {
    app    = { readonly = false }
    backup = { readonly = true }
  }

  # S3 credentials are published asynchronously, so without waiting they are
  # only readable from the apply after the one that created the bucket.
  wait_for_ready = true
}

Schema

Required

  • name (String) Bucket name (metadata.name). Immutable.
  • namespace (String) Tenant namespace the bucket is created in. Immutable.

Optional

  • locking (Boolean) Provision the bucket with object lock enabled.
  • storage_pool (String) Selects a specific BucketClass by storage pool name.
  • users (Attributes Map) Bucket users keyed by user name. (see below for nested schema)
  • wait_for_ready (Boolean) Block on create/update until the Ready condition is true and any server-generated outputs the resource exposes are readable.
  • wait_timeout (String) Maximum time to wait when wait_for_ready is set (Go duration, e.g. 10m). Readiness and outputs share this budget; outputs that never appear leave a warning and their attributes stay null until the next refresh.

Read-Only

  • chart_version (String) Deployed chart version (status.version).
  • credentials (Attributes Map, Sensitive) S3 credentials per user (from the bucket-<name>-<user> Secret). Populated once the bucket claim is bound. (see below for nested schema)
  • id (String) Synthetic identifier in the form namespace/name.
  • ready (Boolean) Whether the bucket's Ready condition is true.
  • uid (String) Server-assigned object UID (metadata.uid).

Nested Schema for users

Optional:

  • readonly (Boolean) Whether the user has read-only access.

Nested Schema for credentials

Read-Only:

  • access_key (String) S3 access key ID.
  • bucket_name (String) Backing bucket name.
  • endpoint (String) S3 endpoint URL.
  • region (String) S3 region.
  • secret_key (String) S3 secret access key.

Import

Import is supported using the following syntax:

The terraform import command can be used, for example:

# Buckets are imported as "<namespace>/<name>".
terraform import cozystack_bucket.assets tenant-root/assets