-
Notifications
You must be signed in to change notification settings - Fork 208
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Error when trying to update okta_policy_rule_profile_enrollment resource #1213
Comments
Thanks @emanor-okta I'll take a look. |
Adds the attribute 'uiSchemaId' to the Profile Enrollment Action Object. The is value is generated by the back end and if present will be required when any policy update is made, otherwise a 400 will be returned. see: https://oktawiki.atlassian.net/wiki/spaces/~60feb6dac51f3a00697babaf/pages/2510164199/Profile+Enrolment+Policy+-+Improve+API+validation?focusedCommentId=2512879955 This enhancement is needed in order to update the OpenAPI Spec so the Management SDKs can add this attribute. (okta/terraform-provider-okta#1213)
PR to update Docs with this attribute. |
Okta internal reference: https://oktainc.atlassian.net/browse/OKTA-524622 |
Adds the attribute 'uiSchemaId' to the Profile Enrollment Action Object. The is value is generated by the back end and if present will be required when any policy update is made, otherwise a 400 will be returned. see: https://oktawiki.atlassian.net/wiki/spaces/~60feb6dac51f3a00697babaf/pages/2510164199/Profile+Enrolment+Policy+-+Improve+API+validation?focusedCommentId=2512879955 This enhancement is needed in order to update the OpenAPI Spec so the Management SDKs can add this attribute. (okta/terraform-provider-okta#1213)
Hello. We've run into this issue. Was working up until recently, so I'm guessing the public-facing API changed recently? |
@zubinmadon do you know what release of the provider you were using previously? Our latest release v3.36.0 was 16 days ago but this issue was originally reported July 20th whose nearest previous release would have been v3.31.0 |
Thanks @monde! We were using v3.20.0. I think I had been trying to get terraform to work, and it happened to work with that version -- however, since that time we needed to upgrade to v3.31.0 for other features, so we cannot downgrade back anything before that. Initially the bug didn't affect us because our |
Fix ACC Test `TestAccOktaPolicyRuleProfileEnrollment` Closes #1213
Fix ACC Test `TestAccOktaPolicyRuleProfileEnrollment` Closes #1213
Hi again @monde - thanks for fixing this. When settting up an okta_policy_rule_profile_enrollment resource, now we end up needing to run a somewhat complex curl to find the ui_schema_id and set the internal okta resource ID. What makes matters more confusing, is that sometimes there is no ui_schema_id, and then eventually, without changing anything on our side, it's added, and we need to manually add the internal resource id to our terraform code. Given the way terraform usually works, I would expect to never have to set an internal resource id. Would you like me to open another issue for this? |
I support what @zubinmadon is saying. We are now forced to hardcode the ui schema id in terraform files or get it via additional scripts. |
Our Jira on this is still on the backlog internally. Re-opening for a second look given @zubinmadon and @sebman-metro feedback. |
This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 5 days |
Community Note
Terraform Version
Affected Resource(s)
Terraform Configuration Files
Debug Output
https://gist.github.com/emanor-okta/c754b2ac4ace42e1f234b97b46e57344
Panic Output
Expected Behavior
Profile Enrollment Rule should have been updated
Actual Behavior
Update returns:
"errorSummary": "Api validation failed: actions.profileEnrollment.uiSchemaId"
Steps to Reproduce
terraform plan/apply
to create the Enrollment Policy/Ruleterraform plan
terraform apply
(error will be returned here)Important Factoids
References
The issue appears to be terraform-provider-okta (https://github.com/okta/terraform-provider-okta/blob/master/okta/resource_okta_policy_rule_profile_enrollment.go) which relies on okta-sdk-golang (https://github.com/okta/okta-sdk-golang/blob/master/okta/profileEnrollmentPolicyRuleAction.go), which I believe is built off of the open-api spec (https://github.com/okta/okta-management-openapi-spec/blob/master/dist/spec.json#L22607) do not model the
uiSchemaId
attribute.The API docs also do not show the
uiSchemaId
attribute in the object definition, https://developer.okta.com/docs/reference/api/policy/#profile-enrollment-action-objectSo
uiSchemaId
is dropped from the API call (https://fake.oktapreview.com/api/v1/policies/rst44fglytHV52wMY1d7/rules/rul44fglyu6oQKQGB1d7)Example of returned rule with with
uiSchemaId
GET https://fake.oktapreview.com/api/v1/policies/rst44fglytHV52wMY1d7/rules/rul44fglyu6oQKQGB1d7
The text was updated successfully, but these errors were encountered: