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

tfe_saml_settings Error: Provider produced inconsistent result after apply #1368

Open
versent-ms opened this issue May 27, 2024 · 0 comments
Labels

Comments

@versent-ms
Copy link

Terraform Enterprise version

Terraform Enterprise v202402-1

Terraform version

Terraform v1.7.5
on linux_amd64

Terraform Configuration Files

resource "tfe_saml_settings" "okta" {
  idp_cert                = file("./idp_saml_certificate.pem")
  slo_endpoint_url        = "https://<Redacted>.okta.com"
  sso_endpoint_url        = "https://<Redacted>okta.com/app/<Redacted>"
  team_management_enabled = true
  debug                   = true
  attr_site_admin         = "tfe-admins"
  site_admin_role         = ""
}

Debug Output

saml.tf

Error: Provider produced inconsistent result after apply
244 |  
245 | When applying changes to tfe_saml_settings.okta, provider
246 | "provider[\"registry.terraform.io/hashicorp/tfe\"]" produced an unexpected
247 | new value: .idp_cert: was cty.StringVal("-----BEGIN
248 | CERTIFICATE-----<Redacted>-----END
249 | CERTIFICATE-----\n"), but now cty.StringVal("-----BEGIN
250 | CERTIFICATE-----<>Redacted-----END
251 | CERTIFICATE-----").
252 |  
253 | This is a bug in the provider, which should be reported in the provider's own
254 | issue tracker.
255

idp_saml_certificate.pem

-----BEGIN CERTIFICATE-----
<Redacted>
-----END CERTIFICATE-----

Expected Behavior

SAML Configured with no Error

Actual Behavior

Errors out in pipeline

Additional Context

The Module doesn't handle the last new line character '\n' in a file, when writing it to Terraform Enterprise it doesn't include the last /n thus will always trigger a diff or update when terraform plan/apply is run.

Similar issue reported in #1367

Workaround: Ensure that no new line is present at the end of the file.
IE:
idp_saml_certificate.pem

-----BEGIN CERTIFICATE-----
<Redacted>
-----END CERTIFICATE-----
@versent-ms versent-ms added the bug label May 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant