Viewing docs for GitLab v9.10.0
published on Monday, Mar 9, 2026 by Pulumi
published on Monday, Mar 9, 2026 by Pulumi
Viewing docs for GitLab v9.10.0
published on Monday, Mar 9, 2026 by Pulumi
published on Monday, Mar 9, 2026 by Pulumi
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",
});
// Using an environment scope
const stagingVars = gitlab.getProjectVariables({
project: "my/example/project",
environmentScope: "staging/*",
});
import pulumi
import pulumi_gitlab as gitlab
vars = gitlab.get_project_variables(project="my/example/project")
# Using an environment scope
staging_vars = gitlab.get_project_variables(project="my/example/project",
environment_scope="staging/*")
package main
import (
"github.com/pulumi/pulumi-gitlab/sdk/v9/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
}
// Using an environment scope
_, err = gitlab.GetProjectVariables(ctx, &gitlab.GetProjectVariablesArgs{
Project: "my/example/project",
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.GetProjectVariables.Invoke(new()
{
Project = "my/example/project",
});
// Using an environment scope
var stagingVars = GitLab.GetProjectVariables.Invoke(new()
{
Project = "my/example/project",
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.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());
// Using an environment scope
final var stagingVars = GitlabFunctions.getProjectVariables(GetProjectVariablesArgs.builder()
.project("my/example/project")
.environmentScope("staging/*")
.build());
}
}
variables:
vars:
fn::invoke:
function: gitlab:getProjectVariables
arguments:
project: my/example/project
# Using an environment scope
stagingVars:
fn::invoke:
function: gitlab:getProjectVariables
arguments:
project: my/example/project
environmentScope: staging/*
Using getProjectVariables
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 getProjectVariables(args: GetProjectVariablesArgs, opts?: InvokeOptions): Promise<GetProjectVariablesResult>
function getProjectVariablesOutput(args: GetProjectVariablesOutputArgs, opts?: InvokeOptions): Output<GetProjectVariablesResult>def get_project_variables(environment_scope: Optional[str] = None,
project: Optional[str] = None,
opts: Optional[InvokeOptions] = None) -> GetProjectVariablesResult
def get_project_variables_output(environment_scope: Optional[pulumi.Input[str]] = None,
project: Optional[pulumi.Input[str]] = None,
opts: Optional[InvokeOptions] = None) -> Output[GetProjectVariablesResult]func GetProjectVariables(ctx *Context, args *GetProjectVariablesArgs, opts ...InvokeOption) (*GetProjectVariablesResult, error)
func GetProjectVariablesOutput(ctx *Context, args *GetProjectVariablesOutputArgs, opts ...InvokeOption) GetProjectVariablesResultOutput> Note: This function is named GetProjectVariables in the Go SDK.
public static class GetProjectVariables
{
public static Task<GetProjectVariablesResult> InvokeAsync(GetProjectVariablesArgs args, InvokeOptions? opts = null)
public static Output<GetProjectVariablesResult> Invoke(GetProjectVariablesInvokeArgs args, InvokeOptions? opts = null)
}public static CompletableFuture<GetProjectVariablesResult> getProjectVariables(GetProjectVariablesArgs args, InvokeOptions options)
public static Output<GetProjectVariablesResult> getProjectVariables(GetProjectVariablesArgs args, InvokeOptions options)
fn::invoke:
function: gitlab:index/getProjectVariables:getProjectVariables
arguments:
# arguments dictionaryThe following arguments are supported:
- Project string
- The name or path of the project.
- Environment
Scope string - The environment scope of the variable. Defaults to all environment (
*).
- Project string
- The name or path of the project.
- Environment
Scope string - The environment scope of the variable. Defaults to all environment (
*).
- project String
- The name or path of the project.
- environment
Scope String - The environment scope of the variable. Defaults to all environment (
*).
- project string
- The name or path of the project.
- environment
Scope string - The environment scope of the variable. Defaults to all environment (
*).
- project str
- The name or path of the project.
- environment_
scope str - The environment scope of the variable. Defaults to all environment (
*).
- project String
- The name or path of the project.
- environment
Scope String - The environment scope of the variable. Defaults to all environment (
*).
getProjectVariables Result
The following output properties are available:
- Id string
- The ID of this datasource. In the format
<project:environment-scope>. - Project string
- The name or path of the project.
- Variables
List<Pulumi.
Git Lab. Outputs. Get Project Variables Variable> - The list of variables returned by the search
- Environment
Scope string - The environment scope of the variable. Defaults to all environment (
*).
- Id string
- The ID of this datasource. In the format
<project:environment-scope>. - Project string
- The name or path of the project.
- Variables
[]Get
Project Variables Variable - The list of variables returned by the search
- Environment
Scope string - The environment scope of the variable. Defaults to all environment (
*).
- id String
- The ID of this datasource. In the format
<project:environment-scope>. - project String
- The name or path of the project.
- variables
List<Get
Project Variables Variable> - The list of variables returned by the search
- environment
Scope String - The environment scope of the variable. Defaults to all environment (
*).
- id string
- The ID of this datasource. In the format
<project:environment-scope>. - project string
- The name or path of the project.
- variables
Get
Project Variables Variable[] - The list of variables returned by the search
- environment
Scope string - The environment scope of the variable. Defaults to all environment (
*).
- id str
- The ID of this datasource. In the format
<project:environment-scope>. - project str
- The name or path of the project.
- variables
Sequence[Get
Project Variables Variable] - The list of variables returned by the search
- environment_
scope str - The environment scope of the variable. Defaults to all environment (
*).
- id String
- The ID of this datasource. In the format
<project:environment-scope>. - project String
- The name or path of the project.
- 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
GetProjectVariablesVariable
- Description string
- The description of the variable. Maximum of 255 characters.
- Environment
Scope string - The environment scope of the variable. Defaults to all environment (
*). - Key string
- The name of the variable.
- Masked bool
- If set to
true, the value of the variable will be hidden in job logs. - Project string
- The name or path of the project.
- Protected bool
- If set to
true, the variable will be passed only to pipelines running on protected branches and tags. - Raw bool
- If set to
true, the variable will be treated as a raw string. - Value string
- The value of the variable.
- Variable
Type string - The type of the variable, either
env_varorfile.
- Description string
- The description of the variable. Maximum of 255 characters.
- Environment
Scope string - The environment scope of the variable. Defaults to all environment (
*). - Key string
- The name of the variable.
- Masked bool
- If set to
true, the value of the variable will be hidden in job logs. - Project string
- The name or path of the project.
- Protected bool
- If set to
true, the variable will be passed only to pipelines running on protected branches and tags. - Raw bool
- If set to
true, the variable will be treated as a raw string. - Value string
- The value of the variable.
- Variable
Type string - The type of the variable, either
env_varorfile.
- description String
- The description of the variable. Maximum of 255 characters.
- environment
Scope String - The environment scope of the variable. Defaults to all environment (
*). - key String
- The name of the variable.
- masked Boolean
- If set to
true, the value of the variable will be hidden in job logs. - project String
- The name or path of the project.
- protected_ Boolean
- If set to
true, the variable will be passed only to pipelines running on protected branches and tags. - raw Boolean
- If set to
true, the variable will be treated as a raw string. - value String
- The value of the variable.
- variable
Type String - The type of the variable, either
env_varorfile.
- description string
- The description of the variable. Maximum of 255 characters.
- environment
Scope string - The environment scope of the variable. Defaults to all environment (
*). - key string
- The name of the variable.
- masked boolean
- If set to
true, the value of the variable will be hidden in job logs. - project string
- The name or path of the project.
- protected boolean
- If set to
true, the variable will be passed only to pipelines running on protected branches and tags. - raw boolean
- If set to
true, the variable will be treated as a raw string. - value string
- The value of the variable.
- variable
Type string - The type of the variable, either
env_varorfile.
- description str
- The description of the variable. Maximum of 255 characters.
- environment_
scope str - The environment scope of the variable. Defaults to all environment (
*). - key str
- The name of the variable.
- masked bool
- If set to
true, the value of the variable will be hidden in job logs. - project str
- The name or path of the project.
- protected bool
- If set to
true, the variable will be passed only to pipelines running on protected branches and tags. - raw bool
- If set to
true, the variable will be treated as a raw string. - value str
- The value of the variable.
- variable_
type str - The type of the variable, either
env_varorfile.
- description String
- The description of the variable. Maximum of 255 characters.
- environment
Scope String - The environment scope of the variable. Defaults to all environment (
*). - key String
- The name of the variable.
- masked Boolean
- If set to
true, the value of the variable will be hidden in job logs. - project String
- The name or path of the project.
- protected Boolean
- If set to
true, the variable will be passed only to pipelines running on protected branches and tags. - raw Boolean
- If set to
true, the variable will be treated as a raw string. - value String
- The value of the variable.
- variable
Type String - The type of the variable, either
env_varorfile.
Package Details
- Repository
- GitLab pulumi/pulumi-gitlab
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
gitlabTerraform Provider.
Viewing docs for GitLab v9.10.0
published on Monday, Mar 9, 2026 by Pulumi
published on Monday, Mar 9, 2026 by Pulumi
