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

auth0_client: ommiting the addons section will make terraform plan noisy #926

Open
6 tasks done
mbelang opened this issue Feb 29, 2024 · 3 comments
Open
6 tasks done
Labels
🪲 bug Something isn't working

Comments

@mbelang
Copy link

mbelang commented Feb 29, 2024

Checklist

  • I have looked into the README and have not found a suitable solution or answer.
  • I have looked into the documentation and have not found a suitable solution or answer.
  • I have searched the issues and have not found a suitable solution or answer.
  • I have upgraded to the latest version of this provider and the issue still persists.
  • I have searched the Auth0 Community forums and have not found a suitable solution or answer.
  • I agree to the terms within the Auth0 Code of Conduct.

Description

When creating an auth0_client like this

resource "auth0_client" "this" {
  name        = "Potatoes"
  description = "I love potatoes"
  app_type    = "non_interactive"
}

Doing a plan will result in this which creates noise in the plan section that are missleading user thinking they did something wrong.

 resource "auth0_client" "this" {
        id                                    = "zjpuq6xmRysrxixeB3sTPDfOVTL8tb1N"
        name                                  = "Potatoes"

      - addons {
        }
    }

You can mitigate the problem with the following e.g. adding an empty addons section

resource "auth0_client" "this" {
  name        = "Potatoes"
  description = "I love potatoes"
  app_type    = "non_interactive"
  addons {}
}

Expectation

Planning an auth0_client that doesn't have the addons section specified and has no changes should result in a noop plan.

Reproduction

Create a client like this

resource "auth0_client" "this" {
  name        = "Potatoes"
  description = "I love potatoes"
  app_type    = "non_interactive"
}

Run terraform plan.

Auth0 Terraform Provider version

1.2.0

Terraform version

1.6.x

@mbelang mbelang added the 🪲 bug Something isn't working label Feb 29, 2024
@developerkunal
Copy link
Contributor

Hi @mbelang,

I hope you're having a nice day!

I wanted to express my appreciation for your contribution. Also, I apologize for the late reply.

I've attempted to reproduce the issue using the configuration you provided, but it's not occurring on my end. Could you please provide me with more information or details about the issue?

Thank you.

@emsearcy
Copy link

I also had this issue with provider version 1.2.0. I didn't attempt to specifically reproduce it, but based on my memory, I think it may have been introduced by hitting "save" in the manage.auth0.com on a non-interactive client. I have a non-interactive client that I created via Terraform (without any auth0_client_credentials resources), and then I used the web UI to upload a private key, and every subsequent run started showing the addons diff until I added the empty block.

Not to hijack the issue, but I wonder if this is related to a broader issue is that the Auth0 API distinguishes between something which is "unset" (and therefore is default) vs. something which has been explicitly set to its default setting. We've just completed a migration of a set of 6-year-old Auth0 environments managed by auth0-deploy-cli to Terraform, and I was running into these all over the place: various "-> null" diffss that would never actually apply, e.g. description, cross_origin_auth, sso, token_dialect, allow_offline_access—so I had to explicitly set defaults all over the place.

@mbelang
Copy link
Author

mbelang commented May 28, 2024

@emsearcy we also experience the same kind of experience you are describing from time to time and our simple solution is to explicitly set the value to the default value. It might be a more generalised problem and we happen to hit it with the addons field on the auth0_client resource

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🪲 bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants