1. Packages
  2. Google Cloud (GCP) Classic
  3. API Docs
  4. runtimeconfig
  5. getVariable
Google Cloud v8.26.0 published on Thursday, Apr 10, 2025 by Pulumi

gcp.runtimeconfig.getVariable

Explore with Pulumi AI

Google Cloud v8.26.0 published on Thursday, Apr 10, 2025 by Pulumi

Example Usage

import * as pulumi from "@pulumi/pulumi";
import * as gcp from "@pulumi/gcp";

const run_service = gcp.runtimeconfig.getVariable({
    parent: "my-service",
    name: "prod-variables/hostname",
});
Copy
import pulumi
import pulumi_gcp as gcp

run_service = gcp.runtimeconfig.get_variable(parent="my-service",
    name="prod-variables/hostname")
Copy
package main

import (
	"github.com/pulumi/pulumi-gcp/sdk/v8/go/gcp/runtimeconfig"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := runtimeconfig.LookupVariable(ctx, &runtimeconfig.LookupVariableArgs{
			Parent: "my-service",
			Name:   "prod-variables/hostname",
		}, nil)
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Gcp = Pulumi.Gcp;

return await Deployment.RunAsync(() => 
{
    var run_service = Gcp.RuntimeConfig.GetVariable.Invoke(new()
    {
        Parent = "my-service",
        Name = "prod-variables/hostname",
    });

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.gcp.runtimeconfig.RuntimeconfigFunctions;
import com.pulumi.gcp.runtimeconfig.inputs.GetVariableArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;

public class App {
    public static void main(String[] args) {
        Pulumi.run(App::stack);
    }

    public static void stack(Context ctx) {
        final var run-service = RuntimeconfigFunctions.getVariable(GetVariableArgs.builder()
            .parent("my-service")
            .name("prod-variables/hostname")
            .build());

    }
}
Copy
variables:
  run-service:
    fn::invoke:
      function: gcp:runtimeconfig:getVariable
      arguments:
        parent: my-service
        name: prod-variables/hostname
Copy

Using getVariable

Two invocation forms are available. The direct form accepts plain arguments and either blocks until the result value is available, or returns a Promise-wrapped result. The output form accepts Input-wrapped arguments and returns an Output-wrapped result.

function getVariable(args: GetVariableArgs, opts?: InvokeOptions): Promise<GetVariableResult>
function getVariableOutput(args: GetVariableOutputArgs, opts?: InvokeOptions): Output<GetVariableResult>
Copy
def get_variable(name: Optional[str] = None,
                 parent: Optional[str] = None,
                 project: Optional[str] = None,
                 opts: Optional[InvokeOptions] = None) -> GetVariableResult
def get_variable_output(name: Optional[pulumi.Input[str]] = None,
                 parent: Optional[pulumi.Input[str]] = None,
                 project: Optional[pulumi.Input[str]] = None,
                 opts: Optional[InvokeOptions] = None) -> Output[GetVariableResult]
Copy
func LookupVariable(ctx *Context, args *LookupVariableArgs, opts ...InvokeOption) (*LookupVariableResult, error)
func LookupVariableOutput(ctx *Context, args *LookupVariableOutputArgs, opts ...InvokeOption) LookupVariableResultOutput
Copy

> Note: This function is named LookupVariable in the Go SDK.

public static class GetVariable 
{
    public static Task<GetVariableResult> InvokeAsync(GetVariableArgs args, InvokeOptions? opts = null)
    public static Output<GetVariableResult> Invoke(GetVariableInvokeArgs args, InvokeOptions? opts = null)
}
Copy
public static CompletableFuture<GetVariableResult> getVariable(GetVariableArgs args, InvokeOptions options)
public static Output<GetVariableResult> getVariable(GetVariableArgs args, InvokeOptions options)
Copy
fn::invoke:
  function: gcp:runtimeconfig/getVariable:getVariable
  arguments:
    # arguments dictionary
Copy

The following arguments are supported:

Name This property is required. string
The name of the Runtime Configurator configuration.
Parent This property is required. string
The name of the RuntimeConfig resource containing this variable.


Project string
The project in which the resource belongs. If it is not provided, the provider project is used.
Name This property is required. string
The name of the Runtime Configurator configuration.
Parent This property is required. string
The name of the RuntimeConfig resource containing this variable.


Project string
The project in which the resource belongs. If it is not provided, the provider project is used.
name This property is required. String
The name of the Runtime Configurator configuration.
parent This property is required. String
The name of the RuntimeConfig resource containing this variable.


project String
The project in which the resource belongs. If it is not provided, the provider project is used.
name This property is required. string
The name of the Runtime Configurator configuration.
parent This property is required. string
The name of the RuntimeConfig resource containing this variable.


project string
The project in which the resource belongs. If it is not provided, the provider project is used.
name This property is required. str
The name of the Runtime Configurator configuration.
parent This property is required. str
The name of the RuntimeConfig resource containing this variable.


project str
The project in which the resource belongs. If it is not provided, the provider project is used.
name This property is required. String
The name of the Runtime Configurator configuration.
parent This property is required. String
The name of the RuntimeConfig resource containing this variable.


project String
The project in which the resource belongs. If it is not provided, the provider project is used.

getVariable Result

The following output properties are available:

Id string
The provider-assigned unique ID for this managed resource.
Name string
Parent string
Text string
UpdateTime string
Value string
Project string
Id string
The provider-assigned unique ID for this managed resource.
Name string
Parent string
Text string
UpdateTime string
Value string
Project string
id String
The provider-assigned unique ID for this managed resource.
name String
parent String
text String
updateTime String
value String
project String
id string
The provider-assigned unique ID for this managed resource.
name string
parent string
text string
updateTime string
value string
project string
id str
The provider-assigned unique ID for this managed resource.
name str
parent str
text str
update_time str
value str
project str
id String
The provider-assigned unique ID for this managed resource.
name String
parent String
text String
updateTime String
value String
project String

Package Details

Repository
Google Cloud (GCP) Classic pulumi/pulumi-gcp
License
Apache-2.0
Notes
This Pulumi package is based on the google-beta Terraform Provider.
Google Cloud v8.26.0 published on Thursday, Apr 10, 2025 by Pulumi