orange-dog-73995
10/05/2020, 12:20 PMnew SubnetNetworkSecurityGroupAssociation("assc1", new SubnetNetworkSecurityGroupAssociationArgs
{
NetworkSecurityGroupId = nsg.Id,
SubnetId = Subnet1.Id
});tall-librarian-49374
10/05/2020, 12:25 PMSubnet
has a NetworkSecurityGroup
property. You set its Id
to the NSG ID.orange-dog-73995
10/05/2020, 1:36 PMvar subnet1 = new Subnet("domain", new Pulumi.AzureNextGen.Network.Latest.SubnetArgs
{
ResourceGroupName = _resourceGroup.Name,
VirtualNetworkName = network.Name,
AddressPrefixes = "10.10.1.0/24",
NetworkSecurityGroup = _nsg,
});tall-librarian-49374
10/05/2020, 1:44 PMvar subnet1 = new Subnet("domain", new Pulumi.AzureNextGen.Network.Latest.SubnetArgs
{
ResourceGroupName = _resourceGroup.Name,
VirtualNetworkName = network.Name,
AddressPrefixes = "10.10.1.0/24",
NetworkSecurityGroup = new NetworkSecurityGroupArgs
{
Id = nsg.Id
},
});
orange-dog-73995
10/05/2020, 1:45 PMtall-librarian-49374
10/05/2020, 1:45 PMNetworkSecurityGroupArgs
is from the Inputs
namespaceorange-dog-73995
10/05/2020, 1:50 PM