Terraform provider reference / resources / object_storage_service_account

fiberax_object_storage_service_account (Resource)

A service account: an S3 key limited to ONE bucket of the project, with read, write or read-and-write access - for an application that must not reach the other buckets.

A service account cannot be changed: its name, bucket and access are fixed when it is created, and changing any of them replaces it - with a NEW key and secret.

THE SECRET LIVES IN STATE AND IS RETURNED ONLY ONCE. The platform gives the secret only in the answer that created the service account and never shows it again, so secret_access_key is kept in state (in the clear in the state file). After an import it is empty, and the only way to a secret is replacing the service account (terraform apply -replace).

Example Usage

# A key limited to one bucket. Name, bucket and access cannot be changed: any change
# replaces the service account with a new key and secret.
resource "fiberax_object_storage_service_account" "app" {
  provider = fiberax.storage
  name     = "app-writer"
  bucket   = fiberax_object_storage_bucket.backups.name
  access   = "readwrite" # read, write or readwrite
}

Schema

Required

Read-Only

Import

Import is supported using the following syntax:

The terraform import command can be used, for example:

# A service account is imported by its name. Its secret is returned only when it is
# created, so after import secret_access_key stays empty for good.
terraform import fiberax_object_storage_service_account.app app-writer

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