adorable-gpu-9826803/23/2022, 12:20 PM
, how do I make them visible on the resource object?
echoing-dinner-1953103/23/2022, 3:39 PM
adorable-gpu-9826803/23/2022, 3:40 PM
echoing-dinner-1953103/23/2022, 3:46 PM
args is normally an object coming in as a constructor parameter, but rather than passing that parameter straight through to
super(provider, name, args, opts);
make a new object which has declares all the inputs (taking the value from
) and all the outputs but just setting them to undefined. Then pass that object to
. The runtime will then iterate that object and set properties on the resource itself based on the names. For typescript you'll also want to declare those properties in the resource class with something like:
but those typings annotations aren't available at runtime for the framework to inspect, thus the args trickery.
public readonly outputProperty: pulumi.Output<number>;
adorable-gpu-9826803/23/2022, 3:46 PM
echoing-dinner-1953103/23/2022, 3:47 PM
the result of that will be passed as the inputs for
, so if you want values from there in your final result just make you thread it through create/update from ins to outs.
adorable-gpu-9826803/23/2022, 3:48 PM
echoing-dinner-1953103/23/2022, 4:10 PM