ProjectVariableArgs

data class ProjectVariableArgs(val description: Output<String>? = null, val environmentScope: Output<String>? = null, val key: Output<String>? = null, val masked: Output<Boolean>? = null, val project: Output<String>? = null, val protected: Output<Boolean>? = null, val raw: Output<Boolean>? = null, val value: Output<String>? = null, val variableType: Output<String>? = null) : ConvertibleToJava<ProjectVariableArgs>

The gitlab.ProjectVariable resource allows to manage the lifecycle of a CI/CD variable for a project.

Important: If your GitLab version is older than 13.4, you may see nondeterministic behavior when updating or deleting gitlab.ProjectVariable resources with non-unique keys, for example if there is another variable with the same key and different environment scope. See this GitLab issue. 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", {
key: "project_variable_key",
project: "12345",
"protected": false,
value: "project_variable_value",
});
import pulumi
import pulumi_gitlab as gitlab
example = gitlab.ProjectVariable("example",
key="project_variable_key",
project="12345",
protected=False,
value="project_variable_value")
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using GitLab = Pulumi.GitLab;
return await Deployment.RunAsync(() =>
{
var example = new GitLab.ProjectVariable("example", new()
{
Key = "project_variable_key",
Project = "12345",
Protected = false,
Value = "project_variable_value",
});
});
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.NewProjectVariable(ctx, "example", &gitlab.ProjectVariableArgs{
Key: pulumi.String("project_variable_key"),
Project: pulumi.String("12345"),
Protected: pulumi.Bool(false),
Value: pulumi.String("project_variable_value"),
})
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()
.key("project_variable_key")
.project("12345")
.protected_(false)
.value("project_variable_value")
.build());
}
}
resources:
example:
type: gitlab:ProjectVariable
properties:
key: project_variable_key
project: '12345'
protected: false
value: project_variable_value

Import

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:*'

Constructors

Link copied to clipboard
constructor(description: Output<String>? = null, environmentScope: Output<String>? = null, key: Output<String>? = null, masked: Output<Boolean>? = null, project: Output<String>? = null, protected: Output<Boolean>? = null, raw: Output<Boolean>? = null, value: Output<String>? = null, variableType: Output<String>? = null)

Properties

Link copied to clipboard
val description: Output<String>? = null

The description of the variable.

Link copied to clipboard
val environmentScope: Output<String>? = null

The environment scope of the variable. Defaults to all environment (*). Note that in Community Editions of Gitlab, values other than * will cause inconsistent plans.

Link copied to clipboard
val key: Output<String>? = null

The name of the variable.

Link copied to clipboard
val masked: Output<Boolean>? = null

If set to true, the value of the variable will be hidden in job logs. The value must meet the masking requirements. Defaults to false.

Link copied to clipboard
val project: Output<String>? = null

The name or id of the project.

Link copied to clipboard
val protected: Output<Boolean>? = null

If set to true, the variable will be passed only to pipelines running on protected branches and tags. Defaults to false.

Link copied to clipboard
val raw: Output<Boolean>? = null

Whether the variable is treated as a raw string. Default: false. When true, variables in the value are not expanded.

Link copied to clipboard
val value: Output<String>? = null

The value of the variable.

Link copied to clipboard
val variableType: Output<String>? = null

The type of a variable. Valid values are: env_var, file. Default is env_var.

Functions

Link copied to clipboard
open override fun toJava(): ProjectVariableArgs