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

Field of type 'DATE' updates item even if there were no changes #137

Closed bloudraak closed 4 months ago

bloudraak commented 5 months ago

Your environment

Terraform Provider Version: 1.4.0

Connect Server Version: N/A

CLI Version: 2.24.0

OS: macOS 14.2.1 (23C71) ARM

Terraform Version: Terraform v1.5.7 on darwin_arm64

What happened?

If you have a field of type DATE, running terraform apply multiple times, even when nothing has changed, causes the item to be updated.

What did you expect to happen?

The item should not be updated if nothing changes between two subsequent terraform apply.

Steps to reproduce

The following Terraform code reproduces the issue in my environment. Note the date is hardcoded. Also, note that I'm using a service token to authenticate.

data "onepassword_vault" "vault" {
  name = "Example"
}

resource "onepassword_item" "item" {
  vault = data.onepassword_vault.vault.uuid
  title = "Item 2"
  section {
    label = "Section 1"
    field {
      label = "text"
      type = "DATE"
      value = "2023-10-10"
    }
  }
}

Notes & Logs

N/A

volodymyrZotov commented 5 months ago

@bloudraak Thank you for raising this! That definitely should be fixed. Stay tuned for the upcoming releases.

Meanwhile, if you want to help and have time, you're welcome to contribute and create a PR with the fix! 😃 Here are our CONTRIBUTING.md instructions.