terraform-provider-okta: Receiving a Status: 410 Gone Error for resource: "okta_email_sender" when enabling multibranding in Okta
Upon Turning on the MultiBranding feature in Okta and running Terraform I get the following error:

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 v1.4.5
Okta Terraform version
3.46.0
Affected Resource(s)
- okta_email_sender
Terraform Configuration Files
resource "okta_email_sender" "vanity_email_address" {
from_name = "email name"
from_address = var.vanity_email
subdomain = "subdomainName"
}
Expected Behavior
Should be able create a vanity email (It works when the multibranding feature off).
Can this be done in the Admin UI?
Yes
Can this be done in the actual API call?
Yes
Actual Behavior
The API is returning a Error: failed to get custom email sender: the API returned an error: This endpoint has been deprecated., Status: 410 Gone error.
Steps to Reproduce
- Turn on multibranding
- Run
terraform applyon aokta_email_senderresource
About this issue
- Original URL
- State: closed
- Created a year ago
- Reactions: 16
- Comments: 27 (3 by maintainers)
It was a joke. It was not meant to be offensive nor directed toward you personally.
But since weāre on the topic, I am not offended by Okta or itās staff although I would say that my company has every right to be offended.
We pay your company a lot of money to provide services and a portion of those services have been rendered useless for over three months by a breaking change introduced by Okta apparently because your API folks and Terraform folks arenāt communicating. Then to make matters worse, the fix offered up for the breaking change was designed with a new dependency, clearly untested, and documented poorly. And now youāre asking paying customers to troubleshoot whether or not itās Oktaās Terraform or Oktaās API that isnāt working properly.
Oktaās mistakes have caused my company to burn through a minimum of 20 hours worth of labor for troubleshooting, finding work-arounds, and manually performing steps that were automatic CI/CD operations three months ago. And itās not just my company that has been feeling this pain for the past three months, itās every company that had the misfortune of using the okta_email_sender resource. I canāt imagine the total number of dollars and hours this breaking change has cost Oktaās customers but Iām certain it would be eye-popping.
I donāt know what person, group, process, procedure, or technology at Okta is to blame but the fact remains that a service which we all pay for is not available because of something that went wrong at Okta. At this point Iām done troubleshooting.
And although my description of the issue is accurate, I apologize for using words you find offensive. Again, it was not directed at you personally or any individual. It was referring to the situation and the interdependent layers of technology that have collectively failed.
Please let me and the rest of Oktaās customerās know when the fix will be ready. Thank you for attending to this long outstanding issue. Clint Robinson
We are one more company waiting on this fix. Thanks for your hard work.
@ClintonianSunBlaster / all, @duytiennguyen-okta is finishing up a work around that will hopefully go out within the week. Definitely not on the back burner.
This feature appears to be broken due to using an undocumented API
/api/v1/org/email/sender. (openapi docs https://github.com/okta/okta-sdk-golang/blob/v2.18.0/.generator/okta-management-APIs-oasv3-noEnums-inheritance.yaml ). This API had a breaking change causing this resource to break as described above.Iām guessing the current api is the following: https://github.com/okta/okta-sdk-golang/blob/v3.0.2/okta/api_email_domain.go . Or you can look for the
/api/v1/email-domainsin the opanapi documentation https://github.com/okta/okta-sdk-golang/blob/v3.0.2/okta/api/openapi.yamlIām going to likely just delete this resource from terraform state to get my pipelines working. Hopefully there is an update to allow us to manage these in terraform again going forward.
@duytiennguyen-okta and @monde,
Sorry to pile on here butā¦
There appears to be another issue with the new okta_email_domain resource and itās requirement for a brand_id.
okta_email_domain requires a ābrand_idā but it appears the only way to retrieve a list of brand_ids is to use the okta_brand data resource which outputs a list of brands based on the okta_brands data resource output (see https://registry.terraform.io/providers/okta/okta/latest/docs/data-sources/brand). This creates a problem because okta_brand doesnāt have a reference attribute called ānameā so there is no way to retrieve the brand id of a specific custom brand. Instead, you can only reference ātolist(data.okta_brands.test.brands)[x].idā which retrieves a brand id from a list based on a list index. It appears that index 0 always gets the brand id of the default brand which happens to be the first brand on the list. But, if you have multiple custom brands and would like the brand id of a specific one, itās guesswork as to which index to use. And worse yet, if youāre managing multiple brands across multiple environments, then itās entirely possible indexes could different between environments.
I think a fix would be to update the okta_brand data resource to include a returned attribute called ānameā then I/us/we could use a locals that searches the list of brands returned from okta_brand for a brand which matches a specific name to get its specific brand_id? Once we have the correct brand_id we can then use it in the new okta_email_domain resource.
Thanks again, Clint
@duytiennguyen-okta and @monde,
This issue is ātechnicallyā fixed but the fix caused new issues as the new okta_email_domain resource appears to be misconfigured. Specifically, the dns_validation_records attribute contains a sub-attribute called āvaluesā which is is incorrectly documented as āvalueā at https://registry.terraform.io/providers/okta/okta/latest/docs/resources/email_domain and the āvaluesā attribute contains no data.
This creates an issue as we can no longer setup the associated DNS records with TF and thus the new okta_email_domain_validation resource always fails.
Please investigate and fix as soon as possible. Thanks!
Here is an example. Notice āvaluesā and itās empty valuesā¦
@monde,
This continues to be an issue. When will this be fixed?
Itās now been 80 days since Okta introduced this breaking change.
We were informed by Okta Support on on June 8th that the okta_email_sender api has been deprecated and replaced by the email_domain api (https://developer.okta.com/docs/api/openapi/okta-management/management/tag/EmailDomain/).
When will the okta_email-sender tf resource be updated to use the new API?
Thanks, Clint
@monde Iām happy to help debug if useful. But Iām hitting the same issue, this is the one for me: https://github.com/okta/terraform-provider-okta/blob/b4ad5a959aa1d5a81aa358f78beaa0edf783155c/sdk/email_sender.go#L72
/api/v1/org/email/sender/<whatever>seems to be deprecatedEDIT: Ok after reading a few more of this thread, I realize now that the other method was (silently?) deprecated and Iām supposed to use
okta_domain_senderIād add a note on the terraform documentation if possible.@monde or @duytiennguyen-okta, can you bring @ClintonianSunBlaster feedback to the attention of Jeff Taylor and/or Nick Gamb. It is valid feedback since our team also lost time working around this issue, and it is best to have visibility, other than twittering to https://twitter.com/toddmckinnon. š
Oh, I would also consider re-opening this issue @monde, IMO. šø