Skip to content
This repository has been archived by the owner on Dec 8, 2020. It is now read-only.

Importing bitbucket_repository results in 400 during plan #23

Open
four43 opened this issue Jun 28, 2018 · 0 comments
Open

Importing bitbucket_repository results in 400 during plan #23

four43 opened this issue Jun 28, 2018 · 0 comments

Comments

@four43
Copy link

four43 commented Jun 28, 2018

Hey all,

I seem to be getting 400 status codes when accessing an existing repository that was imported to this state.

Terraform Version

Terraform v0.11.7
+ provider.aws v1.25.0
+ provider.bitbucket v1.0.0
+ provider.external v1.0.0
+ provider.local v1.1.0
+ provider.random v1.3.1
+ provider.template v1.0.0

Affected Resource(s)

Please list the resources as a list, for example:

  • bitbucket_repository

Terraform Configuration Files

resource "bitbucket_repository" "project_repo" {
  owner = "myaccount"
  name = "my-project"
  project_key = "api"
  scm = "git"
  is_private = true
  fork_policy = "no_public_forks"

  lifecycle {
    prevent_destroy = true
  }
}

Debug Output

Expected Behavior

Resource was imported via terraform import bitbucket_repository.project_repo myaccount/my-project, minor updates are planned:

~ bitbucket_repository.project_repo
      has_issues:                "true" => "false"
      has_wiki:                  "true" => "false"
      language:                  "php" => ""
      project_key:               "PROJ" => "api"

Actual Behavior

Running apply produced:

Error: Error applying plan:

1 error(s) occurred:

* bitbucket_repository.project_repo: 1 error(s) occurred:

* bitbucket_repository.project_repo: API Error: 400 2.0/repositories/hamweather/aeris-api Bad request

Steps to Reproduce

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

  1. terraform import bitbucket_repository.project_repo myaccount/my-project
  2. terraform apply

This seems pretty reproducible. I didn't include the debug log (cause I'm lazy), but if that's actually necessary and it's hard to reproduce I can. Thanks all.

@four43 four43 changed the title Importing bitbucket_repository imports incorrect project_key Importing bitbucket_repository results in 400 during plan Jun 28, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant