mongodb / terraform-provider-mongodbatlas

Terraform MongoDB Atlas Provider: Deploy, update, and manage MongoDB Atlas infrastructure as code through HashiCorp Terraform
https://registry.terraform.io/providers/mongodb/mongodbatlas
Mozilla Public License 2.0
241 stars 167 forks source link

Hour and minute properties don't update when they are zero for mongodbatlas_cloud_provider_snapshot_backup_policy #211

Closed michelzanini closed 4 years ago

michelzanini commented 4 years ago

Hi,

When the resource mongodbatlas_cloud_provider_snapshot_backup_policy has reference_hour_of_day or reference_minute_of_hour set to 0, it never updates Atlas.

For example, if they configuration is like this:

resource "mongodbatlas_cloud_provider_snapshot_backup_policy" "backup_policy" {
(...)
  reference_hour_of_day    = 0
  reference_minute_of_hour = 0
  restore_window_days      = 3
(...)

The policy always comes back as a change is required:

~ reference_hour_of_day    = 17 -> 0
~ reference_minute_of_hour = 21 -> 0

And when applying it never changes Atlas to midnight. It always stays at the time it was before, in this case 17:21...

If I use numbers different than 0 for this properties it all works correctly. I have not investigated if restore_window_days has the same issue.

Can this be fixed? Thanks.

michelzanini commented 4 years ago

I am using version 0.5.1 of the provider, Terraform version 0.12.16

themantissa commented 4 years ago

And confirmed - also a bug. Cannot set values to zero (midnight).