pulumi / pulumi-dotnet

.NET support for Pulumi
Apache License 2.0
27 stars 25 forks source link

Calling RegisterOutput in a Component Resource is not working with Output that contains an OutputType #409

Open jkerken opened 3 days ago

jkerken commented 3 days ago

As per documentation we added a RegisterOutputs() call to the end of our component resources.

If you have an output value like this:

    [OutputType]
    public sealed class ComplexOutput
    {
        public readonly string Name;

        [OutputConstructor]
        private ComplexOutput(string name)
          Name = name;
        }
    }

And use this in a component resource

public sealed class MyComponentResource: ComponentResource
{
    public MyComponentResource(string name, Args args, ComponentResourceOptions? options = null)
        : base("myType" name, args, options)
    {
      Output = Output.Create(new ComplexOutput("someValue"))
      RegisterOutputs()
    }

    [Output("output")]
    public Output<ComplexOutput> Output { get; init; }
}

A an exception will be raised "DatacenterOutput is not a supported argument type" in Pulumi.Serialization.Serializer.SerializeAsync
justinvp commented 3 days ago

Similar to #377