rapid-ram-37207
10/27/2019, 9:57 PMNetworkSecurityGroup
containing 3 Azure network security rules.
I want to export each network security rule as an output. like so :
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 :
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.No matter how you like to participate in developer communities, Pulumi wants to meet you there. If you want to meet other Pulumi users to share use-cases and best practices, contribute code or documentation, see us at an event, or just tell a story about something cool you did with Pulumi, you are part of our community.
Powered by