equinix / terraform-provider-metal

DEPRECATED Equinix Metal standalone TF provider. Use the unified Equinix Terraform Provider.
https://registry.terraform.io/providers/equinix/equinix/latest/docs/guides/migration_guide_equinix_metal
Mozilla Public License 2.0
14 stars 11 forks source link

metal_connection can not import null expires_at #226

Closed ocobles closed 2 years ago

ocobles commented 2 years ago

Bug reported in terraform-provider-equinix. Datasource metal_connection here must be fixed as well.

https://github.com/equinix/terraform-provider-equinix/issues/147

From @tchan2:

It seems like terraform is not expecting expires_at to be null for service tokens, but when a service token is redeemed and activated, expires_at will turn to null as there will no longer be an expiration date on the token.

terraform import equinix_metal_connection.connect_foo {uuid}
equinix_metal_connection.connect_foo: Importing from ID "{uuid}"...
equinix_metal_connection.connect_foo Import prepared!
 Prepared equinix_metal_connection for import
equinix_metal_connection.connect_foo: Refreshing state... [id={uuid}]
╷
│ Error: parsing time "null" as "2006-01-02T15:04:05Z07:00": cannot parse "null" as "2006"
│