» gitlab_project_variable
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
resource "gitlab_project_variable" "example" {
project = "12345"
key = "project_variable_key"
value = "project_variable_value"
protected = false
}
» Argument Reference
The following arguments are supported:
-
project
- (Required, string) The name or id of the project to add the hook to. -
key
- (Required, string) The name of the variable. -
value
- (Required, string) The value of the variable. -
protected
- (Optional, boolean) If set totrue
, the variable will be passed only to pipelines running on protected branches and tags. Defaults tofalse
.
» Import
GitLab project variables can be imported using an id made up of projectid:variablename
, e.g.
$ terraform import gitlab_project_variable.example 12345:project_variable_key