Class 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",
});
}
}
Inherited Members
Namespace: Pulumi.GitLab
Assembly: Pulumi.GitLab.dll
Syntax
public class ProjectVariable : CustomResource
Constructors
View SourceProjectVariable(String, ProjectVariableArgs, CustomResourceOptions)
Create a ProjectVariable resource with the given unique name, arguments, and options.
Declaration
public ProjectVariable(string name, ProjectVariableArgs args, CustomResourceOptions options = null)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | name | The unique name of the resource |
| ProjectVariableArgs | args | The arguments used to populate this resource's properties |
| CustomResourceOptions | options | A bag of options that control this resource's behavior |
Properties
View SourceEnvironmentScope
The environment_scope of the variable
Declaration
public Output<string> EnvironmentScope { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
Key
The name of the variable.
Declaration
public Output<string> Key { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
Masked
If set to true, the variable will be masked if it would have been written to the logs. Defaults to false.
Declaration
public Output<bool?> Masked { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.Nullable<System.Boolean>> |
Project
The name or id of the project to add the hook to.
Declaration
public Output<string> Project { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
Protected
If set to true, the variable will be passed only to pipelines running on protected branches and tags. Defaults to false.
Declaration
public Output<bool?> Protected { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.Nullable<System.Boolean>> |
Value
The value of the variable.
Declaration
public Output<string> Value { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
VariableType
The type of a variable. Available types are: env_var (default) and file.
Declaration
public Output<string> VariableType { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
Methods
View SourceGet(String, Input<String>, ProjectVariableState, CustomResourceOptions)
Get an existing ProjectVariable resource's state with the given name, ID, and optional extra properties used to qualify the lookup.
Declaration
public static ProjectVariable Get(string name, Input<string> id, ProjectVariableState state = null, CustomResourceOptions options = null)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | name | The unique name of the resulting resource. |
| Input<System.String> | id | The unique provider ID of the resource to lookup. |
| ProjectVariableState | state | Any extra arguments used during the lookup. |
| CustomResourceOptions | options | A bag of options that control this resource's behavior |
Returns
| Type | Description |
|---|---|
| ProjectVariable |