An open API service indexing awesome lists of open source software.

https://github.com/data-platform-hq/terraform-azurerm-network-security-group

Terraform module for creation of Azure Network Security Group
https://github.com/data-platform-hq/terraform-azurerm-network-security-group

azurerm network-security-groups terraform-module

Last synced: 4 months ago
JSON representation

Terraform module for creation of Azure Network Security Group

Awesome Lists containing this project

README

        

# Azure Network Security Group Terraform module
Terraform module for creation Azure Network security group

## Usage
This module provides an ability to deploy Azure Network security group, Below is an example on how to create nsg

```hcl
locals {
security_rules = [{
name = "workspaces_UseOnly_databricks-worker-to-worker-inbound"
description = "Required for worker nodes communication within a cluster."
priority = 100
direction = "Inbound"
access = "Allow"
protocol = "*"
source_port_range = "*"
destination_port_range = "*"
source_address_prefix = "VirtualNetwork"
destination_address_prefix = "VirtualNetwork"
}]
}

module "network_security_group" {
source = "data-platform-hq/terraform-azurerm-network-security-group

nsg_name = "example-name"
location = "eastus"
resource_group = "example-rg"
security_rules = local.security_rules
tags = {
environment = "example"
}
}
```

## Requirements

| Name | Version |
|------|---------|
| [terraform](#requirement\_terraform) | >= 1.0.0 |
| [azurerm](#requirement\_azurerm) | >= 4.0.1 |

## Providers

| Name | Version |
|------|---------|
| [azurerm](#provider\_azurerm) | >= 4.0.1 |

## Modules

No modules.

## Resources

| Name | Type |
|------|------|
| [azurerm_network_security_group.this](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/network_security_group) | resource |

## Inputs

| Name | Description | Type | Default | Required |
|------|-------------|------|---------|:--------:|
| [location](#input\_location) | Specifies the supported Azure location where the resource exists | `string` | n/a | yes |
| [nsg\_name](#input\_nsg\_name) | Network Security Group name | `string` | n/a | yes |
| [resource\_group](#input\_resource\_group) | The name of the resource group in which resources is created | `string` | n/a | yes |
| [security\_rules](#input\_security\_rules) | List of objects representing security rules |

list(object({
name = string
priority = number
direction = string
access = string
protocol = string
description = optional(string, null)
source_port_range = optional(string, null)
source_port_ranges = optional(list(string), [])
destination_port_range = optional(string, null)
destination_port_ranges = optional(list(string), [])
source_address_prefix = optional(string, null)
source_address_prefixes = optional(list(string), [])
destination_address_prefix = optional(string, null)
destination_address_prefixes = optional(list(string), [])
}))
| `[]` | no |
| [tags](#input\_tags) | A mapping of tags to assign to the resource | `map(string)` | `{}` | no |

## Outputs

| Name | Description |
|------|-------------|
| [id](#output\_id) | The ID of the Network Security Group |

## License

Apache 2 Licensed. For more information please see [LICENSE](https://github.com/data-platform-hq/terraform-azurerm-network-security-group/blob/main/LICENSE)