Skip to content

Think-Cube/terraform-azure-network-security-group

Repository files navigation

Requirements

Name Version
terraform >= 1.6.4
azurerm 3.105.0

Providers

Name Version
azurerm 3.105.0

Resources

Name Type
azurerm_network_security_group.main resource
azurerm_network_security_rule.main resource
azurerm_subnet_network_security_group_association.main resource
azurerm_client_config.current data source
azurerm_resource_group.main data source

Inputs

Name Description Type Default Required
associate_with_subnet Controls whether the Network Security Group should be associated with a subnet. When set to true, an association with the specified subnet is created; when set to false, no subnet association is established. bool false no
default_tags A mapping of tags to assign to the resource. map(any)
{
"ManagedByTerraform": "True"
}
no
environment Variable that defines the name of the environment. string "dev" no
network_security_group_list List of security_rule objects representing security rules, as defined below. map(any)
{
"AllowHTTPAndHTTPS": {
"access": "Allow",
"destination_address_prefix": "10.1.0.0/16",
"destination_port_range": "80,443",
"direction": "Inbound",
"priority": "1001",
"protocol": "Tcp",
"source_address_prefix": "192.168.1.0/24",
"source_port_range": "*"
}
}
no
network_security_group_name Specifies the name of the network security group. Changing this forces a new resource to be created. string n/a yes
region Region in which resources are deployed. string "weu" no
resource_group_location Specifies the supported Azure location where the resource exists. Changing this forces a new resource to be created. any n/a yes
resource_group_name The name of the resource group in which to create the network security group. Changing this forces a new resource to be created. any n/a yes
subnet_id The ID of the Subnet. Changing this forces a new resource to be created. string "" no

Outputs

Name Description
network_security_group_id The ID of the NSG
network_security_group_name The name of the NSG
network_security_group_resource_group_name The name of the resource group the nsg is in
network_security_group_rules List of network security rules
network_security_group_subnet_association Information about the subnet association with the Network Security Group.