1. Packages
  2. Google Cloud (GCP) Classic
  3. API Docs
  4. runtimeconfig
  5. getVariable
Google Cloud Classic v8.3.1 published on Wednesday, Sep 25, 2024 by Pulumi

gcp.runtimeconfig.getVariable

Explore with Pulumi AI

gcp logo
Google Cloud Classic v8.3.1 published on Wednesday, Sep 25, 2024 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",
    });
    
    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:

    Name string
    The name of the Runtime Configurator configuration.
    Parent 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 string
    The name of the Runtime Configurator configuration.
    Parent 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 String
    The name of the Runtime Configurator configuration.
    parent 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 string
    The name of the Runtime Configurator configuration.
    parent 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 str
    The name of the Runtime Configurator configuration.
    parent 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 String
    The name of the Runtime Configurator configuration.
    parent 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.
    gcp logo
    Google Cloud Classic v8.3.1 published on Wednesday, Sep 25, 2024 by Pulumi