GitLab

v4.8.0 published on Friday, Jul 15, 2022 by Pulumi

getInstanceVariable

The gitlab.InstanceVariable data source allows to retrieve details about an instance-level CI/CD variable.

Upstream API: GitLab REST API docs

Example Usage

using Pulumi;
using GitLab = Pulumi.GitLab;

class MyStack : Stack
{
    public MyStack()
    {
        var foo = Output.Create(GitLab.GetInstanceVariable.InvokeAsync(new GitLab.GetInstanceVariableArgs
        {
            Key = "foo",
        }));
    }

}
package main

import (
	"github.com/pulumi/pulumi-gitlab/sdk/v4/go/gitlab"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := gitlab.LookupInstanceVariable(ctx, &GetInstanceVariableArgs{
			Key: "foo",
		}, nil)
		if err != nil {
			return err
		}
		return nil
	})
}
package generated_program;

import java.util.*;
import java.io.*;
import java.nio.*;
import com.pulumi.*;

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

    public static void stack(Context ctx) {
        final var foo = Output.of(GitlabFunctions.getInstanceVariable(GetInstanceVariableArgs.builder()
            .key("foo")
            .build()));

    }
}
import pulumi
import pulumi_gitlab as gitlab

foo = gitlab.get_instance_variable(key="foo")
import * as pulumi from "@pulumi/pulumi";
import * as gitlab from "@pulumi/gitlab";

const foo = pulumi.output(gitlab.getInstanceVariable({
    key: "foo",
}));
variables:
  foo:
    Fn::Invoke:
      Function: gitlab:getInstanceVariable
      Arguments:
        key: foo

Using getInstanceVariable

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 getInstanceVariable(args: GetInstanceVariableArgs, opts?: InvokeOptions): Promise<GetInstanceVariableResult>
function getInstanceVariableOutput(args: GetInstanceVariableOutputArgs, opts?: InvokeOptions): Output<GetInstanceVariableResult>
def get_instance_variable(key: Optional[str] = None,
                          opts: Optional[InvokeOptions] = None) -> GetInstanceVariableResult
def get_instance_variable_output(key: Optional[pulumi.Input[str]] = None,
                          opts: Optional[InvokeOptions] = None) -> Output[GetInstanceVariableResult]
func LookupInstanceVariable(ctx *Context, args *LookupInstanceVariableArgs, opts ...InvokeOption) (*LookupInstanceVariableResult, error)
func LookupInstanceVariableOutput(ctx *Context, args *LookupInstanceVariableOutputArgs, opts ...InvokeOption) LookupInstanceVariableResultOutput

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

public static class GetInstanceVariable 
{
    public static Task<GetInstanceVariableResult> InvokeAsync(GetInstanceVariableArgs args, InvokeOptions? opts = null)
    public static Output<GetInstanceVariableResult> Invoke(GetInstanceVariableInvokeArgs args, InvokeOptions? opts = null)
}
public static CompletableFuture<GetInstanceVariableResult> getInstanceVariable(GetInstanceVariableArgs args, InvokeOptions options)
// Output-based functions aren't available in Java yet
Fn::Invoke:
  Function: gitlab:index/getInstanceVariable:getInstanceVariable
  Arguments:
    # Arguments dictionary

The following arguments are supported:

Key string
Key string
key String
key string
key str
key String

getInstanceVariable Result

The following output properties are available:

Id string

The provider-assigned unique ID for this managed resource.

Key string
Masked bool
Protected bool
Value string
VariableType string
Id string

The provider-assigned unique ID for this managed resource.

Key string
Masked bool
Protected bool
Value string
VariableType string
id String

The provider-assigned unique ID for this managed resource.

key String
masked Boolean
protected_ Boolean
value String
variableType String
id string

The provider-assigned unique ID for this managed resource.

key string
masked boolean
protected boolean
value string
variableType string
id str

The provider-assigned unique ID for this managed resource.

key str
masked bool
protected bool
value str
variable_type str
id String

The provider-assigned unique ID for this managed resource.

key String
masked Boolean
protected Boolean
value String
variableType String

Package Details

Repository
https://github.com/pulumi/pulumi-gitlab
License
Apache-2.0
Notes

This Pulumi package is based on the gitlab Terraform Provider.