| layout | azuredevops |
|---|---|
| page_title | AzureDevops: azuredevops_variable_group |
| description | Manages variable groups within Azure DevOps project. |
Manages variable groups within Azure DevOps.
resource "azuredevops_project" "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"
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 morevariableblocks 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.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
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 782a8123-1019-xxxx-xxxx-xxxxxxxx/10Note that for secret variables, the import command retrieve blank value in the tfstate.
- Variable Groups: Read, Create, & Manage