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

secured bitbucket_repository_variable always updated in-place #55

Open
caleb-gosnell opened this issue Apr 25, 2020 · 2 comments
Open

Comments

@caleb-gosnell
Copy link

Terraform Version

Terraform v0.12.24

  • provider.aws v2.59.0
  • provider.bitbucket v1.2.0

Affected Resource(s)

  • bitbucket_repository_variable
    when secured = true

Terraform Configuration Files

resource "bitbucket_repository_variable" "foo" {
  repository = bitbucket_repository.test.id
  key        = "foo"
  value      = "bar" 
 secured    = true
}

Expected Behavior

I only expect the value to be updated if it is changed, not on every apply.

Actual Behavior

An execution plan has been generated and is shown below.
Resource actions are indicated with the following symbols:
  ~ update in-place

Terraform will perform the following actions:

  # bitbucket_repository_variable.foo will be updated in-place
  ~ resource "bitbucket_repository_variable" "foo" {
        id         = "foo"
        key        = "foo"
        repository = "baz/buzz"
        secured    = true
        uuid       = "{7948f751-9ab7-4b24-ab33-d80fbd99f9f5}"
      + value      = "bar"
    }

Plan: 0 to add, 1 to change, 0 to destroy.

Steps to Reproduce

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

  1. terraform apply
  2. terraform plan

Current Workaround

Avoid ever resetting the value, (opens the user up to a stale value):

resource "bitbucket_repository_variable" "foo" {
  repository = bitbucket_repository.test.id
  key        = "foo"
  value      = "bar" 
 secured    = true
  lifecycle {
    ignore_changes = [value]
  }
}
@ghost
Copy link

ghost commented May 26, 2020

Also running into this issue. Lifecycle rules fix the problem but as @caleb-sixfeetup says, creates a different problem.
The whole point of plan is to see what's going to change - makes no sense when there are dozens of false positives

@klucks83
Copy link

I too can confirm this same behavior.

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

2 participants