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

Unable to import okta_email_template_settings #2202

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

Unable to import okta_email_template_settings #2202

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_email_template_settings

Terraform Configuration Files

resource "okta_email_template_settings" "example" {
  brand_id      = "<brand id>"
  template_name = "ForgotPassword"
  recipients    = "ADMINS_ONLY"
}

Debug Output

│ Error: failed to read email template settings
│ 
│ 405 Method Not Allowed

Relevant debug except showing the endpoint the provider attempts to call (the correct endpoint is /api/v1/brands/{{brandID}}/templates/email/{{templateType}}/settings)

2025-01-31T14:18:11.728-0500 [DEBUG] provider.terraform-provider-okta_v4.13.1: 2025/01/31 02:18:11 [DEBUG] performing request: method=GET url={{tenant URL}}/api/v1/brands//templates/email//settings
2025-01-31T14:18:11.728-0500 [DEBUG] provider.terraform-provider-okta_v4.13.1: 2025/01/31 14:18:11 [DEBUG] Okta API Request Details:
2025-01-31T14:18:11.728-0500 [DEBUG] provider.terraform-provider-okta_v4.13.1: ---[ REQUEST ]---------------------------------------
2025-01-31T14:18:11.728-0500 [DEBUG] provider.terraform-provider-okta_v4.13.1: GET /api/v1/brands//templates/email//settings HTTP/1.1

2025-01-31T14:18:11.836-0500 [DEBUG] provider.terraform-provider-okta_v4.13.1: 2025/01/31 14:18:11 [DEBUG] Okta API Response Details:
2025-01-31T14:18:11.837-0500 [DEBUG] provider.terraform-provider-okta_v4.13.1: ---[ RESPONSE ]--------------------------------------
2025-01-31T14:18:11.837-0500 [DEBUG] provider.terraform-provider-okta_v4.13.1: HTTP/2.0 405 Method Not Allowed
2025-01-31T14:18:11.837-0500 [DEBUG] provider.terraform-provider-okta_v4.13.1: Connection: close
2025-01-31T14:18:11.837-0500 [DEBUG] provider.terraform-provider-okta_v4.13.1: Content-Type: application/json
2025-01-31T14:18:11.837-0500 [DEBUG] provider.terraform-provider-okta_v4.13.1: Date: Fri, 31 Jan 2025 19:18:11 GMT
2025-01-31T14:18:11.837-0500 [DEBUG] provider.terraform-provider-okta_v4.13.1: Server: nginx
2025-01-31T14:18:11.837-0500 [DEBUG] provider.terraform-provider-okta_v4.13.1: Strict-Transport-Security: max-age=315360000; includeSubDomains
2025-01-31T14:18:11.837-0500 [DEBUG] provider.terraform-provider-okta_v4.13.1: X-Content-Type-Options: nosniff
2025-01-31T14:18:11.837-0500 [DEBUG] provider.terraform-provider-okta_v4.13.1
2025-01-31T14:18:11.837-0500 [DEBUG] provider.terraform-provider-okta_v4.13.1: {
2025-01-31T14:18:11.837-0500 [DEBUG] provider.terraform-provider-okta_v4.13.1:  "errorCode": "E0000022",
2025-01-31T14:18:11.837-0500 [DEBUG] provider.terraform-provider-okta_v4.13.1:  "errorSummary": "The endpoint does not support the provided HTTP method",
2025-01-31T14:18:11.837-0500 [DEBUG] provider.terraform-provider-okta_v4.13.1:  "errorLink": "E0000022",
2025-01-31T14:18:11.837-0500 [DEBUG] provider.terraform-provider-okta_v4.13.1:  "errorId": "oaeiSS5fQJWRr6Bc9Cx7mjkWw",
2025-01-31T14:18:11.837-0500 [DEBUG] provider.terraform-provider-okta_v4.13.1:  "errorCauses": []
2025-01-31T14:18:11.837-0500 [DEBUG] provider.terraform-provider-okta_v4.13.1: }
2025-01-31T14:18:11.837-0500 [DEBUG] provider.terraform-provider-okta_v4.13.1: -----------------------------------------------------
2025-01-31T14:18:11.837-0500 [ERROR] provider.terraform-provider-okta_v4.13.1: Response contains error diagnostic: diagnostic_summary="failed to read email template settings" tf_proto_version=5.4 @caller=github.com/hashicorp/[email protected]/tfprotov5/internal/diag/diagnostics.go:58 @module=sdk.proto tf_rpc=ReadResource diagnostic_detail="405 Method Not Allowed" diagnostic_severity=ERROR tf_req_id=1a75007e-bd24-265a-cac1-92f493eab083 tf_resource_type=okta_email_template_settings tf_provider_addr=okta/okta timestamp=2025-01-31T14:18:11.836-0500
2025-01-31T14:18:11.838-0500 [ERROR] vertex "import okta_email_template_settings.example result" error: failed to read email template settings

Panic Output

N/A

Expected Behavior

The resource is imported and managed by 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 import fails

Steps to Reproduce

  • Define a okta_email_template_settings resource
  • Attempt to import it using the ID <brand ID>/<template type> per the provider doc
  • Observe that the import fails

Important Factoids

Looking at the import method and framework docs for the ImportStatePassthroughID method it uses, this resource isn't compatible with it, because the resource's read method relies on multiple inputs (brand ID & template type).

Looks like a simple fix (define a custom import method that extracts the two inputs in the provided composite ID), it's not a major blocker for this project, so I'll circle back and put in a PR if I can find the time.

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