hashicorp / terraform-provider-bitbucket

This Terraform provider is archived per our provider archiving process: https://terraform.io/docs/internals/archiving.html
https://registry.terraform.io
Mozilla Public License 2.0
31 stars 106 forks source link

secured bitbucket_repository_variable always updated in-place #55

Open caleb-gosnell opened 4 years ago

caleb-gosnell commented 4 years ago

Terraform Version

Terraform v0.12.24

Affected Resource(s)

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 commented 4 years ago

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 commented 3 years ago

I too can confirm this same behavior.