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

SAML auth0_connection properties set by metadata_xml cause incorrect diffs #559

Closed
6 tasks done
max-dekock opened this issue Apr 19, 2023 · 1 comment
Closed
6 tasks done
Labels
🪲 bug Something isn't working

Comments

@max-dekock
Copy link

max-dekock commented Apr 19, 2023

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

I have an Auth0 SAML connection resource that looks like this:

resource "auth0_connection" "example_connection" {
  name     = "Example"
  strategy = "samlp"
  options {
    metadata_xml        = data.local_file.example_metadata.content
    domain_aliases      = ["example.com"]
  }
}

This creates the connection just fine. But if I make an unrelated change and run terraform plan, I see this:

Terraform will perform the following actions:

  # auth0_connection.ad_gallery_test_connection will be updated in-place
  ~ resource "auth0_connection" "example_connection" {
        id                   = "con_xxxxxxxxxxxxxxxxxxx"
        name                 = "Example"
        # (6 unchanged attributes hidden)

      ~ options {
          - sign_in_endpoint               = "https://[...]" -> null
          - sign_out_endpoint              = "https://[...]" -> null
          - signing_cert                   = "[...]" -> null
            # (28 unchanged attributes hidden)
        }
    }

 [...]

It looks like the Auth0 provider doesn't realize that the sign_in_endpoint, sign_out_endpoint, and signing_cert arguments are computed from the metadata_xml argument. I think this issue is essentially the same as #387.

Expectation

I would expect the provider to realize that these properties are computed from the metadata_xml file, and not try to change them to null when nothing in that file has changed.

Reproduction

A TF block like the one above should be sufficient provided that the metadata_xml argument contains a valid SAML metadata XML document.

First run apply to create the object, then run plan to see the diff.

Auth0 Terraform Provider version

0.45.0

Terraform version

1.3.3

@max-dekock max-dekock added the 🪲 bug Something isn't working label Apr 19, 2023
willvedd added a commit that referenced this issue Apr 28, 2023
willvedd added a commit that referenced this issue Apr 28, 2023
* Inferring properties from saml XML

* Fixing acc tests

* Rerecording test

* Adding assertion

---------

Co-authored-by: Will Vedder <will.vedder@okta.com>
@sergiught
Copy link
Contributor

Thanks again @max-dekock for raising this. It is now available within the latest https://github.com/auth0/terraform-provider-auth0/releases/tag/v0.46.0. Please let us know if you have any issues with it.

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