-
Notifications
You must be signed in to change notification settings - Fork 43
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
Computed property incorrectly marked Required #1239
Comments
It looks like output properties can only be required if they are carried over from required input properties. All pulumi-terraform-bridge/pkg/tfgen/generate.go Line 578 in f7114fc
I'll see what's going on. |
@iwahbe not sure if pulumi/pulumi-gcp#1125 is a consequence of this issue as well. The required properties in that issue are not computed, though. |
pulumi-terraform-bridge/pkg/tfgen/generate.go Line 577 in 9081d29
I believe pulumi-terraform-bridge/pkg/tfgen/generate.go Line 582 in 224dff6
I edited it but got quite a big diff in Is there a way to get the tf schema and see details about these properties? |
After discussing with @t0yv0 it looks like we can not make this change as it would be very disruptive. For any provider authors who know about specific computed properties which can be null, then they should use |
Cannot close issue:
Please fix these problems and try again. |
What happened?
When doing a routine pulumi-oci update pulumi/pulumi-oci#164 schema tools noticed that a global_logging_level property is required. Simplified schema:
And
This property is Computed in TF which means that only provider sets it. In Pulumi these are known as Output properties. Currently the schema correctly does not generate an inputProperties entry for it but only a properties (output properties) entry. However the schema lists it in the "required" list, tripping up schema-tools to emit a warning.
We definitely want to avoid the warning but besides simply fixing schema-tools wanted to make sure we fix the root cause and possible mis-understanding here.
In TF properties can be Computed or they can be Computed+Optional. Being Computed only does not make them required, in a sense that provider can still emit null values for them. So languages that track optionality should emit optional/nullable types for these. We need to track this down and perhaps the fix is to not put Computed properties in "required" list in schema ever, whether they are Optional or not.
Expected Behavior
No warning when Computed properties are added.
Steps to reproduce
See above.
Output of
pulumi about
N/A
Additional context
No response
Contributing
Vote on this issue by adding a 👍 reaction.
To contribute a fix for this issue, leave a comment (and link to your pull request, if you've opened one already).
The text was updated successfully, but these errors were encountered: