okta / terraform-provider-okta

A Terraform provider to manage Okta resources, enabling infrastructure-as-code provisioning and management of users, groups, applications, and other Okta objects.
https://registry.terraform.io/providers/okta/okta
Mozilla Public License 2.0
256 stars 207 forks source link

resource "okta_authenticator" "okta_email" does honor 'allowedFor' upon creation #1851

Open antonmos opened 10 months ago

antonmos commented 10 months ago

Community Note

Terraform Version

Terraform v1.6.6

Affected Resource(s)

Terraform Configuration Files

resource "okta_authenticator" "email" {
  name = "email"
  key  = "okta_email"
  settings = jsonencode(
    {
      "allowedFor" : "any",
      "tokenLifetimeInMinutes": 5
    }
  )
}

Debug Output

okta_authenticator.email: Creation complete after 2s 

Panic Output

Expected Behavior

Okta email autheticator should have been updated to allow use for authentication.

Can this be done in the Admin UI?

yes

Can this be done in the actual API call?

Actual Behavior

Terraform apply created the resource but the authenticator was not updated to allow use for authentication.

Steps to Reproduce

  1. terraform apply

Important Factoids

running terraform plan again, produced

  ~ resource "okta_authenticator" "email" {
        id                          = "aut5qskmjsdq7w4bm1d7"
        name                        = "Email"
      ~ settings                    = jsonencode(
          ~ {
              ~ allowedFor             = "recovery" -> "any"
                # (1 unchanged attribute hidden)
            }
        )
        # (5 unchanged attributes hidden)
    }

Running terraform apply correctly updated the authenticator to allow use for authentication and recovery.

duytiennguyen-okta commented 10 months ago

OKTA internal reference https://oktainc.atlassian.net/browse/OKTA-678557