Yandex Cloud
Search
Contact UsTry it for free
  • Customer Stories
  • Documentation
  • Blog
  • All Services
  • System Status
  • Marketplace
    • Featured
    • Infrastructure & Network
    • Data Platform
    • AI for business
    • Security
    • DevOps tools
    • Serverless
    • Monitoring & Resources
  • All Solutions
    • By industry
    • By use case
    • Economics and Pricing
    • Security
    • Technical Support
    • Start testing with double trial credits
    • Cloud credits to scale your IT product
    • Gateway to Russia
    • Cloud for Startups
    • Center for Technologies and Society
    • Yandex Cloud Partner program
    • Price calculator
    • Pricing plans
  • Customer Stories
  • Documentation
  • Blog
© 2026 Direct Cursus Technology L.L.C.
Terraform in Yandex Cloud
  • Getting started
  • Solution library
    • Overview
    • Release notes
          • lockbox_secret
          • lockbox_secret_version
          • lockbox_secret_version_entry

In this article:

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

yandex_lockbox_secret_version_entry (DataSource)

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

Get a single entry from a Yandex Cloud Lockbox secret version by key. For more information, see the official documentation.

This data source is a convenience wrapper around yandex_lockbox_secret_version that lets you retrieve a specific entry by key without having to filter the entries list yourself.

If you're creating the secret in the same project, then you should indicate version_id, since otherwise you may refer to a wrong version of the secret (e.g. the first version, when it is still empty).

Example usageExample usage

//
// Get a specific entry from the latest version of a Lockbox secret by key.
//
data "yandex_lockbox_secret_version_entry" "db_password" {
  secret_id = "some-secret-id"
  key       = "db_password"
}

output "db_password" {
  value     = data.yandex_lockbox_secret_version_entry.db_password.text_value
  sensitive = true
}
//
// Get a specific entry from a pinned version of a Lockbox secret by key.
//
resource "yandex_lockbox_secret" "my_secret" {
  # ...
}

resource "yandex_lockbox_secret_version" "my_version" {
  secret_id = yandex_lockbox_secret.my_secret.id
  entries {
    key        = "db_password"
    text_value = "s3cr3t"
  }
  entries {
    key        = "db_user"
    text_value = "admin"
  }
}

data "yandex_lockbox_secret_version_entry" "db_password" {
  secret_id  = yandex_lockbox_secret.my_secret.id
  version_id = yandex_lockbox_secret_version.my_version.id
  key        = "db_password"
}

output "db_password" {
  value     = data.yandex_lockbox_secret_version_entry.db_password.text_value
  sensitive = true
}
//
// Get a binary entry from a Lockbox secret version by key.
// The binary_value attribute contains the raw bytes encoded as a base64 string.
//
data "yandex_lockbox_secret_version_entry" "tls_cert" {
  secret_id = "some-secret-id"
  key       = "tls_cert"
}

output "tls_cert_b64" {
  value     = data.yandex_lockbox_secret_version_entry.tls_cert.binary_value
  sensitive = true
}

Arguments & Attributes ReferenceArguments & Attributes Reference

  • id (String).
  • key (Required)(String). The key of the entry to retrieve.
  • secret_id (Required)(String). The Yandex Cloud Lockbox secret ID.
  • version_id (String). The Yandex Cloud Lockbox secret version ID. If omitted, the current (latest) version is used.
  • text_value (Read-Only) (String, Sensitive). The text value of the entry. Populated when the entry holds a UTF-8 string. Mutually exclusive with binary_value.
  • binary_value (Read-Only) (String, Sensitive). The binary value of the entry encoded as a base64 string. Populated when the entry holds binary data. Mutually exclusive with text_value.

Was the article helpful?

Previous
lockbox_secret_version
Next
lockbox_secret
© 2026 Direct Cursus Technology L.L.C.