Google Cloud Classic v8.3.1 published on Wednesday, Sep 25, 2024 by Pulumi
gcp.runtimeconfig.getVariable
Explore with Pulumi AI
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",
});
import pulumi
import pulumi_gcp as gcp
run_service = gcp.runtimeconfig.get_variable(parent="my-service",
name="prod-variables/hostname")
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
})
}
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",
});
});
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());
}
}
variables:
run-service:
fn::invoke:
Function: gcp:runtimeconfig:getVariable
Arguments:
parent: my-service
name: prod-variables/hostname
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>
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]
func LookupVariable(ctx *Context, args *LookupVariableArgs, opts ...InvokeOption) (*LookupVariableResult, error)
func LookupVariableOutput(ctx *Context, args *LookupVariableOutputArgs, opts ...InvokeOption) LookupVariableResultOutput
> 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)
}
public static CompletableFuture<GetVariableResult> getVariable(GetVariableArgs args, InvokeOptions options)
// Output-based functions aren't available in Java yet
fn::invoke:
function: gcp:runtimeconfig/getVariable:getVariable
arguments:
# arguments dictionary
The following arguments are supported:
getVariable Result
The following output properties are available:
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.