Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue with renaming Bitbucket_repository #96

Closed
tbpoetke opened this issue Nov 8, 2022 · 2 comments · Fixed by #206
Closed

Issue with renaming Bitbucket_repository #96

tbpoetke opened this issue Nov 8, 2022 · 2 comments · Fixed by #206
Labels
bug Something isn't working

Comments

@tbpoetke
Copy link

tbpoetke commented Nov 8, 2022

Hi there,
I have an Issue when I try to rename (update-in-place) a bitbucket repository.
In this example I want to rename the Repositry from "Project-Infrastructure" to "Project-Core"
Terraform is creating the updated repository, but is failing afterwards, because it wants to enable the pipeline for the old name of the repository.
It seems like the order, the plugin is doing this, is wrong.

Terraform Version

1.2.6

Affected Resource(s)

  • bitbucket_repository

Terraform Configuration Files

resource "bitbucket_repository" "project" {
  owner             = "company-projects"
  name              = "Project-Infrastructure"
  project_key       = var.project_key
  pipelines_enabled = true
  lifecycle {
    prevent_destroy = true
  }
}

changed to:

resource "bitbucket_repository" "project" {
  owner             = "company-projects"
  name              = "Project-Core"
  project_key       = var.project_key
  pipelines_enabled = true
  lifecycle {
    prevent_destroy = true
  }
}

Panic Output

│ Error: error enabling pipeline for repository (Project-infrastructure): 404 Not Found
│ 
│   with module.nostalgicart.bitbucket_repository.project[0],
│   on modules/account/main.tf line 109, in resource "bitbucket_repository" "project":
│  109: resource "bitbucket_repository" "project" {

Expected Behavior

When I change the value of "Name", the repository should be renamed

Actual Behavior

Terraform is failing, because its trying to enable pippeline for the old repository name, which is already deleted by terraform in the same run

Steps to Reproduce

Please list the steps required to reproduce the issue, for example:

  1. change the name of the repository with pipeline enabled
  2. terraform apply
@DrFaust92
Copy link
Owner

i can reproduce this, checking

@barrywhart
Copy link

I have a fix for this: #206.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
3 participants