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 version 18.3
Azure DevOps Provider version 1.0.1
Affected Resource(s)
azuredevops_check_exclusive_lock
Terraform Configuration Files
data "azuredevops_project" "test" {
name = "MY_TEST_PROJECT"
}
data "azuredevops_git_repository" "test_repo" {
project_id = data.azuredevops_project.test.id
name = "my.test.repo"
}
resource "azuredevops_check_exclusive_lock" "azdo_repo_lock" {
project_id = data.azuredevops_project.test.id
target_resource_id = data.azuredevops_git_repository.test_repo.id
target_resource_type = "repository"
timeout = 30
}
Expected Behavior
An exclusive lock created on the repo
Actual Behavior
β·
β Error: failed creating check, project ID: 8d49xxxx-xxxx-xxxx-xxxx-xxxx6745xxxx. Error: Invalid resource id. 5310xxxx-xxxx-xxxx-xxxx-xxxxd0b8xxxx
β
β with azuredevops_check_exclusive_lock.azdo_repo_lock,
β on main.tf line 1, in resource "azuredevops_check_exclusive_lock" "azdo_repo_lock":
β 1: resource "azuredevops_check_exclusive_lock" "azdo_repo_lock" {
β
β΅
FAIL
Steps to Reproduce
terraform apply
Workaround / RCA
I captured the network communication when creating this lock on the UI. The payload has "id" as "{projectID}.{repoID}" instead of just "{repoID}", i.e.
But I wish I could just use the expected ${data.azuredevops_git_repository.test_repo.id} or have the documentation letting me know that I have to prefix the project ID here.
@liyaoz the resource ID has changed, add the check exclusive for repo requires the resource ID in projectID.repoId format. The ID format is required by service not this provider.
Community Note
Terraform (and Azure DevOps Provider) Version
Terraform version 18.3 Azure DevOps Provider version 1.0.1
Affected Resource(s)
azuredevops_check_exclusive_lock
Terraform Configuration Files
Expected Behavior
An exclusive lock created on the repo
Actual Behavior
Steps to Reproduce
terraform apply
Workaround / RCA
I captured the network communication when creating this lock on the UI. The payload has
"id"
as"{projectID}.{repoID}"
instead of just"{repoID}"
, i.e.So I have this workaround in my Terraform configuration, and it is working for now:
But I wish I could just use the expected
${data.azuredevops_git_repository.test_repo.id}
or have the documentation letting me know that I have to prefix the project ID here.Thanks!
References
azuredevops/check_exclusive_lock