databricks_secret Resource

With this resource you can insert a secret under the provided scope with the given name. If a secret already exists with the same name, this command overwrites the existing secret’s value. The server encrypts the secret using the secret scope’s encryption settings before storing it. You must have WRITE or MANAGE permission on the secret scope. The secret key must consist of alphanumeric characters, dashes, underscores, and periods, and cannot exceed 128 characters. The maximum allowed secret value size is 128 KB. The maximum number of secrets in a given scope is 1000. You can read a secret value only from within a command on a cluster (for example, through a notebook); there is no API to read a secret value outside of a cluster. The permission applied is based on who is invoking the command and you must have at least READ permission. Please consult Secrets User Guide for more details.

Example Usage

resource "databricks_secret_scope" "app" {
  name = "application-secret-scope"
}

resource "databricks_secret" "publishing_api" {
  key          = "publishing_api"
  string_value = data.azurerm_key_vault_secret.example.value
  scope        = databricks_secret_scope.app.id
}

resource "databricks_cluster" "this" {
  # ...
  spark_conf = {
    # ...
    "fs.azure.account.oauth2.client.secret" = databricks_secret.publishing_api.config_reference
  }
}

Argument Reference

The following arguments are required:

Attribute Reference

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

Import

The resource secret can be imported using scopeName|||secretKey combination. This may change in future versions.

terraform import databricks_secret.app `scopeName|||secretKey`

The following resources are often used in the same context: