GitLab

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

getGroupVariables

The gitlab.getGroupVariables data source allows to retrieve all group-level CI/CD variables.

Upstream API: GitLab REST API docs

Example Usage

using Pulumi;
using GitLab = Pulumi.GitLab;

class MyStack : Stack
{
    public MyStack()
    {
        var vars = Output.Create(GitLab.GetGroupVariables.InvokeAsync(new GitLab.GetGroupVariablesArgs
        {
            Group = "my/example/group",
        }));
        var stagingVars = Output.Create(GitLab.GetGroupVariables.InvokeAsync(new GitLab.GetGroupVariablesArgs
        {
            EnvironmentScope = "staging/*",
            Group = "my/example/group",
        }));
    }

}
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.GetGroupVariables(ctx, &GetGroupVariablesArgs{
			Group: "my/example/group",
		}, nil)
		if err != nil {
			return err
		}
		_, err = gitlab.GetGroupVariables(ctx, &GetGroupVariablesArgs{
			EnvironmentScope: pulumi.StringRef("staging/*"),
			Group:            "my/example/group",
		}, 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 vars = Output.of(GitlabFunctions.getGroupVariables(GetGroupVariablesArgs.builder()
            .group("my/example/group")
            .build()));

        final var stagingVars = Output.of(GitlabFunctions.getGroupVariables(GetGroupVariablesArgs.builder()
            .environmentScope("staging/*")
            .group("my/example/group")
            .build()));

    }
}
import pulumi
import pulumi_gitlab as gitlab

vars = gitlab.get_group_variables(group="my/example/group")
staging_vars = gitlab.get_group_variables(environment_scope="staging/*",
    group="my/example/group")
import * as pulumi from "@pulumi/pulumi";
import * as gitlab from "@pulumi/gitlab";

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

Using getGroupVariables

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 getGroupVariables(args: GetGroupVariablesArgs, opts?: InvokeOptions): Promise<GetGroupVariablesResult>
function getGroupVariablesOutput(args: GetGroupVariablesOutputArgs, opts?: InvokeOptions): Output<GetGroupVariablesResult>
def get_group_variables(environment_scope: Optional[str] = None,
                        group: Optional[str] = None,
                        opts: Optional[InvokeOptions] = None) -> GetGroupVariablesResult
def get_group_variables_output(environment_scope: Optional[pulumi.Input[str]] = None,
                        group: Optional[pulumi.Input[str]] = None,
                        opts: Optional[InvokeOptions] = None) -> Output[GetGroupVariablesResult]
func GetGroupVariables(ctx *Context, args *GetGroupVariablesArgs, opts ...InvokeOption) (*GetGroupVariablesResult, error)
func GetGroupVariablesOutput(ctx *Context, args *GetGroupVariablesOutputArgs, opts ...InvokeOption) GetGroupVariablesResultOutput

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

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

The following arguments are supported:

Group string
EnvironmentScope string
Group string
EnvironmentScope string
group String
environmentScope String
group string
environmentScope string
group String
environmentScope String

getGroupVariables Result

The following output properties are available:

Group string
Id string

The provider-assigned unique ID for this managed resource.

Variables List<Pulumi.GitLab.Outputs.GetGroupVariablesVariable>
EnvironmentScope string
Group string
Id string

The provider-assigned unique ID for this managed resource.

Variables []GetGroupVariablesVariable
EnvironmentScope string
group String
id String

The provider-assigned unique ID for this managed resource.

variables List<GetGroupVariablesVariable>
environmentScope String
group string
id string

The provider-assigned unique ID for this managed resource.

variables GetGroupVariablesVariable[]
environmentScope string
group str
id str

The provider-assigned unique ID for this managed resource.

variables Sequence[GetGroupVariablesVariable]
environment_scope str
group String
id String

The provider-assigned unique ID for this managed resource.

variables List<Property Map>
environmentScope String

Supporting Types

GetGroupVariablesVariable

EnvironmentScope string
Group string
Key string
Masked bool
Protected bool
Value string
VariableType string
EnvironmentScope string
Group string
Key string
Masked bool
Protected bool
Value string
VariableType string
environmentScope String
group String
key String
masked Boolean
protected_ Boolean
value String
variableType String
environmentScope string
group string
key string
masked boolean
protected boolean
value string
variableType string
environmentScope String
group String
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.