microsoft / terraform-provider-azuredevops

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

Failure Forking a Repo #116

Open lfmundim opened 4 years ago

lfmundim commented 4 years ago

Community Note

Terraform (and Azure DevOps Provider) Version

Terraform v0.12.28
+ provider.azuredevops v0.0.1

Affected Resource(s)

Terraform Configuration Files

provider "azuredevops" {
  version = ">= 0.0.1"
}

resource "azuredevops_git_repository" "repo" {
  project_id = "project-guid"
  name       = "bananinha"
  parent_id  = "original-repo-guid"
}

resource "azuredevops_build_definition" "build" {
  project_id = "project-guid"
  name       = "bananinha - CI"

  repository {
    repo_type   = "TfsGit"
    repo_id   = azuredevops_git_repository.repo.id
    branch_name = azuredevops_git_repository.repo.default_branch
    yml_path    = "build_definition.yml"
  }
}

Debug Output

None was found

Expected Behavior

Repo && CI should've been created

Actual Behavior

Error: Unsupported argument

  on new_repo.tf line 8, in resource "azuredevops_git_repository" "repo":
   8:   parent_id  = "original-repo-guid"

An argument named "parent_id" is not expected here.

Steps to Reproduce

  1. terraform init
  2. terraform plan

References

xuzhang3 commented 4 years ago

Hi @lfmundim Replace parent_id with parent_repository_id, this is a document error. Since we have not release the new version. The documentation on the official Terraform website will not be updated,, you can get the latest document here.

lfmundim commented 4 years ago

After changing parent_id to parent_repository_id, terraform plan runs well, but terraform apply crashes

The repo is forked, but the build definition is not created

xuzhang3 commented 4 years ago

@lfmundim This is a know issue, if azuredevops_git_repository lacks initialization configuration, terraform will crash during the apply phase.