Is it okay to "output" resources from `ComponentRe...
# general
a
Is it okay to "output" resources from
ComponentResources
so that they can be passed elsewhere in the stack? For example:
Copy code
[Output]
    public Network ProjectNetwork { get; set; }

    // later...

        ProjectNetwork = new Network(
            "project",
            options: new()
            {
                Parent = this,
                DependsOn =
                {
                    computeService,
                },
            },
            args: new()
            {
                Name = "blablabla",
                AutoCreateSubnetworks = true,
            }
        );
g
You can certainly do that however my preference is to expose resources from component resources using public readonly fields instead of outputs.
a
Actually yeah, I get an error when it's not an instance of
Output<...>
.
I'll definitely switch them to public readonly 🙂
Or I guess I can do
{get; init;}
😉