1Password / terraform-provider-onepassword

Use the 1Password Terraform Provider to reference, create, or update items in your 1Password Vaults.
https://1password.com/secrets
MIT License
314 stars 41 forks source link

If I use the vault name when defining an item, and rerun terraform, it wants to recreate the item as it has a diff with the vault name versus vault UUID #154

Closed scott-doyland-burrows closed 2 months ago

scott-doyland-burrows commented 4 months ago

Terraform 1.7.4 Provider 1.4.2 OnePassword CLI 2.25.0

I use this code:

resource "onepassword_item" "item" {

  vault = "example-vault"

  category = "login"
  username = "mylogin"
  password = "mypassword
}

This works, but when I rerun an apply it says the resource must be replaced and shows this as a diff.

~ vault = "khubz3ahotlrg2ze2xveqkijhy" -> "example-vault" # forces replacement

To fix this I must use the vault UUID rather than the vault name when creating the resource.

I should be able to use the vault name OR the vault UUID and not get a diff.

edif2008 commented 2 months ago

Closing this as a duplicate of #131.