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

import * as pulumi from "@pulumi/pulumi";
import * as gitlab from "@pulumi/gitlab";
const foo = gitlab.getGroupVariable({
group: "my/example/group",
key: "foo",
});
// Using an environment scope
const bar = gitlab.getGroupVariable({
group: "my/example/group",
key: "bar",
environmentScope: "staging/*",
});
import pulumi
import pulumi_gitlab as gitlab
foo = gitlab.get_group_variable(group="my/example/group",
key="foo")
# Using an environment scope
bar = gitlab.get_group_variable(group="my/example/group",
key="bar",
environment_scope="staging/*")
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using GitLab = Pulumi.GitLab;
return await Deployment.RunAsync(() =>
{
var foo = GitLab.GetGroupVariable.Invoke(new()
{
Group = "my/example/group",
Key = "foo",
});
// Using an environment scope
var bar = GitLab.GetGroupVariable.Invoke(new()
{
Group = "my/example/group",
Key = "bar",
EnvironmentScope = "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.LookupGroupVariable(ctx, &gitlab.LookupGroupVariableArgs{
Group: "my/example/group",
Key: "foo",
}, nil)
if err != nil {
return err
}
// Using an environment scope
_, err = gitlab.LookupGroupVariable(ctx, &gitlab.LookupGroupVariableArgs{
Group: "my/example/group",
Key: "bar",
EnvironmentScope: pulumi.StringRef("staging/*"),
}, nil)
if err != nil {
return err
}
return nil
})
}
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.GetGroupVariableArgs;
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 foo = GitlabFunctions.getGroupVariable(GetGroupVariableArgs.builder()
.group("my/example/group")
.key("foo")
.build());
// Using an environment scope
final var bar = GitlabFunctions.getGroupVariable(GetGroupVariableArgs.builder()
.group("my/example/group")
.key("bar")
.environmentScope("staging/*")
.build());
}
}
variables:
foo:
fn::invoke:
function: gitlab:getGroupVariable
arguments:
group: my/example/group
key: foo
# Using an environment scope
bar:
fn::invoke:
function: gitlab:getGroupVariable
arguments:
group: my/example/group
key: bar
environmentScope: staging/*

Return

A collection of values returned by getGroupVariable. //////

Parameters

argument

A collection of arguments for invoking getGroupVariable.


suspend fun getGroupVariable(environmentScope: String? = null, group: String, key: String): GetGroupVariableResult

Return

A collection of values returned by getGroupVariable.

Parameters

environmentScope

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

The name or id of the group.

key

The name of the variable.

See also


Return

A collection of values returned by getGroupVariable.

Parameters

argument

Builder for com.pulumi.gitlab.kotlin.inputs.GetGroupVariablePlainArgs.

See also