# typescript


10/27/2019, 9:57 PM
Hi, I have a stack deploying a component resource of type
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 =
export const port1234Rule = nsg.rules.find(r => {
    return === 'Deny_Outbound_Port1234'
export const consulRule = nsg.rules.find(r => {
    return === 'Allow_Inbound_Vnet_Consul'
export const sshRule = nsg.rules.find(r => {
    return === '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
call ? Or, is there a better way to do this ? Sorry if this is a silly question, I'm fairly new to TypeScript.