Skip to main content
Providers

NetworkSecurityGroup

A resource of the Azure provider, version 0.3.0, in its Networking group. Import it with:

import NetworkSecurityGroup from "azure/networking"

Example

resource NetworkSecurityGroup example {
    name          = "example-value"
    resourceGroup = "example-value"
    location      = "example-value"
    securityRules = "..."
    tags          = "..."
}

Properties

Set by your code in the resource block. A required one must be set; any other you leave out takes the value under Default, if it has one.

NameTypeDefaultRequiredDescription
namestring—NoThe name of the network security group
resourceGroupstring—NoThe Azure resource group name
locationstring—NoThe Azure region/location
securityRulesany[]—NoList of security rules. Each rule defines allowed or denied traffic
tagsobject—NoTags to apply to the NSG

Set by Azure after the resource is created: your code can read them but not set them. An importable one identifies an existing resource.

NameTypeImportableDescription
idstringYesThe Azure resource ID
provisioningStatestringNoThe provisioning state
resourceGuidstringNoThe resource GUID
networkInterfaceIdsany[]NoList of network interfaces associated with this NSG
subnetIdsany[]NoList of subnets associated with this NSG

On this page