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

diff not properly produced when overwriting options in auth0_connection #1111

Open
6 tasks done
sugitak opened this issue Jan 8, 2025 · 0 comments
Open
6 tasks done
Labels
🪲 bug Something isn't working

Comments

@sugitak
Copy link

sugitak commented Jan 8, 2025

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 updating options in auth0_connection, the result diff is not properly produced. It only shows added or updated resources, and not the deleted ones.

Suppose you set your password_policy as "excellent" by hand. You import your config to Terraform without explicitly specifying options block. After a while you find you need to configure custom_scripts which will be defined in options. You create an options block with only custom_scripts defined. When you apply, you will lose all other options that were configured on auth0 tenant. The terraform-provider-auth0 only shows diffs that were added to options, and you will not be able to even notice you have deleted your password_policy.

This problem originates from auth0 API behavior, that when the options in connection is updated, API response is displaying just a part of the affected elements. We have confirmed this by asking the auth0 support team, and also filed a support ticket to enhance this behavior.
https://auth0.com/docs/api/management/v2/connections/patch-connections-by-id

This issue ticket is intended to share information to the community. Changing API behavior is not easy and takes time.

Expectation

After applying, auth0_connection.<name>.options should return all the configuration that are changed, including deleted parameters that were only defined in auth0 tenant and absent from Terraform configuration.

Workaround should be: putting notes on https://registry.terraform.io/providers/auth0/auth0/latest/docs/resources/connection

Reproduction

  • Given:
    • create a connection by hand
    • password policy set by hand
  • Then:
    • define auth0_connection on terraform
    • import connection without explicitly configuring options.password_policy
    • add new param to options, ex: options.custom_script
    • apply and see diff

Auth0 Terraform Provider version

v1.7.1

Terraform version

1.10.2

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

1 participant