Created
May 10, 2017 12:42
-
-
Save tombuildsstuff/5037aa929df7913033883ed48c6a77c2 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
resource "azurerm_resource_group" "test" { | |
name = "tharvey-dev7986" | |
location = "West Europe" | |
} | |
resource "azurerm_network_security_group" "test" { | |
name = "tharvey-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 = "tharvey-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 = "tharvey-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 = "tharveydev7986nw" | |
address_space = ["10.0.0.0/16"] | |
resource_group_name = "${azurerm_resource_group.test.name}" | |
location = "${azurerm_resource_group.test.location}" | |
subnet { | |
name = "tharveydev7986sn2" | |
address_prefix = "10.0.3.0/24" | |
security_group = "${azurerm_network_security_group.test.id}" | |
} | |
} | |
resource "azurerm_subnet" "first" { | |
name = "tharveydev7986sn1" | |
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_subnet" "second" { | |
name = "tharveydev7986sn3" | |
resource_group_name = "${azurerm_resource_group.test.name}" | |
virtual_network_name = "${azurerm_virtual_network.test.name}" | |
address_prefix = "10.0.4.0/24" | |
} | |
resource "azurerm_network_interface" "test1" { | |
name = "tharveydev7986ni1" | |
location = "${azurerm_resource_group.test.location}" | |
resource_group_name = "${azurerm_resource_group.test.name}" | |
ip_configuration { | |
name = "testconfiguration1" | |
subnet_id = "${azurerm_subnet.first.id}" | |
private_ip_address_allocation = "dynamic" | |
} | |
tags { | |
environment = "staging" | |
} | |
} | |
resource "azurerm_network_interface" "test2" { | |
name = "tharveydev7986ni2" | |
location = "${azurerm_resource_group.test.location}" | |
resource_group_name = "${azurerm_resource_group.test.name}" | |
ip_configuration { | |
name = "testconfiguration1" | |
subnet_id = "${azurerm_subnet.first.id}" | |
private_ip_address_allocation = "dynamic" | |
} | |
tags { | |
environment = "staging" | |
} | |
} | |
resource "azurerm_network_interface" "test3" { | |
name = "tharveydev7986ni3" | |
location = "${azurerm_resource_group.test.location}" | |
resource_group_name = "${azurerm_resource_group.test.name}" | |
ip_configuration { | |
name = "testconfiguration1" | |
subnet_id = "${azurerm_subnet.second.id}" | |
private_ip_address_allocation = "dynamic" | |
} | |
tags { | |
environment = "staging" | |
} | |
} | |
resource "azurerm_network_interface" "test4" { | |
name = "tharveydev7986ni4" | |
location = "${azurerm_resource_group.test.location}" | |
resource_group_name = "${azurerm_resource_group.test.name}" | |
ip_configuration { | |
name = "testconfiguration1" | |
subnet_id = "${azurerm_subnet.second.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