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

resource okta_brand fails to apply #1130

Closed
pmatpadi opened this issue May 22, 2022 · 2 comments
Closed

resource okta_brand fails to apply #1130

pmatpadi opened this issue May 22, 2022 · 2 comments
Assignees

Comments

@pmatpadi
Copy link

Okta brand fails to update. brand_id is a valid value

GET 'https://bl-poc-hub1.oktapreview.com/api/v1/brands'

[{"id":"bnd3p0az1vLQRownC1d7","removePoweredByOkta":false,"customPrivacyPolicyUrl":null,"_links":{"themes":{"href":"https:///api/v1/brands/bnd3p0az1vLQRownC1d7/themes","hints":{"allow":["GET"]}},"self":{"href":"https:///api/v1/brands/bnd3p0az1vLQRownC1d7","hints":{"allow":["GET","PUT"]}}}}]

Code

data "okta_brands" "current-brands" {
}
data "okta_brand" "current-brand" {
brand_id = tolist(data.okta_brands.current-brands.brands)[0].id
}

resource "okta_brand" "bl-privacy" {
agree_to_custom_privacy_policy = true
custom_privacy_policy_url = "https://www.example.com/legal/privacy-policy/"
remove_powered_by_okta = true
}

Terraform plan output

Terraform will perform the following actions:

okta_brand.bl-privacy will be created

  • resource "okta_brand" "bl-privacy" {

Terraform apply output

okta_brand.bl-privacy: Creating...

│ Error: failed to get brand "": json: cannot unmarshal array into Go value of type okta.Brand

│ with okta_brand.bl-privacy,
│ on main.tf line 126, in resource "okta_brand" "bl-privacy":
│ 126: resource "okta_brand" "bl-privacy" {

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.2.0
on darwin_amd64

  • provider registry.terraform.io/hashicorp/vault v3.6.0
  • provider registry.terraform.io/okta/okta v3.27.0

Affected Resource(s)

  • okta_brand

Terraform Configuration Files

# Copy-paste your Terraform configurations here - for large Terraform configs,
# please use a service like Dropbox and share a link to the ZIP file. For
# security, you can also encrypt the files using our GPG public key: https://keybase.io/hashicorp

Debug Output

https://gist.github.com/pmatpadi/5052f154c210e0e0c47e6a553ad50874

Panic Output

Expected Behavior

Brand should be updated

Actual Behavior

Brand fails to update

Steps to Reproduce

  1. Plan is created successfully.
  2. Apply step fails.

Important Factoids

References

  • #0000
@reecewilliams7
Copy link

If it's any help - I had the same issue and was able to work around it by first importing the existing brand into state.

@monde monde self-assigned this May 23, 2022
@monde
Copy link
Collaborator

monde commented May 23, 2022

Hi @pmatpadi . See the docs https://registry.terraform.io/providers/okta/okta/latest/docs/resources/brand , you have to import your brand first before you can modify it. Brands are can only be updated through the Okta API. Therefore this resource only gets and updates a brand. There is also a note about it in the example usage.

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

3 participants