Hi, I have a stack deploying a component resource ...
# typescript
r
Hi, I have a stack deploying a component resource of type
NetworkSecurityGroup
containing 3 Azure network security rules. I want to export each network security rule as an output. like so :
Copy code
const nsg = new NetworkSecurityGroup('nsg', nsgArgs)
export const nsgResource = nsg.group
export const port1234Rule = nsg.rules.find(r => {
    return r.rule.name.get() === 'Deny_Outbound_Port1234'
})
export const consulRule = nsg.rules.find(r => {
    return r.rule.name.get() === 'Allow_Inbound_Vnet_Consul'
})
export const sshRule = nsg.rules.find(r => {
    return r.rule.name.get() === 'Allow_Inbound_SSH'
})
But I'm getting this error :
Copy code
pulumi:pulumi:Stack (azure-network-security-group-ci):
    error: Running program '/home/mathieu/git/pulumi-azure-network-security-group/tests/stack' failed with an unhandled exception:
    Error: Cannot call '.get' during update or preview.
    To manipulate the value of this Output, use '.apply' instead.
How can I get the specific rule I want out of the collection of rules from an
apply()
call ? Or, is there a better way to do this ? Sorry if this is a silly question, I'm fairly new to TypeScript.