-
Notifications
You must be signed in to change notification settings - Fork 215
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
Add brand_id as attribute reference for okta_domain resource #1645
Comments
OKTA internal reference https://oktainc.atlassian.net/browse/OKTA-631380 |
To add to this, it would also be helpful to return the theme_id with the domain. Currently, I have to:
This is a very frustrating development process and inhibits CI/CD endeavors for your customers. Please consider refactoring this or, at the very least, providing workarounds. |
@chad-larsen-rapid okta updated the management API for brands to be fully CRUD and @duytiennguyen-okta has implemented that in #1677 which will be in the next release. I like to see if the updated behavior benefits your use case. In general, making composite resources and data sources (e.g. adding theme_id to domain) is a bit of anti pattern in TF where Hashicorp suggests resources should focus on a single API object https://developer.hashicorp.com/terraform/plugin/best-practices/hashicorp-provider-design-principles . If you can get access to the theme_id from resources/datasources we already provide, that is the best practice in the TF config. |
Thanks for the update @monde. I agree that my proposal was a bit of an anti-pattern and was suggested only as a workaround because it was unclear what the intent for the programmatic control of brands is supposed to be. Right now the brand resources that are heavily coupled in the web UI/console don't seem to be connected at all in the SDK. If brands and themes are fully enabled for CRUD, that will likely be a much better long term approach. Does that mean that Okta intends for the management of brands, and their related resources, to look something like this in the future? resource "okta_brand" "example" {
...
}
resource "okta_theme" "example" {
brand_id = okta_brand.example.id
...
}
resource "okta_domain" "example" {
brand_id = okta_brand.example.id
...
}
resource "okta_domain" "example" {
brand_id = okta_brand.example.id
...
}
resource "okta_email_domain" "example" {
brand_id = okta_brand.example.id
...
}
resource "okta_email_customization" "example" {
brand_id = okta_brand.example.id
...
} |
Yes that is the general idea. And for reference, email_domain already allow for brand_id input when create and update. Email customization however does not allow brand_id to be update from the API |
Close with #1685 |
Community Note
Description
The Okta Management API does not have a true Create or Delete option for brands. This leads to issues when attempting to manage brands, domains, and email_domains with Terraform. Example issue.
It appears that a brand is automatically created when an
okta_domain
resource is created. Also, the Custom Domains API includes a brandID in its response value:I think a potential workaround could be to add
brand_id
as an attribute reference for okta_domain resources. This will enable users to "create" a brand when creating anokta_domain
and then reference it's value in other resources likeokta_email_domain
.New or Affected Resource(s)
Potential Terraform Configuration
References
The text was updated successfully, but these errors were encountered: