Project Variable
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
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());
}
}Content copied to clipboard
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:*'Content copied to clipboard
Properties
Link copied to clipboard
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.