GitLab

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

getGroupVariable

The gitlab.GroupVariable data source allows to retrieve details about a group-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.GetGroupVariable.InvokeAsync(new GitLab.GetGroupVariableArgs
        {
            Group = "my/example/group",
            Key = "foo",
        }));
        var bar = Output.Create(GitLab.GetGroupVariable.InvokeAsync(new GitLab.GetGroupVariableArgs
        {
            EnvironmentScope = "staging/*",
            Group = "my/example/group",
            Key = "bar",
        }));
    }

}
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.LookupGroupVariable(ctx, &GetGroupVariableArgs{
			Group: "my/example/group",
			Key:   "foo",
		}, nil)
		if err != nil {
			return err
		}
		_, err = gitlab.LookupGroupVariable(ctx, &GetGroupVariableArgs{
			EnvironmentScope: pulumi.StringRef("staging/*"),
			Group:            "my/example/group",
			Key:              "bar",
		}, 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.getGroupVariable(GetGroupVariableArgs.builder()
            .group("my/example/group")
            .key("foo")
            .build()));

        final var bar = Output.of(GitlabFunctions.getGroupVariable(GetGroupVariableArgs.builder()
            .environmentScope("staging/*")
            .group("my/example/group")
            .key("bar")
            .build()));

    }
}
import pulumi
import pulumi_gitlab as gitlab

foo = gitlab.get_group_variable(group="my/example/group",
    key="foo")
bar = gitlab.get_group_variable(environment_scope="staging/*",
    group="my/example/group",
    key="bar")
import * as pulumi from "@pulumi/pulumi";
import * as gitlab from "@pulumi/gitlab";

const foo = pulumi.output(gitlab.getGroupVariable({
    group: "my/example/group",
    key: "foo",
}));
// Using an environment scope
const bar = pulumi.output(gitlab.getGroupVariable({
    environmentScope: "staging/*",
    group: "my/example/group",
    key: "bar",
}));
variables:
  foo:
    Fn::Invoke:
      Function: gitlab:getGroupVariable
      Arguments:
        group: my/example/group
        key: foo
  bar:
    Fn::Invoke:
      Function: gitlab:getGroupVariable
      Arguments:
        environmentScope: staging/*
        group: my/example/group
        key: bar

Using getGroupVariable

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 getGroupVariable(args: GetGroupVariableArgs, opts?: InvokeOptions): Promise<GetGroupVariableResult>
function getGroupVariableOutput(args: GetGroupVariableOutputArgs, opts?: InvokeOptions): Output<GetGroupVariableResult>
def get_group_variable(environment_scope: Optional[str] = None,
                       group: Optional[str] = None,
                       key: Optional[str] = None,
                       opts: Optional[InvokeOptions] = None) -> GetGroupVariableResult
def get_group_variable_output(environment_scope: Optional[pulumi.Input[str]] = None,
                       group: Optional[pulumi.Input[str]] = None,
                       key: Optional[pulumi.Input[str]] = None,
                       opts: Optional[InvokeOptions] = None) -> Output[GetGroupVariableResult]
func LookupGroupVariable(ctx *Context, args *LookupGroupVariableArgs, opts ...InvokeOption) (*LookupGroupVariableResult, error)
func LookupGroupVariableOutput(ctx *Context, args *LookupGroupVariableOutputArgs, opts ...InvokeOption) LookupGroupVariableResultOutput

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

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

The following arguments are supported:

Group string
Key string
EnvironmentScope string
Group string
Key string
EnvironmentScope string
group String
key String
environmentScope String
group string
key string
environmentScope string
group String
key String
environmentScope String

getGroupVariable Result

The following output properties are available:

EnvironmentScope string
Group string
Id string

The provider-assigned unique ID for this managed resource.

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

The provider-assigned unique ID for this managed resource.

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

The provider-assigned unique ID for this managed resource.

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

The provider-assigned unique ID for this managed resource.

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

The provider-assigned unique ID for this managed resource.

key str
masked bool
protected bool
value str
variable_type str
environmentScope String
group String
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.