Can StackReference outputs only be simple strings ...
# typescript
q
Can StackReference outputs only be simple strings or can they be complex types? If they can be complex, how do I convert it to a strong type? I have a collection of base azure.types.input.network.NetworkSecurityGroupSecurityRule[] that I export from my core stack and want that available in my dev/test stacks
l
running
pulumi stack output --json
will give you the serialized outputs. You can experiment with parsing them from there. You can probably start with
JSON.parse()
q
I meant more in code but figured it out:
Copy code
const infra = new pulumi.StackReference(`[account]/core/dev`);
let groups = infra.getOutput("rdpRules");
var finalGroups = groups.apply<azure.types.input.network.NetworkSecurityGroupSecurityRule[]>(g => {
    g.push(allowHttp);
    g.push(denyHttp);
    return g
});