google_runtimeconfig_variable

Manages a RuntimeConfig variable in Google Cloud. For more information, see the official documentation, or the JSON API.

Example Usage

Example creating a RuntimeConfig variable.

resource "google_runtimeconfig_config" "my-runtime-config" {
  name        = "my-service-runtime-config"
  description = "Runtime configuration values for my service"
}

resource "google_runtimeconfig_variable" "environment" {
  parent = google_runtimeconfig_config.my-runtime-config.name
  name   = "prod-variables/hostname"
  text   = "example.com"
}

You can also encode binary content using the value argument instead. The value must be base64 encoded.

Example of using the value argument.

resource "google_runtimeconfig_config" "my-runtime-config" {
  name        = "my-service-runtime-config"
  description = "Runtime configuration values for my service"
}

resource "google_runtimeconfig_variable" "my-secret" {
  parent = google_runtimeconfig_config.my-runtime-config.name
  name   = "secret"
  value  = filebase64("my-encrypted-secret.dat")
}

Argument Reference

The following arguments are supported:


Attributes Reference

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

Import

Runtime Config Variables can be imported using the name or full variable name, e.g.

In Terraform v1.5.0 and later, use an import block to import Runtime Config Variables using one of the formats above. For example:

import {
  id = "projects/my-gcp-project/configs/{{config_id}}/variables/{{name}}"
  to = google_runtimeconfig_variable.default
}

When using the terraform import command, Runtime Config Variables can be imported using one of the formats above. For example:

$ terraform import google_runtimeconfig_variable.default projects/my-gcp-project/configs/{{config_id}}/variables/{{name}}
$ terraform import google_runtimeconfig_variable.default {{config_id}}/{{name}}

When importing using only the name, the provider project must be set.