get Variable
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",
});
Content copied to clipboard
import pulumi
import pulumi_gcp as gcp
run_service = gcp.runtimeconfig.get_variable(parent="my-service",
name="prod-variables/hostname")
Content copied to clipboard
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",
});
});
Content copied to clipboard
package main
import (
"github.com/pulumi/pulumi-gcp/sdk/v7/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
})
}
Content copied to clipboard
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());
}
}
Content copied to clipboard
variables:
run-service:
fn::invoke:
Function: gcp:runtimeconfig:getVariable
Arguments:
parent: my-service
name: prod-variables/hostname
Content copied to clipboard
Return
A collection of values returned by getVariable.
Parameters
argument
A collection of arguments for invoking getVariable.
Return
A collection of values returned by getVariable.
Parameters
name
The name of the Runtime Configurator configuration.
parent
The name of the RuntimeConfig resource containing this variable.
project
The project in which the resource belongs. If it is not provided, the provider project is used.
See also
suspend fun getVariable(argument: suspend GetVariablePlainArgsBuilder.() -> Unit): GetVariableResult
Return
A collection of values returned by getVariable.
Parameters
argument
Builder for com.pulumi.gcp.runtimeconfig.kotlin.inputs.GetVariablePlainArgs.