site24x7 / terraform-provider-site24x7

Terraform provider for Site24x7
MIT License
22 stars 33 forks source link

Terraform Plan Shows Spurious Addition of site24x7_user.mobile_settings.mobile_number #263

Open jamiejackson opened 3 months ago

jamiejackson commented 3 months ago

Version: 1.0.84

I'm getting a spurious, intermittent plan diffs for mobile_settings.mobile_number of site24x7_user resources. Normally, I automate drift detection for my Terraform projects, but spurious diffs make that impractical.

I have the following Terraform:

locals {
  notification_medium = {
    email = 1
    sms   = 2
    voice = 3
  }
  notification_medium_all = [1, 2, 3]
  user_role = {
    super_admin     = 1
    admin           = 2
    operator        = 3
    read_only       = 10
    billing_contact = 4
    spokesperson    = 5
    hosting_contact = 6
    alert_contact   = 0
  }
  statusiq_role = {
    # TODO: get the rest of these and record them
    admin = 22
  }
}

# note: everything but the contact details is modeled after ajay's actual user (as of 5/15/24)
resource "site24x7_user" "jamie_fake" {
  display_name                 = "Jamie Fake (Terraform)"
  email_address                = "REDACTED@REDACTED.com"
  statusiq_role                = local.statusiq_role.admin
  user_role                    = local.user_role.admin
  notification_medium          = local.notification_medium_all
  up_notification_medium       = local.notification_medium_all
  down_notification_medium     = local.notification_medium_all
  trouble_notification_medium  = local.notification_medium_all
  critical_notification_medium = local.notification_medium_all
  mobile_settings = {
    country_code  = "1"
    mobile_number = "5555555555"
  }
}

I just ran terraform plan ten times in a row. 5 of those had the following (and the other 5 showed no diffs).

  # site24x7_user.jamie_fake will be updated in-place
  ~ resource "site24x7_user" "jamie_fake" {
        id                           = "207348000022642021"
      ~ mobile_settings              = {
          + "mobile_number" = "5555555555"
            # (1 unchanged element hidden)
        }
        # (18 unchanged attributes hidden)
    }