-
Notifications
You must be signed in to change notification settings - Fork 12
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
Failed marshaling of arguments with nested structs of input types #270
Comments
I'm not 100% sure on this, but I wonder if that error isn't coming from the fact that |
Yeah plain values are fine but Input/Output types don't work in nested structs. Unfortunately the value I am passing in is in reality is a Pulumi.StringOutput that is not known until a dependent resource is created. |
@MMartyn The error message looks like the marshaling code is having issues with inputs vs outputs. Can you try marking type NestedThing struct {
bar string `pulumi:"bar"`
- baz Pulumi.StringInput `pulumi:"baz"`
+ baz Pulumi.StringOutput `pulumi:"baz"`
} Do you see the same error message? Also, I'm pretty sure that nothing will work right for un-exported fields ( |
My bad, I messed up the capitalization when writing the example for the ticket. But know that the fields are properly capitalized in the real code. |
Edited example to show proper capitalization to match the real world |
What happened?
I am not sure if this error is expected and is the same as referenced here https://github.com/pulumi/pulumi-go-provider/blob/main/examples/random-login/main.go#L41, but essentially we have component arguments that contain a nested struct that has a pulumi.StringInput. The provider compiles successfully, but when you use it it throws a
error: an unhandled error occurred: waiting for RPCs: rpc error: code = Unknown desc = waiting for RPCs: cannot marshal an input of type pulumi.StringOutput with element type string as a value of type pulumi.StringInput
Example
The following will throw the marshal error:
If we remove the
CustomComponentArgs
from theCustomComponentState
struct and make the comp justcomp := &CustomComponentState{}
it will run without error. I am unsure of any errors that will result from removing this from the state as in the example this is how I see it working.Output of
pulumi about
CLI
Version 3.131.0
Go Version go1.23.0
Go Compiler gc
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: