yandex_lockbox_secret_version (Resource)
Статья создана
Обновлена 11 сентября 2025 г.
Yandex Cloud Lockbox secret version resource. For more information, see the official documentation.
Example usage
//
// Create a new Lockbox Secret Version.
//
resource "yandex_lockbox_secret" "my_secret" {
name = "test secret"
}
resource "yandex_lockbox_secret_version" "my_version" {
secret_id = yandex_lockbox_secret.my_secret.id
entries {
key = "key1"
text_value = "value1" // explicit secret value
}
entries {
key = "k2"
// value generated by a command won't be visible in Terraform state
command {
path = "my_secret_generator.sh"
}
}
}
//
// Create a new Lockbox Secret Version.
//
resource "yandex_lockbox_secret" "my_secret" {
name = "test secret"
}
resource "yandex_lockbox_secret_version" "my_version" {
secret_id = yandex_lockbox_secret.my_secret.id
entries {
key = "key1"
text_value = "value1" // explicit secret value
}
entries {
key = "k2"
// value generated by a command won't be visible in Terraform state
command {
path = "my_secret_generator.sh"
}
}
}
Schema
Required
secret_id(String) The Yandex Cloud Lockbox secret ID where to add the version.
Optional
description(String) The resource description.entries(Block List) List of entries in the Yandex Cloud Lockbox secret version. Must be omitted for secrets with a payload specification.
Важно
One either text_value or command is required. (see below for nested schema)
timeouts(Block, Optional) (see below for nested schema)
Read-Only
id(String) The ID of this resource.
Nested Schema for entries
Required:
key(String) The key of the entry.
Optional:
command(Block List, Max: 1) The command that generates the text value of the entry. (see below for nested schema)text_value(String, Sensitive) The text value of the entry.
Nested Schema for entries.command
Required:
path(String) The path to the script or command to execute.
Optional:
args(List of String) List of arguments to be passed to the script/command.env(Map of String) Map of environment variables to set before calling the script/command.
Nested Schema for timeouts
Optional:
create(String) A string that can be parsed as a duration consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours).delete(String) A string that can be parsed as a duration consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours). Setting a timeout for a Delete operation is only applicable if changes are saved into state before the destroy operation occurs.read(String) A string that can be parsed as a duration consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours). Read operations occur during any refresh or planning operation when refresh is enabled.
Import
Важно
Import for this resource is not implemented yet.