Skip to content
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

Importing okta_customized_signin_page results in an unusable state #2201

Open
steveAG opened this issue Jan 31, 2025 · 0 comments
Open

Importing okta_customized_signin_page results in an unusable state #2201

steveAG opened this issue Jan 31, 2025 · 0 comments

Comments

@steveAG
Copy link
Contributor

steveAG commented Jan 31, 2025

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
  • Please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for issue followers and do not help prioritize the request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment

Terraform Version

  • Terraform 1.6.0
  • Provider 4.13.1

Affected Resource(s)

  • okta_customized_signin_page

Terraform Configuration Files

resource "okta_customized_signin_page" "test" {
  brand_id       = "<<Brand ID>>"
  page_content   = "<!DOCTYPE html PUBLIC \"-//W3C//DTD HTML 4.01//EN\" \"http://www.w3.org/TR/html4/strict.dtd\">\n<html>\n<head>\n    <meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\">\n    <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\" />\n    <meta name=\"robots\" content=\"noindex,nofollow\" />\n    <!-- Styles generated from theme -->\n    <link href=\"{{themedStylesUrl}}\" rel=\"stylesheet\" type=\"text/css\">\n    <!-- Favicon from theme -->\n    <link rel=\"shortcut icon\" href=\"{{faviconUrl}}\" type=\"image/x-icon\"/>\n\n    <title>{{pageTitle}}</title>\n    {{{SignInWidgetResources}}}\n\n    <style nonce=\"{{nonceValue}}\">\n        #login-bg-image-id {\n            background-image: {{bgImageUrl}}\n        }\n    </style>\n</head>\n<body>\n    <div id=\"login-bg-image-id\" class=\"login-bg-image tb--background\"></div>\n    <div id=\"okta-login-container\"></div>\n\n    <!--\n        \"OktaUtil\" defines a global OktaUtil object\n        that contains methods used to complete the Okta login flow.\n     -->\n    {{{OktaUtil}}}\n\n    <script type=\"text/javascript\" nonce=\"{{nonceValue}}\">\n        // \"config\" object contains default widget configuration\n        // with any custom overrides defined in your admin settings.\n        var config = OktaUtil.getSignInWidgetConfig();\n\n        // Render the Okta Sign-In Widget\n        var oktaSignIn = new OktaSignIn(config);\n        oktaSignIn.renderEl({ el: '#okta-login-container' },\n            OktaUtil.completeLogin,\n            function(error) {\n                // Logs errors that occur when configuring the widget.\n                // Remove or replace this with your own custom error handler.\n                console.log(error.message, error);\n            }\n        );\n    </script>\n</body>\n</html>\n"
  widget_version = "^6"
  widget_customizations {
    widget_generation = "G3"
  }
}

Debug Output

│ Error: Error retrieving customized signin page
│ 
│   with okta_customized_signin_page.test,
│   on brands.tf line 21, in resource "okta_customized_signin_page" "test":
│   21: resource "okta_customized_signin_page" "signin_page" {
│ 
│ Error returned: 405 Method Not Allowed

Panic Output

N/A

Expected Behavior

The resource is successfully imported and can be managed using Terraform

Can this be done in the Admin UI?

N/A

Can this be done in the actual API call?

N/A

Actual Behavior

The resource is imported with an empty string as the id attribute.
This causes all future read operations to result in the above 405 response unless the state file is manually modified to set the brand ID as the resource's ID attribute.

This only impacts the import operation, additional read calls do not clear the resource's id attribute from the state.

Steps to Reproduce

  • Create a brand with a custom signin page using the UI.
  • Define a custom signin page in Terraform
  • Import the existing custom signin page using the Brand's ID
  • Attempt a terraform plan, observe the above failure, and inspect the resource in the state file.
  • Modify the state file to set the resource's id attribute to the correct Brand ID, and observe that terraform plan now succeeds.

References

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant