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
Passing data from other resources (e.g., acme_certificate) in Terraform, indicating the expiration date.
Proposed solution
Update the implementation to detect whether the value is in RFC3339 format, and if so, convert it to the appropriate format that 1Password understands.
Update documentation to reflect input requirements so we don't have to go on a wild goose chase. The current documentation around fields and their format doesn't reference the API docs, which causes some churn when we run into errors.
Provide additional examples demonstrating how dates are handled in the provider.
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
}
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 typeDATE
orMONTH_YEAR
, support the ability to parse values using the RFC3339 format. Data loss would be acceptable.Use cases
acme_certificate
) in Terraform, indicating the expiration date.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 upononepassword_item
.The value being:
References & Prior Work