Skip to content

Latest commit

 

History

History
76 lines (56 loc) · 2.49 KB

variable_group.html.markdown

File metadata and controls

76 lines (56 loc) · 2.49 KB
layout page_title description
azuredevops
AzureDevops: azuredevops_variable_group
Manages variable groups within Azure DevOps project.

azuredevops_variable_group

Manages variable groups within Azure DevOps.

Example Usage

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
  }
}

Argument Reference

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 more variable 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.
  • is_secret - (Optional) A boolean flag describing if the variable value is sensitive. Defaults to false.

Attributes Reference

In addition to all arguments above, the following attributes are exported:

  • id - The ID of the Variable Group returned after creation in Azure DevOps.

Relevant Links

Import

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/10

Note that for secret variables, the import command retrieve blank value in the tfstate.

PAT Permissions Required

  • Variable Groups: Read, Create, & Manage