1Password / terraform-provider-onepassword

Use the 1Password Terraform Provider to reference, create, or update items in your 1Password Vaults.
https://developer.1password.com/docs/terraform/
MIT License
324 stars 48 forks source link

Feature Request: Support RFC3339 as input for fields of type DATE and MONTH_YEAR #135

Open bloudraak opened 10 months ago

bloudraak commented 10 months ago

Summary

A majority of systems use RFC3339 date formats (for example, 2024-04-13T03:43:11Z) to exchange data with each other. When creating a field of type DATE or MONTH_YEAR, support the ability to parse values using the RFC3339 format. Data loss would be acceptable.

Use cases

Proposed solution

Is there a workaround to accomplish this today?

Within Terraform, one can use (formatdate)[https://developer.hashicorp.com/terraform/language/functions/formatdate] to achieve this. However, this causes the onepassword_item to be modified even when nothing has changed. This causes other challenges for resources dependent upon onepassword_item.

field {
      id = "certificate_not_before"
      label = "Expires"
      type = "DATE"
      value = formatdate("YYYY-MM-DD", acme_certificate.certificate.certificate_not_after)
    }

The value being:

# Returns "2024-04-13T03:43:11Z"
output "certificate" {
  value = acme_certificate.certificate.certificate_not_after
}

References & Prior Work

volodymyrZotov commented 10 months ago

Thanks for raising!👍 We'll consider this for future releases!