GitLab v8.1.0 published on Friday, Jun 21, 2024 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/*",
});
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/*")
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
	})
}
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/*",
    });
});
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());
    }
}
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/*
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 dictionaryThe following arguments are supported:
- Group string
 - The name or id of the group.
 - Environment
Scope string - The environment scope of the variable. Defaults to all environment (
*). 
- Group string
 - The name or id of the group.
 - Environment
Scope string - The environment scope of the variable. Defaults to all environment (
*). 
- group String
 - The name or id of the group.
 - environment
Scope String - The environment scope of the variable. Defaults to all environment (
*). 
- group string
 - The name or id of the group.
 - environment
Scope string - The environment scope of the variable. Defaults to all environment (
*). 
- group str
 - The name or id of the group.
 - environment_
scope str - The environment scope of the variable. Defaults to all environment (
*). 
- group String
 - The name or id of the group.
 - environment
Scope 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
 - The provider-assigned unique ID for this managed resource.
 - Variables
List<Pulumi.
Git Lab. Outputs. Get Group Variables Variable>  - The list of variables returned by the search
 - Environment
Scope string - The environment scope of the variable. Defaults to all environment (
*). 
- Group string
 - The name or id of the group.
 - Id string
 - The provider-assigned unique ID for this managed resource.
 - Variables
[]Get
Group Variables Variable  - The list of variables returned by the search
 - Environment
Scope string - The environment scope of the variable. Defaults to all environment (
*). 
- group String
 - The name or id of the group.
 - id String
 - The provider-assigned unique ID for this managed resource.
 - variables
List<Get
Group Variables Variable>  - The list of variables returned by the search
 - environment
Scope String - The environment scope of the variable. Defaults to all environment (
*). 
- group string
 - The name or id of the group.
 - id string
 - The provider-assigned unique ID for this managed resource.
 - variables
Get
Group Variables Variable[]  - The list of variables returned by the search
 - environment
Scope string - The environment scope of the variable. Defaults to all environment (
*). 
- group str
 - The name or id of the group.
 - id str
 - The provider-assigned unique ID for this managed resource.
 - variables
Sequence[Get
Group Variables Variable]  - 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
 - The provider-assigned unique ID for this managed resource.
 - variables List<Property Map>
 - The list of variables returned by the search
 - environment
Scope String - The environment scope of the variable. Defaults to all environment (
*). 
Supporting Types
GetGroupVariablesVariable   
- Description string
 - The description of the variable.
 - Environment
Scope string - The environment scope of the variable. Defaults to all environment (
*). Note that in Community Editions of Gitlab, values other than*will cause inconsistent plans. - Group string
 - The name or id of the group.
 - Key string
 - The name of the variable.
 - Masked bool
 - If set to 
true, the value of the variable will be hidden in job logs. The value must meet the masking requirements. Defaults tofalse. - Protected bool
 - If set to 
true, the variable will be passed only to pipelines running on protected branches and tags. Defaults tofalse. - Raw bool
 - Whether the variable is treated as a raw string. Default: false. When true, variables in the value are not expanded.
 - Value string
 - The value of the variable.
 - Variable
Type string - The type of a variable. Valid values are: 
env_var,file. Default isenv_var. 
- Description string
 - The description of the variable.
 - Environment
Scope string - The environment scope of the variable. Defaults to all environment (
*). Note that in Community Editions of Gitlab, values other than*will cause inconsistent plans. - Group string
 - The name or id of the group.
 - Key string
 - The name of the variable.
 - Masked bool
 - If set to 
true, the value of the variable will be hidden in job logs. The value must meet the masking requirements. Defaults tofalse. - Protected bool
 - If set to 
true, the variable will be passed only to pipelines running on protected branches and tags. Defaults tofalse. - Raw bool
 - Whether the variable is treated as a raw string. Default: false. When true, variables in the value are not expanded.
 - Value string
 - The value of the variable.
 - Variable
Type string - The type of a variable. Valid values are: 
env_var,file. Default isenv_var. 
- description String
 - The description of the variable.
 - environment
Scope String - The environment scope of the variable. Defaults to all environment (
*). Note that in Community Editions of Gitlab, values other than*will cause inconsistent plans. - group String
 - The name or id of the group.
 - key String
 - The name of the variable.
 - masked Boolean
 - If set to 
true, the value of the variable will be hidden in job logs. The value must meet the masking requirements. Defaults tofalse. - protected_ Boolean
 - If set to 
true, the variable will be passed only to pipelines running on protected branches and tags. Defaults tofalse. - raw Boolean
 - Whether the variable is treated as a raw string. Default: false. When true, variables in the value are not expanded.
 - value String
 - The value of the variable.
 - variable
Type String - The type of a variable. Valid values are: 
env_var,file. Default isenv_var. 
- description string
 - The description of the variable.
 - environment
Scope string - The environment scope of the variable. Defaults to all environment (
*). Note that in Community Editions of Gitlab, values other than*will cause inconsistent plans. - group string
 - The name or id of the group.
 - key string
 - The name of the variable.
 - masked boolean
 - If set to 
true, the value of the variable will be hidden in job logs. The value must meet the masking requirements. Defaults tofalse. - protected boolean
 - If set to 
true, the variable will be passed only to pipelines running on protected branches and tags. Defaults tofalse. - raw boolean
 - Whether the variable is treated as a raw string. Default: false. When true, variables in the value are not expanded.
 - value string
 - The value of the variable.
 - variable
Type string - The type of a variable. Valid values are: 
env_var,file. Default isenv_var. 
- description str
 - The description of the variable.
 - environment_
scope str - The environment scope of the variable. Defaults to all environment (
*). Note that in Community Editions of Gitlab, values other than*will cause inconsistent plans. - group str
 - The name or id of the group.
 - key str
 - The name of the variable.
 - masked bool
 - If set to 
true, the value of the variable will be hidden in job logs. The value must meet the masking requirements. Defaults tofalse. - protected bool
 - If set to 
true, the variable will be passed only to pipelines running on protected branches and tags. Defaults tofalse. - raw bool
 - Whether the variable is treated as a raw string. Default: false. When true, variables in the value are not expanded.
 - value str
 - The value of the variable.
 - variable_
type str - The type of a variable. Valid values are: 
env_var,file. Default isenv_var. 
- description String
 - The description of the variable.
 - environment
Scope String - The environment scope of the variable. Defaults to all environment (
*). Note that in Community Editions of Gitlab, values other than*will cause inconsistent plans. - group String
 - The name or id of the group.
 - key String
 - The name of the variable.
 - masked Boolean
 - If set to 
true, the value of the variable will be hidden in job logs. The value must meet the masking requirements. Defaults tofalse. - protected Boolean
 - If set to 
true, the variable will be passed only to pipelines running on protected branches and tags. Defaults tofalse. - raw Boolean
 - Whether the variable is treated as a raw string. Default: false. When true, variables in the value are not expanded.
 - value String
 - The value of the variable.
 - variable
Type String - The type of a variable. Valid values are: 
env_var,file. Default isenv_var. 
Package Details
- Repository
 - GitLab pulumi/pulumi-gitlab
 - License
 - Apache-2.0
 - Notes
 - This Pulumi package is based on the 
gitlabTerraform Provider.