Yandex Cloud
Documentation
PresentationContact UsTry it for free
© 2026 Direct Cursus Technology L.L.C.
Terraform in Yandex Cloud
  • Getting started
  • Setting up Yandex Cloud Terraform provider authentication
  • Solution library
    • Overview
    • Release notes
          • lockbox_secret
          • lockbox_secret_iam_binding
          • lockbox_secret_iam_member
          • lockbox_secret_version
          • lockbox_secret_version_hashed

In this article:

  • Example usage
  • Arguments & Attributes Reference
  1. Terraform reference
  2. Resources
  3. Lockbox
  4. Resources
  5. lockbox_secret_version

yandex_lockbox_secret_version (Resource)

Written by
Yandex Cloud
Updated at April 9, 2026
View in Markdown
  • Example usage
  • Arguments & Attributes Reference

Yandex Cloud Lockbox secret version resource. For more information, see the official documentation.

Example usageExample 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 with password.
//
resource "yandex_lockbox_secret" "my_secret" {
  name = "test secret with passowrd"

  password_payload_specification {
    password_key = "some_password"
    length       = 12
  }
}

resource "yandex_lockbox_secret_version" "my_version" {
  secret_id = yandex_lockbox_secret.my_secret.id
}

Arguments & Attributes ReferenceArguments & Attributes Reference

  • description (String). The resource description.
  • id (String).
  • secret_id (Required)(String). The Yandex Cloud Lockbox secret ID where to add the version.
  • entries [Block]. List of entries in the Yandex Cloud Lockbox secret version. Must be omitted for secrets with a payload specification.

Warning

One either text_value or command is required.

  • key (Required)(String). The key of the entry.
  • text_value (String). The text value of the entry.
  • command [Block]. The command that generates the text value of the entry.
    • 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.
    • path (Required)(String). The path to the script or command to execute.
  • timeouts [Block].
    • create (String).
    • delete (String).
    • read (String).

Was the article helpful?

Previous
lockbox_secret_iam_member
Next
lockbox_secret_version_hashed
© 2026 Direct Cursus Technology L.L.C.