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

importing auth0_connection_clients forces replacement #593

Closed
6 tasks done
jeffreymlewis opened this issue May 22, 2023 · 2 comments
Closed
6 tasks done

importing auth0_connection_clients forces replacement #593

jeffreymlewis opened this issue May 22, 2023 · 2 comments
Labels
🪲 bug Something isn't working

Comments

@jeffreymlewis
Copy link

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

After terraform import of the default Username-Password-Authentication authenticator using the auth0_connection and auth0_connection_clients terraform resources, terraform wants to replace (destroy/create) the auth0_connection_clients resource because the connection_id is missing from the remote state. (See Reproduction below.)

Expectation

After importing terraform resource auth0_connection_clients, I expect that subsequent 'terraform plan' and 'terraform apply' will not attempt to replace (destroy/create) the auth0_connection_clients resource.

Reproduction

  1. create a new Auth0 Tenant
  2. import the Username-Password-Authentication Authentication/Database using the auth0_connection terraform resource
  3. import the client connections ("enabled_clients") using the auth0_connection_clients terraform resource
  4. run terraform apply and obverse the terraform wants to replace the existing auth0_connection_clients resource
  5. observe that the connection_id needs to be added to the auth0_connection_clients resource, and is the same connection ID use by the terraform import command
  # auth0_connection_clients.main["Username-Password-Authentication"] must be replaced
-/+ resource "auth0_connection_clients" "main" {
      + connection_id   = "con_xosKGzCgD65f1pV2" # forces replacement
      ~ enabled_clients = [
          - "raTn1TPg7oR9buNtLWX5PxcFLhLHkK5R",
          - "zfcuTnChfjJBYgAXHtri3rVg6pkVGYEP",
            # (4 unchanged elements hidden)
        ]
      ~ id              = "con_xosKGzCgD65f1pV2" -> (known after apply)
      ~ name            = "Username-Password-Authentication" -> (known after apply)
      ~ strategy        = "auth0" -> (known after apply)
    }

Auth0 Terraform Provider version

v0.47.0

Terraform version

v1.4.6

@jeffreymlewis jeffreymlewis added the 🪲 bug Something isn't working label May 22, 2023
@sergiught
Copy link
Contributor

Hey @jeffreymlewis 👋🏻

Thanks for raising this, we'll patch this asap. Expect a release with the fix by the end of this week.

@sergiught
Copy link
Contributor

Hey folks, we just released https://github.com/auth0/terraform-provider-auth0/releases/tag/v0.48.0 with a fix for this. Please check it out and let us know if you encounter any issues!

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

2 participants