microsoft / terraform-provider-azuredevops

Terraform Azure DevOps provider
https://www.terraform.io/docs/providers/azuredevops/
MIT License
387 stars 281 forks source link

azuredevops_variable_group doesn't allow for no variables as documented. #431

Open derekwilliamsliquidx opened 3 years ago

derekwilliamsliquidx commented 3 years ago

Community Note

Terraform (and Azure DevOps Provider) Version

Affected Resource(s)

Terraform Configuration Files

resource "azuredevops_variable_group" "variablegroup" {
  count        = length(local.workspace["variable_groups"])
  project_id   = azuredevops_project.project.id
  name         = "${local.workspace["project_name"]}-${local.workspace["variable_groups"][count.index]}"
  description  = "Generic environment based variable Group"
  allow_access = true

}

Debug Output

Not adding for security reasons

Panic Output

Expected Behavior

Variable group is created without any variables added

Actual Behavior

╷ │ Error: Insufficient variable blocks │ │ on ado_variable_group.tf line 1, in resource "azuredevops_variable_group" "variablegroup": │ 1: resource "azuredevops_variable_group" "variablegroup" { │ │ At least 1 "variable" blocks are required.

Steps to Reproduce

  1. terraform plan

Important Factoids

References

derekwilliamsliquidx commented 3 years ago

I have a feature branch to update the docs and mark variable block as optional. I'm unable to push a feature branch though.

xuzhang3 commented 3 years ago

@derekwilliamsliquidx You can submit a pull request to this repo.

image