Resource
dcloud_secret
A secret encrypted with a KMS key. A changed value is a rotation (a new version), not a new secret. The value is never read back from the API.
Example Usage
data "dcloud_kms_keys" "all" {}
variable "api_token" {
type = string
sensitive = true
}
resource "dcloud_secret" "api_token" {
name = "API_TOKEN"
description = "Token for the payments API"
key_id = [for k in data.dcloud_kms_keys.all.items : k.id if k.status == "enabled"][0]
value = var.api_token
}Schema
Required
key_id(String) The KMS key that encrypts the secret. Changing it replaces the resource.name(String) The name apps and workflows look it up by: UPPER_SNAKE_CASE starting with a letter, 1 to 128 characters. Unique per environment (and once as the Default): a taken name is 409. Up to 128 characters. Must match^[A-Z][A-Z0-9_]*$. Changing it replaces the resource.value(String, Sensitive) The plaintext value, at least 1 character; stored as version 1. Give exactly one ofvalueandreference(both or neither is 400). Never returned by the API: not read back, and empty after an import.
Optional
description(String) Free-text description, up to 256 characters. Up to 256 characters.environment_id(String) The environment it overrides the Default value in (an environment id). Omitted or null: the Default value every environment falls back to. An unknown id is 404. A UUID. Changing it replaces the resource.group(String) Where the secret is filed, e.g.dialog/auth(up to three lower-case segments). Changed in place; it belongs to the name, so every environment's secret of this name moves with it.project(String) The project (its slug) the resource lives in. At create: this, else the provider'sproject, else Default. Changing it moves the resource and its parts; it is never replaced.rotation_interval_days(Number) Days between rotations, 1 to 3650: sets a due date (rotatesAt); it does not generate values. Omitted or null: no rotation policy. From 1 to 3650.scope(String) A label for what the secret belongs to: organization, project or resource. Omitted: organization. It grants nothing. One of:organization,project,resource. Changing it replaces the resource.scope_ref(String) Whatscopenames: a project slug or a resource RN, up to 500 characters. Omitted or null: none. Up to 500 characters. Changing it replaces the resource.tags(Map of String) Tags, key → value. Once set here, only these keys are managed; tags Deutsche Cloud adds itself are left alone.
Read-Only
id(String) The resource's id.
Import
Import is supported using the following syntax:
The terraform import command can be used, for example:
# The value is never read back: set it in the configuration after an import.
terraform import dcloud_secret.api_token <secret-id>Generated from the provider's schema.
Related