terraform-provider-azuredevops: Error when refreshing the state of `azuredevops_build_definition`

Community Note

  • Please vote on this issue by adding a πŸ‘ reaction to the original issue to help the community and maintainers prioritize this request
  • Please do not leave β€œ+1” or β€œme too” comments, they generate extra noise for issue followers and do not help prioritize the request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment

Terraform (and Azure DevOps Provider) Version

terraform -v 0.12.24 azuredevops 0.0.1

Affected Resource(s)

  • azuredevops_build_definition

Terraform Configuration Files

resource "azuredevops_build_definition" "azure_iac" {
  project_id      = azuredevops_project.module.id
  name            = "${var.workload}-azure-iac"
  path            = "\\"
  agent_pool_name = var.agent_pool_name

  ci_trigger {
    use_yaml = true
  }

  pull_request_trigger {
    use_yaml = true

    forks {
      enabled       = false
      share_secrets = false
    }
  }

  repository {
    repo_id               = "${bitbucket_repository.module.owner}/${bitbucket_repository.module.name}"
    repo_type             = "Bitbucket"
    branch_name           = "master"
    service_connection_id = azuredevops_serviceendpoint_bitbucket.bitbucket.id
    yml_path              = "/azure-pipeline.yml"
  }

  variable {
    name      = "connectionName"
    value     = azuredevops_serviceendpoint_azurerm.azure_iac.service_endpoint_name
    is_secret = false
  }

  variable {
    name      = "servicePrincipalId"
    value     = azuread_application.module.application_id
    is_secret = false
  }

  variable {
    name         = "servicePrincipalKey"
    secret_value = random_password.module.result
    is_secret    = true
  }

  variable {
    name      = "tenantId"
    value     = var.tenant_id
    is_secret = false
  }

  variable {
    name      = "subscriptionId"
    value     = var.subscription_id
    is_secret = false
  }

  dynamic "variable" {
    for_each = contains(var.additional_variables, "TF_VAR_bitbucket_username") ? [1] : []

    content {
      name      = "TF_VAR_bitbucket_username"
      value     = var.bitbucket_username
      is_secret = false
    }
  }

  dynamic "variable" {
    for_each = contains(var.additional_variables, "TF_VAR_bitbucket_secret") ? [1] : []

    content {
      name         = "TF_VAR_bitbucket_secret"
      secret_value = var.bitbucket_secret
      is_secret    = true
    }
  }
}

Debug Output

Panic Output

https://gist.github.com/edwardwu-servian/e30615e48e86b60a5bc7ad0fec2a10de

Expected Behavior

This resource has been applied previously. Plan should successfully complete without any change.

Actual Behavior

Plan failed with output

Error: rpc error: code = Unavailable desc = transport is closing



Error: rpc error: code = Unavailable desc = transport is closing

Steps to Reproduce

  1. terraform plan

Important Factoids

References

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Comments: 16 (2 by maintainers)

Most upvoted comments

yeah it makes sense. was just hoping the backend could handle this in a more delicate manner. thanks again!

I have submit a PR for this issue.

@xuzhang3 thanks. we’ve decided to remove agent_pool_name since it is an optional input and leverage the pipeline yaml to explicitly specify the agent pool.