» google_secret_manager_secret_version

A secret version resource.

» Example Usage - Secret Version Basic

resource "google_secret_manager_secret" "secret-basic" {
  secret_id = "secret-version"

  labels = {
    label = "my-label"
  }

  replication {
    automatic = true
  }
}


resource "google_secret_manager_secret_version" "secret-version-basic" {
  secret = google_secret_manager_secret.secret-basic.id

  secret_data = "secret-data"
}

» Argument Reference

The following arguments are supported:

  • secret - (Required) Secret Manager secret resource

  • enabled - (Optional) The current state of the SecretVersion.

  • secret_data - (Optional) The secret data. Must be no larger than 64KiB. Note: This property is sensitive and will not be displayed in the plan.

» Attributes Reference

In addition to the arguments listed above, the following computed attributes are exported:

  • id - an identifier for the resource with format {{name}}

  • name - The resource name of the SecretVersion. Format: projects/{{project}}/secrets/{{secret_id}}/versions/{{version}}

  • create_time - The time at which the Secret was created.

  • destroy_time - The time at which the Secret was destroyed. Only present if state is DESTROYED.

» Timeouts

This resource provides the following Timeouts configuration options:

  • create - Default is 4 minutes.
  • delete - Default is 4 minutes.

» Import

SecretVersion can be imported using any of these accepted formats:

$ terraform import google_secret_manager_secret_version.default {{name}}/{{name}}