1. Packages
  2. Gitlab Provider
  3. API Docs
  4. getGroupVariables
GitLab v8.10.0 published on Friday, Mar 21, 2025 by Pulumi

gitlab.getGroupVariables

Explore with Pulumi AI

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

Upstream API: GitLab REST API docs

Example Usage

import * as pulumi from "@pulumi/pulumi";
import * as gitlab from "@pulumi/gitlab";

const vars = gitlab.getGroupVariables({
    group: "my/example/group",
});
// Using an environment scope
const stagingVars = gitlab.getGroupVariables({
    group: "my/example/group",
    environmentScope: "staging/*",
});
Copy
import pulumi
import pulumi_gitlab as gitlab

vars = gitlab.get_group_variables(group="my/example/group")
# Using an environment scope
staging_vars = gitlab.get_group_variables(group="my/example/group",
    environment_scope="staging/*")
Copy
package main

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

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := gitlab.GetGroupVariables(ctx, &gitlab.GetGroupVariablesArgs{
			Group: "my/example/group",
		}, nil)
		if err != nil {
			return err
		}
		// Using an environment scope
		_, err = gitlab.GetGroupVariables(ctx, &gitlab.GetGroupVariablesArgs{
			Group:            "my/example/group",
			EnvironmentScope: pulumi.StringRef("staging/*"),
		}, nil)
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using GitLab = Pulumi.GitLab;

return await Deployment.RunAsync(() => 
{
    var vars = GitLab.GetGroupVariables.Invoke(new()
    {
        Group = "my/example/group",
    });

    // Using an environment scope
    var stagingVars = GitLab.GetGroupVariables.Invoke(new()
    {
        Group = "my/example/group",
        EnvironmentScope = "staging/*",
    });

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.gitlab.GitlabFunctions;
import com.pulumi.gitlab.inputs.GetGroupVariablesArgs;
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 vars = GitlabFunctions.getGroupVariables(GetGroupVariablesArgs.builder()
            .group("my/example/group")
            .build());

        // Using an environment scope
        final var stagingVars = GitlabFunctions.getGroupVariables(GetGroupVariablesArgs.builder()
            .group("my/example/group")
            .environmentScope("staging/*")
            .build());

    }
}
Copy
variables:
  vars:
    fn::invoke:
      function: gitlab:getGroupVariables
      arguments:
        group: my/example/group
  # Using an environment scope
  stagingVars:
    fn::invoke:
      function: gitlab:getGroupVariables
      arguments:
        group: my/example/group
        environmentScope: staging/*
Copy

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>
Copy
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]
Copy
func GetGroupVariables(ctx *Context, args *GetGroupVariablesArgs, opts ...InvokeOption) (*GetGroupVariablesResult, error)
func GetGroupVariablesOutput(ctx *Context, args *GetGroupVariablesOutputArgs, opts ...InvokeOption) GetGroupVariablesResultOutput
Copy

> 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)
}
Copy
public static CompletableFuture<GetGroupVariablesResult> getGroupVariables(GetGroupVariablesArgs args, InvokeOptions options)
public static Output<GetGroupVariablesResult> getGroupVariables(GetGroupVariablesArgs args, InvokeOptions options)
Copy
fn::invoke:
  function: gitlab:index/getGroupVariables:getGroupVariables
  arguments:
    # arguments dictionary
Copy

The following arguments are supported:

Group This property is required. string
The name or id of the group.
EnvironmentScope string
The environment scope of the variable. Defaults to all environment (*).
Group This property is required. string
The name or id of the group.
EnvironmentScope string
The environment scope of the variable. Defaults to all environment (*).
group This property is required. String
The name or id of the group.
environmentScope String
The environment scope of the variable. Defaults to all environment (*).
group This property is required. string
The name or id of the group.
environmentScope string
The environment scope of the variable. Defaults to all environment (*).
group This property is required. str
The name or id of the group.
environment_scope str
The environment scope of the variable. Defaults to all environment (*).
group This property is required. String
The name or id of the group.
environmentScope String
The environment scope of the variable. Defaults to all environment (*).

getGroupVariables Result

The following output properties are available:

Group string
The name or id of the group.
Id string
Variables List<Pulumi.GitLab.Outputs.GetGroupVariablesVariable>
The list of variables returned by the search
EnvironmentScope string
The environment scope of the variable. Defaults to all environment (*).
Group string
The name or id of the group.
Id string
Variables []GetGroupVariablesVariable
The list of variables returned by the search
EnvironmentScope string
The environment scope of the variable. Defaults to all environment (*).
group String
The name or id of the group.
id String
variables List<GetGroupVariablesVariable>
The list of variables returned by the search
environmentScope String
The environment scope of the variable. Defaults to all environment (*).
group string
The name or id of the group.
id string
variables GetGroupVariablesVariable[]
The list of variables returned by the search
environmentScope string
The environment scope of the variable. Defaults to all environment (*).
group str
The name or id of the group.
id str
variables Sequence[GetGroupVariablesVariable]
The list of variables returned by the search
environment_scope str
The environment scope of the variable. Defaults to all environment (*).
group String
The name or id of the group.
id String
variables List<Property Map>
The list of variables returned by the search
environmentScope String
The environment scope of the variable. Defaults to all environment (*).

Supporting Types

GetGroupVariablesVariable

Description This property is required. string
EnvironmentScope This property is required. string
Group This property is required. string
Key This property is required. string
Masked This property is required. bool
Protected This property is required. bool
Raw This property is required. bool
Value This property is required. string
VariableType This property is required. string
Description This property is required. string
EnvironmentScope This property is required. string
Group This property is required. string
Key This property is required. string
Masked This property is required. bool
Protected This property is required. bool
Raw This property is required. bool
Value This property is required. string
VariableType This property is required. string
description This property is required. String
environmentScope This property is required. String
group This property is required. String
key This property is required. String
masked This property is required. Boolean
protected_ This property is required. Boolean
raw This property is required. Boolean
value This property is required. String
variableType This property is required. String
description This property is required. string
environmentScope This property is required. string
group This property is required. string
key This property is required. string
masked This property is required. boolean
protected This property is required. boolean
raw This property is required. boolean
value This property is required. string
variableType This property is required. string
description This property is required. str
environment_scope This property is required. str
group This property is required. str
key This property is required. str
masked This property is required. bool
protected This property is required. bool
raw This property is required. bool
value This property is required. str
variable_type This property is required. str
description This property is required. String
environmentScope This property is required. String
group This property is required. String
key This property is required. String
masked This property is required. Boolean
protected This property is required. Boolean
raw This property is required. Boolean
value This property is required. String
variableType This property is required. String

Package Details

Repository
GitLab pulumi/pulumi-gitlab
License
Apache-2.0
Notes
This Pulumi package is based on the gitlab Terraform Provider.