Skip to content

avidhara/terraform-azurerm-nsg

Repository files navigation

Terraform module for Azure Network Security Group

How to use it as a module

module "nsg" {
  source  = "foss-cafe/nsg/azurerm"
  version = "1.0.1"
  name                = "terraform-test-nsg"
  location            = "East US"
  resource_group_name = "terraform-test"
}

Requirements

Name Version
terraform >= 0.13.1
azurerm >= 3.0.0

Providers

Name Version
azurerm >= 3.0.0

Modules

No modules.

Resources

Name Type
azurerm_network_security_group.this resource
azurerm_network_security_rule.this resource
azurerm_subnet_network_security_group_association.this resource

Inputs

Name Description Type Default Required
associate_nsg (Optional) Do you want to associate nsg with subnet bool false no
create_nsg (Optional) Do you want ot create Network secuirty group bool true no
custom_nsg_rules (Optional) Any Custom NSG rules you want to add any {} no
location (Required) Specifies the supported Azure location where the resource exists. Changing this forces a new resource to be created. string n/a yes
name (Required) Specifies the name of the network security group. Changing this forces a new resource to be created. string n/a yes
resource_group_name (Required) The name of the resource group in which to create the network security group. Changing this forces a new resource to be created. string "type" no
security_rule (Optional) List of objects representing security rules any
[
{
"access": "Allow",
"description": "Outbound 443",
"destination_address_prefixes": [
"0.0.0.0/0"
],
"destination_port_ranges": [
443
],
"direction": "Outbound",
"name": "outbound-443",
"priority": "100",
"protocol": "Tcp",
"source_address_prefixes": [
"0.0.0.0/0"
],
"source_port_ranges": [
443
]
},
{
"access": "Allow",
"description": "Outbound 80",
"destination_address_prefixes": [
"0.0.0.0/0"
],
"destination_port_ranges": [
80
],
"direction": "Outbound",
"name": "outbound-80",
"priority": "101",
"protocol": "Tcp",
"source_address_prefixes": [
"0.0.0.0/0"
],
"source_port_ranges": [
80
]
},
{
"access": "Allow",
"description": "Outbound 53",
"destination_address_prefixes": [
"0.0.0.0/0"
],
"destination_port_ranges": [
53
],
"direction": "Outbound",
"name": "outbound-53",
"priority": "102",
"protocol": "Udp",
"source_address_prefixes": [
"0.0.0.0/0"
],
"source_port_ranges": [
53
]
},
{
"access": "Allow",
"description": "Inbound 443",
"destination_address_prefixes": [
"0.0.0.0/0"
],
"destination_port_ranges": [
443
],
"direction": "Inbound",
"name": "inbound-443",
"priority": "100",
"protocol": "Tcp",
"source_address_prefixes": [
"0.0.0.0/0"
],
"source_port_ranges": [
443
]
},
{
"access": "Allow",
"description": "Inbound 80",
"destination_address_prefixes": [
"0.0.0.0/0"
],
"destination_port_ranges": [
80
],
"direction": "Inbound",
"name": "inbound-80",
"priority": "101",
"protocol": "Tcp",
"source_address_prefixes": [
"0.0.0.0/0"
],
"source_port_ranges": [
80
]
},
{
"access": "Allow",
"description": "Inbound 53",
"destination_address_prefixes": [
"0.0.0.0/0"
],
"destination_port_ranges": [
53
],
"direction": "Inbound",
"name": "inbound-53",
"priority": "102",
"protocol": "Udp",
"source_address_prefixes": [
"0.0.0.0/0"
],
"source_port_ranges": [
53
]
}
]
no
subnet_id (Optional) The ID of the Subnet. Changing this forces a new resource to be created. string null no
tags (Optional) A mapping of tags to assign to the resource. map(string) {} no

Outputs

No outputs.