layout | page_title | description |
---|---|---|
azuredevops |
AzureDevops: azuredevops_variable_group |
Manages variable groups within Azure DevOps project. |
Manages variable groups within Azure DevOps.
resource "azuredevops_project" "project" {
name = "Test Project"
}
resource "azuredevops_variable_group" "variablegroup" {
project_id = azuredevops_project.project.id
name = "Test Variable Group"
description = "Test Variable Group Description"
allow_access = true
variable {
name = "key"
value = "value"
}
variable {
name = "Account Password"
secret_value = "p@ssword123"
is_secret = true
}
}
The following arguments are supported:
project_id
- (Required) The project ID or project name.name
- (Required) The name of the Variable Group.description
- (Optional) The description of the Variable Group.allow_access
- (Required) Boolean that indicate if this variable group is shared by all pipelines of this project.variable
- (Optional) One or morevariable
blocks as documented below.
A variable
block supports the following:
name
- (Required) The key value used for the variable. Must be unique within the Variable Group.value
- (Optional) The value of the variable. If omitted, it will default to empty string.secret_value
- (Optional) The secret value of the variable. If omitted, it will default to empty string. Used whenis_secret
set totrue
.is_secret
- (Optional) A boolean flag describing if the variable value is sensitive. Defaults tofalse
.
In addition to all arguments above, the following attributes are exported:
id
- The ID of the Variable Group returned after creation in Azure DevOps.
- Azure DevOps Service REST API 5.1 - Variable Groups
- Azure DevOps Service REST API 5.1 - Authorized Resources
Variable groups containing secret values cannot be imported.
Azure DevOps Variable groups can be imported using the project name/variable group ID or by the project Guid/variable group ID, e.g.
$ terraform import azuredevops_variable_group.variablegroup "Test Project/10"
or
$ terraform import azuredevops_variable_group.variablegroup 00000000-0000-0000-0000-000000000000/0
Note that for secret variables, the import command retrieve blank value in the tfstate.
- Variable Groups: Read, Create, & Manage