Skip to content

Instantly share code, notes, and snippets.

@magodo
Created June 16, 2020 02:54
Show Gist options
  • Save magodo/2b7eb3896c7843ca5e56d144b69870d0 to your computer and use it in GitHub Desktop.
Save magodo/2b7eb3896c7843ca5e56d144b69870d0 to your computer and use it in GitHub Desktop.
NSR Perf
provider "azurerm" {
features {}
}
variable "location" {}
locals {
prefix = "benchmark"
}
resource "azurerm_resource_group" "example" {
name = "${local.prefix}-rg"
location = var.location
}
resource "azurerm_network_security_group" "example" {
name = "${local.prefix}-nsg"
location = azurerm_resource_group.example.location
resource_group_name = azurerm_resource_group.example.name
}
resource "azurerm_network_security_rule" "example" {
count = 100
name = "${local.prefix}-nsr-${count.index}"
priority = 1000 + count.index
direction = "Outbound"
access = "Allow"
protocol = "Tcp"
source_port_range = "*"
destination_port_range = "*"
source_address_prefix = "*"
destination_address_prefix = "*"
resource_group_name = azurerm_resource_group.example.name
network_security_group_name = azurerm_network_security_group.example.name
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment