ProjectVariable

This resource allows you to create and manage CI/CD variables for your GitLab projects. For further information on variables, consult the gitlab documentation.

Example Usage

using Pulumi;
using GitLab = Pulumi.GitLab;

class MyStack : Stack
{
    public MyStack()
    {
        var example = new GitLab.ProjectVariable("example", new GitLab.ProjectVariableArgs
        {
            Key = "project_variable_key",
            Project = "12345",
            Protected = false,
            Value = "project_variable_value",
        });
    }

}

Coming soon!

import pulumi
import pulumi_gitlab as gitlab

example = gitlab.ProjectVariable("example",
    key="project_variable_key",
    project="12345",
    protected=False,
    value="project_variable_value")
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",
});

Create a ProjectVariable Resource

def ProjectVariable(resource_name, opts=None, environment_scope=None, key=None, masked=None, project=None, protected=None, value=None, variable_type=None, __props__=None);
name string
The unique name of the resource.
args ProjectVariableArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
resource_name str
The unique name of the resource.
opts ResourceOptions
A bag of options that control this resource's behavior.
ctx Context
Context object for the current deployment.
name string
The unique name of the resource.
args ProjectVariableArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name string
The unique name of the resource.
args ProjectVariableArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.

ProjectVariable Resource Properties

To learn more about resource properties and how to use them, see Inputs and Outputs in the Programming Model docs.

Inputs

The ProjectVariable resource accepts the following input properties:

Key string

The name of the variable.

Project string

The name or id of the project to add the hook to.

Value string

The value of the variable.

EnvironmentScope string

The environment_scope of the variable

Masked bool

If set to true, the variable will be masked if it would have been written to the logs. Defaults to false.

Protected bool

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

VariableType string

The type of a variable. Available types are: env_var (default) and file.

Key string

The name of the variable.

Project string

The name or id of the project to add the hook to.

Value string

The value of the variable.

EnvironmentScope string

The environment_scope of the variable

Masked bool

If set to true, the variable will be masked if it would have been written to the logs. Defaults to false.

Protected bool

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

VariableType string

The type of a variable. Available types are: env_var (default) and file.

key string

The name of the variable.

project string

The name or id of the project to add the hook to.

value string

The value of the variable.

environmentScope string

The environment_scope of the variable

masked boolean

If set to true, the variable will be masked if it would have been written to the logs. Defaults to false.

protected boolean

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

variableType string

The type of a variable. Available types are: env_var (default) and file.

key str

The name of the variable.

project str

The name or id of the project to add the hook to.

value str

The value of the variable.

environment_scope str

The environment_scope of the variable

masked bool

If set to true, the variable will be masked if it would have been written to the logs. Defaults to false.

protected bool

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

variable_type str

The type of a variable. Available types are: env_var (default) and file.

Outputs

All input properties are implicitly available as output properties. Additionally, the ProjectVariable resource produces the following output properties:

Id string
The provider-assigned unique ID for this managed resource.
Id string
The provider-assigned unique ID for this managed resource.
id string
The provider-assigned unique ID for this managed resource.
id str
The provider-assigned unique ID for this managed resource.

Look up an Existing ProjectVariable Resource

Get an existing ProjectVariable resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

public static get(name: string, id: Input<ID>, state?: ProjectVariableState, opts?: CustomResourceOptions): ProjectVariable
static get(resource_name, id, opts=None, environment_scope=None, key=None, masked=None, project=None, protected=None, value=None, variable_type=None, __props__=None);
func GetProjectVariable(ctx *Context, name string, id IDInput, state *ProjectVariableState, opts ...ResourceOption) (*ProjectVariable, error)
public static ProjectVariable Get(string name, Input<string> id, ProjectVariableState? state, CustomResourceOptions? opts = null)
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
resource_name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.

The following state arguments are supported:

EnvironmentScope string

The environment_scope of the variable

Key string

The name of the variable.

Masked bool

If set to true, the variable will be masked if it would have been written to the logs. Defaults to false.

Project string

The name or id of the project to add the hook to.

Protected bool

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

Value string

The value of the variable.

VariableType string

The type of a variable. Available types are: env_var (default) and file.

EnvironmentScope string

The environment_scope of the variable

Key string

The name of the variable.

Masked bool

If set to true, the variable will be masked if it would have been written to the logs. Defaults to false.

Project string

The name or id of the project to add the hook to.

Protected bool

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

Value string

The value of the variable.

VariableType string

The type of a variable. Available types are: env_var (default) and file.

environmentScope string

The environment_scope of the variable

key string

The name of the variable.

masked boolean

If set to true, the variable will be masked if it would have been written to the logs. Defaults to false.

project string

The name or id of the project to add the hook to.

protected boolean

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

value string

The value of the variable.

variableType string

The type of a variable. Available types are: env_var (default) and file.

environment_scope str

The environment_scope of the variable

key str

The name of the variable.

masked bool

If set to true, the variable will be masked if it would have been written to the logs. Defaults to false.

project str

The name or id of the project to add the hook to.

protected bool

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

value str

The value of the variable.

variable_type str

The type of a variable. Available types are: env_var (default) and file.

Package Details

Repository
https://github.com/pulumi/pulumi-gitlab
License
Apache-2.0
Notes
This Pulumi package is based on the gitlab Terraform Provider.