Terraform v0.12.28
provider.azuredevops 0.0.1
azuredevops_git_repositoryprovider "azuredevops" {
version = ">= 0.0.1"
}
data "azuredevops_project" "test" {
project_name = "Test Project"
}
resource "azuredevops_git_repository" "repo" {
project_id = data.azuredevops_project.test.id
name = "test-repo"
initialization {
init_type = "Clean"
}
}
resource "azuredevops_git_repository" "fork-repo" {
project_id = data.azuredevops_project.test.id
name = "fork-test-repo"
parent_id = azuredevops_git_repository.repo.id
}
https://gist.github.com/patr00n/f2f7e1057d90d70b411c02148d12ef03
New repo was created
Error
terraform planHi @patr00n Thanks for your feed back. You can change you config like this :
provider "azuredevops" {
version = ">= 0.0.1"
}
data "azuredevops_project" "test" {
project_name = "Test Project"
}
resource "azuredevops_git_repository" "repo" {
project_id = data.azuredevops_project.test.id
name = "test-repo"
initialization {
init_type = "Clean"
}
}
resource "azuredevops_git_repository" "fork-repo" {
project_id = data.azuredevops_project.test.id
name = "fork-test-repo"
parent_repository_id = azuredevops_git_repository.repo.id
initialization {
init_type = "Clean"
}
}
parent_id is not a valid configure in azuredevops_git_repository.
Attention
You need specify the initialization configuration in azuredevops_git_repository, otherwise Terraform may crash. This is a know issue in azuredevops, we will fix this soon.
Thanks for your quick reply!
It works with parent_repository_id. But documentation says parent_id. It would be nice to fix.
I've fixed the docs here: https://github.com/terraform-providers/terraform-provider-azuredevops/pull/55
Most helpful comment
I've fixed the docs here: https://github.com/terraform-providers/terraform-provider-azuredevops/pull/55