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
258 stars 208 forks source link

okta_app_user_schema_property - forceNew fails - eventual consistency #1974

Open exitcode0 opened 6 months ago

exitcode0 commented 6 months ago

Community Note

Terraform Version

Terraform v1.7.5
on darwin_arm64
+ provider registry.terraform.io/hashicorp/aws v5.17.0
+ provider registry.terraform.io/okta/okta v4.5.0

Your version of Terraform is out of date! The latest version
is 1.8.0. You can update by downloading from https://www.terraform.io/downloads.html

Affected Resource(s)

Terraform Configuration Files

N/A

Debug Output

N/A

Panic Output

Error: the API returned an error: Api validation failed: updateAppUserSchemas.
Causes: errorSummary: You cannot add the attribute with the variable name '<REDACTED>' because the deletion process for an attribute with the same variable name is incomplete. Wait until the data clean up process finishes and then try again.

Expected Behavior

Updating a okta_app_user_schema_property resource and triggering a forceNew should apply successfully

Can this be done in the Admin UI?

The upstream eventual consistency is a problem in the Admin UI as well, it can also be triggered manually via the Okta Admin Dashboard

Can this be done in the actual API call?

The upstream eventual consistency is a problem in the Admin UI as well, It can also be triggered using the API

Actual Behavior

Eventual consistency in the upstream API means that re-creating the schema attribute with the same name will fail.

Steps to Reproduce

  1. create a okta_app_user_schema_property
  2. trigger a forceNew on the okta_app_user_schema_property by updating an attribute like scope
  3. terraform apply

Important Factoids

Its not clear to me if this error occurs because:

References

exitcode0 commented 5 months ago

I've updated the original issue content to include reference to OKTA-724818