azure::network-security-group

Creates a network security group.

Example

azure::network-security-group network-security-group-example
     name: "network-security-group-example"
     resource-group: $(azure::resource-group resource-group-network-security-group-example)

     rule
         name: "Port_8080"
         inbound-rule: true
         allow-rule: true
         from-addresses: [
             "8080"
         ]
         from-ports: [
             "*"

         ]
         to-addresses: [
             "8080"
         ]
         to-ports: [
             "*"
         ]
         priority: 100
         protocol: "all"
     end

     tags: {
         Name: "network-security-group-example"
     }
end

Attributes

Attribute Description
name Name of the Network Security Group. (Required)
resource-group The Resource Group under which the Network Security Group would reside. (Required)
rule set subresource

Inbound and Outbound rules for the Network Security Group.

name
Name of the Network Security Rule. (Required)
inbound-rule
Set Network Security Rule type as inbound or outbound. Defaults to true i.e inbound.
allow-rule
Set Network Security Rule to allow or block traffic. Defaults to true i.e allow.
from-addresses set
A list of source addresses for the Network Security Rule to work. Required if from-Application-Security-Group is not set.
from-ports set
A list of source ports for the Network Security Rule to work. (Required)
to-addresses set
A list of destination addresses for the Network Security Rule to work. Required if to-Application-Security-Group is not set.
to-ports set
A list of destination ports for the Network Security Rule to work. (Required)
from-application-security-group
Source Application Security Group for the Network Security Rule. Required if from-Addresses not set.
to-application-security-group
Destination Application Security Group for the Network Security Rule. Required if to-Addresses not set.
description
Description for the Network Security Rule.
priority
Priority for the Network Security Rule. Valid values are between 100 to 4096. (Required)
protocol
Protocol for the Network Security Rule. Defaults to all. Valid values are all, tcp or udp.
tags map The associated tags for the Network Security Group.

Outputs

Attribute Description
id The ID of the Network Security Group.