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

Imported consul_key_prefix resource causes force replacement #169

Closed
tmy opened this issue Dec 12, 2019 · 1 comment · Fixed by #171
Closed

Imported consul_key_prefix resource causes force replacement #169

tmy opened this issue Dec 12, 2019 · 1 comment · Fixed by #171

Comments

@tmy
Copy link

tmy commented Dec 12, 2019

Terraform Version

$ terraform -v
Terraform v0.12.18
+ provider.consul v2.6.1

(Consul version: v1.6.1)

Affected Resource(s)

  • consul_key_prefix

Terraform Configuration Files

resource "consul_key_prefix" "foo" {
  path_prefix = "foo/"

  subkeys = {
    bar = "Bar"
    baz = "Baz"
  }
}

Steps to Reproduce

$ consul kv put foo/bar Bar
$ consul kv put foo/baz Baz
$ terraform import consul_key_prefix.foo foo/
consul_key_prefix.foo: Importing from ID "foo/"...
consul_key_prefix.foo: Import prepared!
  Prepared consul_key_prefix for import
consul_key_prefix.foo: Refreshing state... [id=foo/]

Import successful!
$ terraform plan

Expected Behavior

No changes

Actual Behavior

consul_key_prefix.foo: Refreshing state... [id=foo/]

------------------------------------------------------------------------

An execution plan has been generated and is shown below.
Resource actions are indicated with the following symbols:
-/+ destroy and then create replacement

Terraform will perform the following actions:

  # consul_key_prefix.foo must be replaced
-/+ resource "consul_key_prefix" "foo" {
      ~ datacenter  = "dc1" -> (known after apply)
      ~ id          = "foo/" -> (known after apply)
      + path_prefix = "foo/" # forces replacement
        subkeys     = {
            "bar" = "Bar"
            "baz" = "Baz"
        }
    }

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

------------------------------------------------------------------------
remilapeyre pushed a commit to remilapeyre/terraform-provider-consul that referenced this issue Dec 16, 2019
@remilapeyre
Copy link
Contributor

Thanks for reporting this issue @tmy, #171 should fix this :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants