-
Notifications
You must be signed in to change notification settings - Fork 75
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
CLI-3467: Downstream Terraform Resources of confluent_schema.<name>.schema
Throw invalid new value for...
(2.20.0)
#595
Comments
confluent_schema
To Include New Values After Applyconfluent_schema.<name>.schema
Throw invalid new value for...
(2.20.0)
@matthew-coudert-cko thanks for creating this issue! It could be a very tricky issue to resolve. Out of curiosity, did you try using the confluent_schema data source instead?
|
confluent_schema.<name>.schema
Throw invalid new value for...
(2.20.0)confluent_schema.<name>.schema
Throw invalid new value for...
(2.20.0)
We can use the To give you some context for our use case we (in the same stack):
What we currently do is show the "plan" of the table that its going to generate from the given schema (so they can make changes before they deploy and we can raise breaking changes (invalid field names etc...) as part of the plan). If we use the data source instead we can't show the planned "effect" of their changes (as it won't be deployed yet). Hopefully that makes sense! |
Hi @matthew-coudert-cko , I wanted to share that this issue will require some time to investigate. If this is blocking you in some way, please reach out to Confluent Support and file a ticket. |
Thanks for letting me know! Let me know if I can be helpful in anyway. |
Summary
The Confluent Terraform provider (version 2.20.0) modifies the whitespace to "normalize" Protobuf schemas string during the
terraform apply
process.Since this provider was made using the provider plugin v1, this change to a non-computed value in the schema is allowed. If any "downstream" resources try to use this data as an input (via
confluent_schema.schema.schema
) then the downstream provider crashes as a "required" input does not match the value during plan time.I chose the
local
provider to provide a reproducible example (below), but for other use cases this can cause real problems.Steps to Reproduce
Create
main.tf
:Create
reproduce.proto
:Run
terraform init
:Run
terraform apply
:Expected Behavior
The
local_file.test
resource should successfully create theoutput_schema.txt
file with the exact content ofreproduce.proto
.Actual Behavior
The
terraform apply
command fails with the following error:The Confluent provider alters the whitespace in the
schema
string, specifically removing the extra spaces around the field number1
in thereproduce.proto
message. This difference in whitespace causes thelocal
provider to detect a change in thecontent
attribute, leading to the "inconsistent final plan" error.Terraform and Provider Versions
I was able to reproduce this bug on 2.19.0 and 2.9.0 as well.
Mitigations
proto
file is exactly normalized than this succeeds (as confluent doesn't make any changes to it). I don't think this is something we can expect users to do (especially as the error isn't clear about what's going on).The text was updated successfully, but these errors were encountered: