get Project Variables
The gitlab.getProjectVariables
data source allows to retrieve all project-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.getProjectVariables({
project: "my/example/project",
});
const stagingVars = gitlab.getProjectVariables({
environmentScope: "staging/*",
project: "my/example/project",
});
Content copied to clipboard
import pulumi
import pulumi_gitlab as gitlab
vars = gitlab.get_project_variables(project="my/example/project")
staging_vars = gitlab.get_project_variables(environment_scope="staging/*",
project="my/example/project")
Content copied to clipboard
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using GitLab = Pulumi.GitLab;
return await Deployment.RunAsync(() =>
{
var vars = GitLab.GetProjectVariables.Invoke(new()
{
Project = "my/example/project",
});
var stagingVars = GitLab.GetProjectVariables.Invoke(new()
{
EnvironmentScope = "staging/*",
Project = "my/example/project",
});
});
Content copied to clipboard
package main
import (
"github.com/pulumi/pulumi-gitlab/sdk/v6/go/gitlab"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := gitlab.GetProjectVariables(ctx, &gitlab.GetProjectVariablesArgs{
Project: "my/example/project",
}, nil)
if err != nil {
return err
}
_, err = gitlab.GetProjectVariables(ctx, &gitlab.GetProjectVariablesArgs{
EnvironmentScope: pulumi.StringRef("staging/*"),
Project: "my/example/project",
}, nil)
if err != nil {
return err
}
return nil
})
}
Content copied to clipboard
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.GetProjectVariablesArgs;
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.getProjectVariables(GetProjectVariablesArgs.builder()
.project("my/example/project")
.build());
final var stagingVars = GitlabFunctions.getProjectVariables(GetProjectVariablesArgs.builder()
.environmentScope("staging/*")
.project("my/example/project")
.build());
}
}
Content copied to clipboard
variables:
vars:
fn::invoke:
Function: gitlab:getProjectVariables
Arguments:
project: my/example/project
stagingVars:
fn::invoke:
Function: gitlab:getProjectVariables
Arguments:
environmentScope: staging/*
project: my/example/project
Content copied to clipboard
Return
A collection of values returned by getProjectVariables. //////
Parameters
argument
A collection of arguments for invoking getProjectVariables.
suspend fun getProjectVariables(environmentScope: String? = null, project: String): GetProjectVariablesResult
Return
A collection of values returned by getProjectVariables.
Parameters
environment Scope
project
See also
suspend fun getProjectVariables(argument: suspend GetProjectVariablesPlainArgsBuilder.() -> Unit): GetProjectVariablesResult
Return
A collection of values returned by getProjectVariables.
Parameters
argument
Builder for com.pulumi.gitlab.kotlin.inputs.GetProjectVariablesPlainArgs.