AzBuilder / terraform-provider-terrakube

Terraform provider for Terrakube
Apache License 2.0
4 stars 3 forks source link

Provider produced inconsistent result after apply #36

Closed adamlc closed 4 months ago

adamlc commented 4 months ago

When creating a sensitive terrakube_workspace_variable resource I get the following error from Terraform:

Error: Provider produced inconsistent result after apply

When applying changes to
terrakube_workspace_variable.twilio_auth_token,
provider "provider[\"registry.terraform.io/azbuilder/terrakube\"]" produced
an unexpected new value: .value: inconsistent values for sensitive
attribute.

This is a bug in the provider, which should be reported in the provider's
own issue tracker.

I'm using version v0.4.1 of the provider and Terraform v1.6.6

Edit: Just to add non-sensitive variables work fine

alfespa17 commented 4 months ago

I will do some test and I will check what is the root cause of the issue. I guess is related that the API does not return the "secret value" when the variable is mark as "sensitive"

adamlc commented 4 months ago

I should add I upgraded terrakube to 2.21.0-beta.5 just to confirm it wasn't an issue with an old version :)

alfespa17 commented 4 months ago

I should add I upgraded terrakube to 2.21.0-beta.5 just to confirm it wasn't an issue with an old version :)

The issue is more related to the API response when you mark a value as "sensitive" the Terrakube API does not return the "secret value" and the provider validate the return API response against the current terraform state, I will need to add some small validation there that should fix your issue