Skip to content

googleRuntimeconfigVariable

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

\~> Warning: This resource is in beta, and should be used with the terraform-provider-google-beta provider. See Provider Versions for more details on beta resources.

Example Usage

Example creating a RuntimeConfig variable.

/*Provider bindings are generated by running cdktf get.
See https://cdk.tf/provider-generation for more details.*/
import * as google from "./.gen/providers/google";
/*The following providers are missing schema information and might need manual adjustments to synthesize correctly: google.
For a more precise conversion please use the --provider flag in convert.*/
const googleRuntimeconfigConfigMyRuntimeConfig =
  new google.runtimeconfigConfig.RuntimeconfigConfig(
    this,
    "my-runtime-config",
    {
      description: "Runtime configuration values for my service",
      name: "my-service-runtime-config",
    }
  );
new google.runtimeconfigVariable.RuntimeconfigVariable(this, "environment", {
  name: "prod-variables/hostname",
  parent: googleRuntimeconfigConfigMyRuntimeConfig.name,
  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.

/*Provider bindings are generated by running cdktf get.
See https://cdk.tf/provider-generation for more details.*/
import * as google from "./.gen/providers/google";
/*The following providers are missing schema information and might need manual adjustments to synthesize correctly: google.
For a more precise conversion please use the --provider flag in convert.*/
const googleRuntimeconfigConfigMyRuntimeConfig =
  new google.runtimeconfigConfig.RuntimeconfigConfig(
    this,
    "my-runtime-config",
    {
      description: "Runtime configuration values for my service",
      name: "my-service-runtime-config",
    }
  );
new google.runtimeconfigVariable.RuntimeconfigVariable(this, "my-secret", {
  name: "secret",
  parent: googleRuntimeconfigConfigMyRuntimeConfig.name,
  value: '${filebase64("my-encrypted-secret.dat")}',
});

Argument Reference

The following arguments are supported:

  • name - (Required) The name of the variable to manage. Note that variable names can be hierarchical using slashes (e.g. "prod-variables/hostname").

  • parent - (Required) The name of the RuntimeConfig resource containing this variable.

  • text or value - (Required) The content to associate with the variable. Exactly one of text or variable must be specified. If text is specified, it must be a valid UTF-8 string and less than 4096 bytes in length. If value is specified, it must be base64 encoded and less than 4096 bytes in length.


  • project - (Optional) The ID of the project in which the resource belongs. If it is not provided, the provider project is used.

Attributes Reference

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

  • id - an identifier for the resource with format projects/{{project}}/configs/{{config}}/variables/{{name}}

  • updateTime - (Computed) The timestamp in RFC3339 UTC "Zulu" format, accurate to nanoseconds, representing when the variable was last updated. Example: "2016-10-09T12:33:37.578138407Z".

Import

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

$ terraform import google_runtimeconfig_variable.myvariable myconfig/myvariable
$ terraform import google_runtimeconfig_variable.myvariable projects/my-gcp-project/configs/myconfig/variables/myvariable

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