Project Variable
The gitlab.ProjectVariable resource allows creating and managing a GitLab project level variable. Upstream API: GitLab REST API docs
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as gitlab from "@pulumi/gitlab";
const example = new gitlab.ProjectVariable("example", {
project: "12345",
key: "project_variable_key",
value: "project_variable_value",
"protected": false,
});import pulumi
import pulumi_gitlab as gitlab
example = gitlab.ProjectVariable("example",
project="12345",
key="project_variable_key",
value="project_variable_value",
protected=False)using System.Collections.Generic;
using System.Linq;
using Pulumi;
using GitLab = Pulumi.GitLab;
return await Deployment.RunAsync(() =>
{
var example = new GitLab.ProjectVariable("example", new()
{
Project = "12345",
Key = "project_variable_key",
Value = "project_variable_value",
Protected = false,
});
});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.NewProjectVariable(ctx, "example", &gitlab.ProjectVariableArgs{
Project: pulumi.String("12345"),
Key: pulumi.String("project_variable_key"),
Value: pulumi.String("project_variable_value"),
Protected: pulumi.Bool(false),
})
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.ProjectVariable;
import com.pulumi.gitlab.ProjectVariableArgs;
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) {
var example = new ProjectVariable("example", ProjectVariableArgs.builder()
.project("12345")
.key("project_variable_key")
.value("project_variable_value")
.protected_(false)
.build());
}
}resources:
example:
type: gitlab:ProjectVariable
properties:
project: '12345'
key: project_variable_key
value: project_variable_value
protected: falseImport
Starting in Terraform v1.5.0 you can use an import block to import gitlab_project_variable. For example: terraform import { to = gitlab_project_variable.example id = "see CLI command below for ID" } Import using the CLI is supported using the following syntax: GitLab project variables can be imported using an id made up of project:key:environment_scope, e.g.
$ pulumi import gitlab:index/projectVariable:ProjectVariable example '12345:project_variable_key:*'Properties
The description of the variable.
The environment scope of the variable. Defaults to all environment (*). Note that in Community Editions of Gitlab, values other than * will cause inconsistent plans.
If set to true, the value of the variable will be hidden in the CI/CD User Interface. The value must meet the hidden requirements.
If set to true, the value of the variable will be masked in job logs. The value must meet the masking requirements.
The type of a variable. Valid values are: env_var, file.