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
access(String) What it can do in the bucket:read,writeorreadwrite. Changing it replaces the service account.bucket(String) The bucket of this project the service account reaches - usuallyfiberax_object_storage_bucket.<name>.name, so that Terraform creates the bucket first and deletes the service account before the bucket. Changing it replaces the service account.name(String) Name of the service account, unique within the project: 1 to 32 characters - lowercase letters, digits, hyphen and underscore. Changing it replaces the service account.
Read-Only
access_key_id(String) Access key ID of the service account.created_at(String) When the service account was created, RFC 3339.id(String) The service account name.secret_access_key(String, Sensitive) Secret access key. Set only when the service account is created by this resource; empty after an import.
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.