Skip to content
This repository has been archived by the owner on Mar 8, 2022. It is now read-only.

auth0_client terraform state does not update on description change #295

Closed
nrmitchi opened this issue Nov 24, 2020 · 3 comments
Closed

auth0_client terraform state does not update on description change #295

nrmitchi opened this issue Nov 24, 2020 · 3 comments
Labels
bug Something isn't working preserve verified

Comments

@nrmitchi
Copy link

Description

I have an auth0_client, and modified the description. The terraform state is not updated, meaning the modified resource re-appears in all subsequent plan's.

Terraform Version

Terraform v0.12.24
+ provider.auth0 v0.14.0

Affected Resource(s)

  • auth0_client

Terraform Configuration Files

Expected Behavior

When the resource state in Auth0 is updated, the terraform state is updated.

Actual Behavior

The resource state in Auth0 is updated, but the terraform state is not modified.

Steps to Reproduce

  1. Create a auth0_client with a description
  2. Update the description with an apply
  3. Do another plan and see that the state is not clean
@nrmitchi
Copy link
Author

Looking further, this seems to only occur when the new description is missing/empty/null.

I suspect this may be the same root cause as #289 (json:",omitempty").

@alexkappa
Copy link
Owner

Thanks for reporting @nrmitchi, I can confirm the issue occurs when changing a value to its "zero" value (in this case ""). See this gist on how I've verified: https://gist.github.com/alexkappa/adca2fbae286dabe1fcfce5e2682c544.

I am not sure however how this provider is supposed to handle this. Internally we rely on Terraform's ResourceData.GetOk method to check whether the value of description has been set to a non zero value, which states:

GetOk returns the data for the given key and whether or not the key has been set to a non-zero value at some point.

I wonder what "at some point" means in this context, because to me it sounds like after being set to a non-zero initially, subsequent calls to GetOk should return true.

@sergiught
Copy link
Collaborator

This relates to several other issues that are present within the provider and I have captured this along with the others within auth0/terraform-provider-auth0#14.

As this repo has moved over at https://github.com/auth0/terraform-provider-auth0 please open new issues over there from now on.

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

No branches or pull requests

3 participants