Skip to content

Instantly share code, notes, and snippets.

@tombuildsstuff
Created April 13, 2017 19:15
Show Gist options
  • Save tombuildsstuff/a007598ece744015497fc77cbae24e6e to your computer and use it in GitHub Desktop.
Save tombuildsstuff/a007598ece744015497fc77cbae24e6e to your computer and use it in GitHub Desktop.
resource "azurerm_resource_group" "test" {
name = "test-dev7986"
location = "West Europe"
}
resource "azurerm_network_security_group" "test" {
name = "test-dev7986nsg"
location = "${azurerm_resource_group.test.location}"
resource_group_name = "${azurerm_resource_group.test.name}"
security_rule {
name = "test123"
priority = 100
direction = "Inbound"
access = "Allow"
protocol = "Tcp"
source_port_range = "*"
destination_port_range = "*"
source_address_prefix = "*"
destination_address_prefix = "*"
}
tags {
environment = "Production"
}
}
resource "azurerm_network_security_rule" "test" {
name = "test-dev7986nsr"
priority = 100
direction = "Outbound"
access = "Allow"
protocol = "Tcp"
source_port_range = "*"
destination_port_range = "*"
source_address_prefix = "*"
destination_address_prefix = "*"
resource_group_name = "${azurerm_resource_group.test.name}"
network_security_group_name = "${azurerm_network_security_group.test.name}"
}
resource "azurerm_public_ip" "test" {
name = "test-dev7986pip"
location = "${azurerm_resource_group.test.location}"
resource_group_name = "${azurerm_resource_group.test.name}"
public_ip_address_allocation = "Dynamic"
tags {
environment = "Production"
}
}
resource "azurerm_virtual_network" "test" {
name = "testdev7986nw"
address_space = ["10.0.0.0/16"]
resource_group_name = "${azurerm_resource_group.test.name}"
location = "${azurerm_resource_group.test.location}"
subnet {
name = "testdev7986sn2"
address_prefix = "10.0.3.0/24"
security_group = "${azurerm_network_security_group.test.id}"
}
}
resource "azurerm_subnet" "test" {
name = "testdev7986sn1"
resource_group_name = "${azurerm_resource_group.test.name}"
virtual_network_name = "${azurerm_virtual_network.test.name}"
address_prefix = "10.0.2.0/24"
}
resource "azurerm_network_interface" "test1" {
name = "testdev7986ni1"
location = "${azurerm_resource_group.test.location}"
resource_group_name = "${azurerm_resource_group.test.name}"
ip_configuration {
name = "testconfiguration1"
subnet_id = "${azurerm_subnet.test.id}"
private_ip_address_allocation = "dynamic"
}
tags {
environment = "staging"
}
}
resource "azurerm_network_interface" "test2" {
name = "testdev7986ni2"
location = "${azurerm_resource_group.test.location}"
resource_group_name = "${azurerm_resource_group.test.name}"
ip_configuration {
name = "testconfiguration1"
subnet_id = "${azurerm_subnet.test.id}"
private_ip_address_allocation = "dynamic"
}
tags {
environment = "staging"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment