site24x7 / terraform-provider-site24x7

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

Is it Really Possible to Create Users? #262

Closed jamiejackson closed 3 months ago

jamiejackson commented 3 months ago

Version: 1.0.84

Is it actually possible to create users with the provider?

Using this TF:

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                = "jamie.jackson+terraform@acme.com" # (i used a good email address in the actual attempt)
  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 get:

│ Error: Failed to invite the user
│ 
│   with site24x7_user.jamie_fake,
│   on users.tf line 25, in resource "site24x7_user" "jamie_fake":
│   25: resource "site24x7_user" "jamie_fake" {
│ 

Doesn't this practically mean that one can't create a user with the provider? The docs say, "Email verification has to be done manually," but it's not clear to me how that should be dealt with when creating a user via Terraform.

jamiejackson commented 3 months ago

Hmm, this might be a general Site24x7 problem.

I found that I was unable to add this user with this email address using the console, too. I used jamie.jackson+terraform@redacted.com (but instead of redacted, my real company was used). This is a valid email address but maybe Site24x7 has a problem with the +?

I have legacy users in the system with + email addresses.

On the other hand, I was able to create a user via Terraform using an email address without the +.

I think this ticket can be closed. I'll open a ticket with Site24x7 support.