DrFaust92 / terraform-provider-bitbucket

Terraform Bitbucket Cloud provider.
https://registry.terraform.io/providers/drfaust92/bitbucket
Mozilla Public License 2.0
38 stars 30 forks source link

Error with Bitbucket Deployment and Deployment Variable Configuration in Terraform #219

Open lakmal-ya opened 1 week ago

lakmal-ya commented 1 week ago

Hi there,

I'm encountering an issue while configuring the bitbucket_deployment and bitbucket_deployment_variable resources in Terraform. Below is the code snippet I'm using:

Terraform Configuration Files

resource "bitbucket_deployment" "test" {
  repository = bitbucket_repository.devops-testing-repo.uuid
  name       = "test"
  stage      = "Test"
}
resource "bitbucket_deployment_variable" "test" {
  deployment = bitbucket_deployment.test.id
  key        = "COUNTRY"
  value      = "Kenya"
  secured    = false
}

Debug Output

bitbucket_project.devops-testing: Creating... bitbucket_project.devops-testing: Creation complete after 1s [id=abc/DEVOPS] bitbucket_repository.devops-testing-repo: Creating... ╷ │ Error: Provider produced inconsistent result after apply │ │ When applying changes to bitbucket_repository.devops-testing-repo, provider "provider[\"registry.terraform.io/drfaust92/bitbucket\"]" produced an │ unexpected new value: Root resource was present, but now absent. │ │ This is a bug in the provider, which should be reported in the provider's own issue tracker.

I'm also encountering a separate error that states: ERROR] vertex error: API Error: 400 repositories environments bitbucket.

Could you please help me identify if I'm making a mistake, or if this is an issue with the provider? Thank you!

rquadling commented 2 days ago

NOT AN EXPERT BUT ...

The following things are different for my setup.

  1. The repository name in the bitbucket_deployment resource is the name and not the UUID (in the format of workspace/project).
  2. I have a depends_on for the bitbucket_deployment_variable, so try :
    depends_on = [bitbucket_deployment.test]