Commit 0a878b91 authored by John Jarvis's avatar John Jarvis Committed by Victor Lopez

Jarv/preprod

parent acc997a5
variable "images" {
type = "map"
default = {
api = "api-pre-2017-08-25_11-20-19"
git = "git-pre-2017-08-25_12-08-27"
web = "web-pre-2017-08-25_15-29-07"
}
}
This diff is collapsed.
variable "location" {}
variable "vnet_name" {}
variable "vnet_resource_group" {}
variable "subnet_cidr" {}
resource "azurerm_resource_group" "ApiInternalPre" {
name = "ApiInternalPre"
location = "${var.location}"
}
resource "azurerm_network_security_group" "ApiInternalPre" {
name = "ApiInternalPre"
location = "${var.location}"
resource_group_name = "${azurerm_resource_group.ApiInternalPre.name}"
}
resource "azurerm_network_security_rule" "https" {
name = "https"
priority = 145
direction = "Inbound"
access = "Allow"
protocol = "TCP"
source_port_range = "*"
source_address_prefix = "10.128.0.0/12"
destination_port_range = "443"
destination_address_prefix = "*"
resource_group_name = "${azurerm_resource_group.ApiInternalPre.name}"
network_security_group_name = "${azurerm_network_security_group.ApiInternalPre.name}"
}
resource "azurerm_network_security_rule" "ssh-from-vpn1-ext" {
name = "ssh-from-vpn1-ext"
priority = 146
direction = "Inbound"
access = "Allow"
protocol = "TCP"
source_port_range = "*"
source_address_prefix = "52.177.194.133"
destination_port_range = "22"
destination_address_prefix = "*"
resource_group_name = "${azurerm_resource_group.ApiInternalPre.name}"
network_security_group_name = "${azurerm_network_security_group.ApiInternalPre.name}"
}
resource "azurerm_network_security_rule" "ssh-from-vpn2-ext" {
name = "ssh-from-vpn2-ext"
priority = 147
direction = "Inbound"
access = "Allow"
protocol = "TCP"
source_port_range = "*"
source_address_prefix = "52.177.192.239"
destination_port_range = "22"
destination_address_prefix = "*"
resource_group_name = "${azurerm_resource_group.ApiInternalPre.name}"
network_security_group_name = "${azurerm_network_security_group.ApiInternalPre.name}"
}
resource "azurerm_network_security_rule" "ssh-from-internal" {
name = "ssh-from-internal"
priority = 148
direction = "Inbound"
access = "Allow"
protocol = "TCP"
source_port_range = "*"
source_address_prefix = "10.0.0.0/8"
destination_port_range = "22"
destination_address_prefix = "*"
resource_group_name = "${azurerm_resource_group.ApiInternalPre.name}"
network_security_group_name = "${azurerm_network_security_group.ApiInternalPre.name}"
}
resource "azurerm_network_security_rule" "ssh-from-vpn" {
name = "ssh-from-vpn"
priority = 149
direction = "Inbound"
access = "Allow"
protocol = "TCP"
source_port_range = "*"
source_address_prefix = "10.254.4.0/23"
destination_port_range = "22"
destination_address_prefix = "*"
resource_group_name = "${azurerm_resource_group.ApiInternalPre.name}"
network_security_group_name = "${azurerm_network_security_group.ApiInternalPre.name}"
}
resource "azurerm_network_security_rule" "ssh" {
name = "ssh"
priority = 150
direction = "Inbound"
access = "Deny"
protocol = "TCP"
source_port_range = "*"
source_address_prefix = "Internet"
destination_port_range = "22"
destination_address_prefix = "*"
resource_group_name = "${azurerm_resource_group.ApiInternalPre.name}"
network_security_group_name = "${azurerm_network_security_group.ApiInternalPre.name}"
}
resource "azurerm_network_security_rule" "prometheus" {
name = "prometheus"
priority = 151
direction = "Inbound"
access = "Allow"
protocol = "TCP"
source_port_range = "*"
source_address_prefix = "10.4.1.0/24"
destination_port_range = "9100"
destination_address_prefix = "*"
resource_group_name = "${azurerm_resource_group.ApiInternalPre.name}"
network_security_group_name = "${azurerm_network_security_group.ApiInternalPre.name}"
}
resource "azurerm_network_security_rule" "prometheus-gitaly" {
name = "prometheus-gitaly"
priority = 153
direction = "Inbound"
access = "Allow"
protocol = "TCP"
source_port_range = "*"
source_address_prefix = "10.4.1.0/24"
destination_port_range = "9236"
destination_address_prefix = "*"
resource_group_name = "${azurerm_resource_group.ApiInternalPre.name}"
network_security_group_name = "${azurerm_network_security_group.ApiInternalPre.name}"
}
resource "azurerm_subnet" "ApiInternalPre" {
name = "ApiInternalPre"
resource_group_name = "${var.vnet_resource_group}"
virtual_network_name = "${var.vnet_name}"
address_prefix = "${var.subnet_cidr}"
network_security_group_id = "${azurerm_network_security_group.ApiInternalPre.id}"
}
output "subnet_id" {
value = "${azurerm_subnet.ApiInternalPre.id}"
}
output "address_prefix" {
value = "${azurerm_subnet.ApiInternalPre.address_prefix}"
}
output "resource_group_name" {
value = "ApiInternalPre"
}
output "resource_group_id" {
value = "${azurerm_resource_group.ApiInternalPre.id}"
}
variable "location" {}
variable "vnet_name" {}
variable "vnet_resource_group" {}
variable "subnet_cidr" {}
resource "azurerm_resource_group" "ApiPre" {
name = "ApiPre"
location = "${var.location}"
}
resource "azurerm_network_security_group" "ApiPre" {
name = "ApiPre"
location = "${var.location}"
resource_group_name = "${azurerm_resource_group.ApiPre.name}"
}
resource "azurerm_network_security_rule" "http" {
name = "http"
priority = 140
direction = "Inbound"
access = "Allow"
protocol = "TCP"
source_port_range = "*"
source_address_prefix = "Internet"
destination_port_range = "80"
destination_address_prefix = "*"
resource_group_name = "${azurerm_resource_group.ApiPre.name}"
network_security_group_name = "${azurerm_network_security_group.ApiPre.name}"
}
resource "azurerm_network_security_rule" "https" {
name = "https"
priority = 145
direction = "Inbound"
access = "Allow"
protocol = "TCP"
source_port_range = "*"
source_address_prefix = "Internet"
destination_port_range = "443"
destination_address_prefix = "*"
resource_group_name = "${azurerm_resource_group.ApiPre.name}"
network_security_group_name = "${azurerm_network_security_group.ApiPre.name}"
}
resource "azurerm_network_security_rule" "ssh-from-vpn1-ext" {
name = "ssh-from-vpn1-ext"
priority = 146
direction = "Inbound"
access = "Allow"
protocol = "TCP"
source_port_range = "*"
source_address_prefix = "52.177.194.133"
destination_port_range = "22"
destination_address_prefix = "*"
resource_group_name = "${azurerm_resource_group.ApiPre.name}"
network_security_group_name = "${azurerm_network_security_group.ApiPre.name}"
}
resource "azurerm_network_security_rule" "ssh-from-vpn2-ext" {
name = "ssh-from-vpn2-ext"
priority = 147
direction = "Inbound"
access = "Allow"
protocol = "TCP"
source_port_range = "*"
source_address_prefix = "52.177.192.239"
destination_port_range = "22"
destination_address_prefix = "*"
resource_group_name = "${azurerm_resource_group.ApiPre.name}"
network_security_group_name = "${azurerm_network_security_group.ApiPre.name}"
}
resource "azurerm_network_security_rule" "ssh-from-internal" {
name = "ssh-from-internal"
priority = 148
direction = "Inbound"
access = "Allow"
protocol = "TCP"
source_port_range = "*"
source_address_prefix = "10.0.0.0/8"
destination_port_range = "22"
destination_address_prefix = "*"
resource_group_name = "${azurerm_resource_group.ApiPre.name}"
network_security_group_name = "${azurerm_network_security_group.ApiPre.name}"
}
resource "azurerm_network_security_rule" "ssh-from-vpn" {
name = "ssh-from-vpn"
priority = 149
direction = "Inbound"
access = "Allow"
protocol = "TCP"
source_port_range = "*"
source_address_prefix = "10.254.4.0/23"
destination_port_range = "22"
destination_address_prefix = "*"
resource_group_name = "${azurerm_resource_group.ApiPre.name}"
network_security_group_name = "${azurerm_network_security_group.ApiPre.name}"
}
resource "azurerm_network_security_rule" "ssh" {
name = "ssh"
priority = 150
direction = "Inbound"
access = "Deny"
protocol = "TCP"
source_port_range = "*"
source_address_prefix = "Internet"
destination_port_range = "22"
destination_address_prefix = "*"
resource_group_name = "${azurerm_resource_group.ApiPre.name}"
network_security_group_name = "${azurerm_network_security_group.ApiPre.name}"
}
resource "azurerm_network_security_rule" "prometheus" {
name = "prometheus"
priority = 151
direction = "Inbound"
access = "Allow"
protocol = "TCP"
source_port_range = "*"
source_address_prefix = "10.4.1.0/24"
destination_port_range = "9100"
destination_address_prefix = "*"
resource_group_name = "${azurerm_resource_group.ApiPre.name}"
network_security_group_name = "${azurerm_network_security_group.ApiPre.name}"
}
resource "azurerm_network_security_rule" "checkmk" {
name = "checkmk"
priority = 152
direction = "Inbound"
access = "Allow"
protocol = "TCP"
source_port_range = "*"
source_address_prefix = "52.28.130.79/32"
destination_port_range = "6556"
destination_address_prefix = "*"
resource_group_name = "${azurerm_resource_group.ApiPre.name}"
network_security_group_name = "${azurerm_network_security_group.ApiPre.name}"
}
resource "azurerm_network_security_rule" "prometheus-gitaly" {
name = "prometheus-gitaly"
priority = 153
direction = "Inbound"
access = "Allow"
protocol = "TCP"
source_port_range = "*"
source_address_prefix = "10.4.1.0/24"
destination_port_range = "9236"
destination_address_prefix = "*"
resource_group_name = "${azurerm_resource_group.ApiPre.name}"
network_security_group_name = "${azurerm_network_security_group.ApiPre.name}"
}
resource "azurerm_subnet" "ApiPre" {
name = "ApiPre"
resource_group_name = "${var.vnet_resource_group}"
virtual_network_name = "${var.vnet_name}"
address_prefix = "${var.subnet_cidr}"
network_security_group_id = "${azurerm_network_security_group.ApiPre.id}"
}
output "subnet_id" {
value = "${azurerm_subnet.ApiPre.id}"
}
output "address_prefix" {
value = "${azurerm_subnet.ApiPre.address_prefix}"
}
output "resource_group_name" {
value = "ApiPre"
}
output "resource_group_id" {
value = "${azurerm_resource_group.ApiPre.id}"
}
variable "location" {}
variable "vnet_name" {}
variable "vnet_resource_group" {}
variable "subnet_cidr" {}
resource "azurerm_resource_group" "ConsulPre" {
name = "ConsulPre"
location = "${var.location}"
}
resource "azurerm_network_security_group" "ConsulPre" {
name = "ConsulPre"
location = "${var.location}"
resource_group_name = "${azurerm_resource_group.ConsulPre.name}"
}
resource "azurerm_network_security_rule" "ssh-from-vpn1-ext" {
name = "ssh-from-vpn1-ext"
priority = 146
direction = "Inbound"
access = "Allow"
protocol = "TCP"
source_port_range = "*"
source_address_prefix = "52.177.194.133"
destination_port_range = "22"
destination_address_prefix = "*"
resource_group_name = "${azurerm_resource_group.ConsulPre.name}"
network_security_group_name = "${azurerm_network_security_group.ConsulPre.name}"
}
resource "azurerm_network_security_rule" "ssh-from-vpn2-ext" {
name = "ssh-from-vpn2-ext"
priority = 147
direction = "Inbound"
access = "Allow"
protocol = "TCP"
source_port_range = "*"
source_address_prefix = "52.177.192.239"
destination_port_range = "22"
destination_address_prefix = "*"
resource_group_name = "${azurerm_resource_group.ConsulPre.name}"
network_security_group_name = "${azurerm_network_security_group.ConsulPre.name}"
}
resource "azurerm_network_security_rule" "ssh-from-internal" {
name = "ssh-from-internal"
priority = 148
direction = "Inbound"
access = "Allow"
protocol = "TCP"
source_port_range = "*"
source_address_prefix = "10.0.0.0/8"
destination_port_range = "22"
destination_address_prefix = "*"
resource_group_name = "${azurerm_resource_group.ConsulPre.name}"
network_security_group_name = "${azurerm_network_security_group.ConsulPre.name}"
}
resource "azurerm_network_security_rule" "ssh-from-vpn" {
name = "ssh-from-vpn"
priority = 149
direction = "Inbound"
access = "Allow"
protocol = "TCP"
source_port_range = "*"
source_address_prefix = "10.254.4.0/23"
destination_port_range = "22"
destination_address_prefix = "*"
resource_group_name = "${azurerm_resource_group.ConsulPre.name}"
network_security_group_name = "${azurerm_network_security_group.ConsulPre.name}"
}
resource "azurerm_network_security_rule" "ssh" {
name = "ssh"
priority = 150
direction = "Inbound"
access = "Deny"
protocol = "TCP"
source_port_range = "*"
source_address_prefix = "Internet"
destination_port_range = "22"
destination_address_prefix = "*"
resource_group_name = "${azurerm_resource_group.ConsulPre.name}"
network_security_group_name = "${azurerm_network_security_group.ConsulPre.name}"
}
resource "azurerm_network_security_rule" "prometheus" {
name = "prometheus"
priority = 151
direction = "Inbound"
access = "Allow"
protocol = "TCP"
source_port_range = "*"
source_address_prefix = "10.4.1.0/24"
destination_port_range = "9100"
destination_address_prefix = "*"
resource_group_name = "${azurerm_resource_group.ConsulPre.name}"
network_security_group_name = "${azurerm_network_security_group.ConsulPre.name}"
}
resource "azurerm_network_security_rule" "checkmk" {
name = "checkmk"
priority = 152
direction = "Inbound"
access = "Allow"
protocol = "TCP"
source_port_range = "*"
source_address_prefix = "52.28.130.79/32"
destination_port_range = "6556"
destination_address_prefix = "*"
resource_group_name = "${azurerm_resource_group.ConsulPre.name}"
network_security_group_name = "${azurerm_network_security_group.ConsulPre.name}"
}
resource "azurerm_network_security_rule" "consul-8500" {
name = "consul-8500"
priority = 160
direction = "Inbound"
access = "Allow"
protocol = "TCP"
source_port_range = "*"
source_address_prefix = "*"
destination_port_range = "8500"
destination_address_prefix = "*"
resource_group_name = "${azurerm_resource_group.ConsulPre.name}"
network_security_group_name = "${azurerm_network_security_group.ConsulPre.name}"
}
resource "azurerm_subnet" "ConsulPre" {
name = "ConsulPre"
resource_group_name = "${var.vnet_resource_group}"
virtual_network_name = "${var.vnet_name}"
address_prefix = "${var.subnet_cidr}"
network_security_group_id = "${azurerm_network_security_group.ConsulPre.id}"
}
output "subnet_id" {
value = "${azurerm_subnet.ConsulPre.id}"
}
output "address_prefix" {
value = "${azurerm_subnet.ConsulPre.address_prefix}"
}
output "resource_group_name" {
value = "ConsulPre"
}
output "resource_group_id" {
value = "${azurerm_resource_group.ConsulPre.id}"
}
variable "location" {}
variable "vnet_name" {}
variable "vnet_resource_group" {}
variable "subnet_cidr" {}
resource "azurerm_resource_group" "DeployPre" {
name = "DeployPre"
location = "${var.location}"
}
resource "azurerm_network_security_group" "DeployPre" {
name = "DeployPre"
location = "${var.location}"
resource_group_name = "${azurerm_resource_group.DeployPre.name}"
}
resource "azurerm_network_security_rule" "ssh-from-vpn1-ext" {
name = "ssh-from-vpn1-ext"
priority = 146
direction = "Inbound"
access = "Allow"
protocol = "TCP"
source_port_range = "*"
source_address_prefix = "52.177.194.133"
destination_port_range = "22"
destination_address_prefix = "*"
resource_group_name = "${azurerm_resource_group.DeployPre.name}"
network_security_group_name = "${azurerm_network_security_group.DeployPre.name}"
}
resource "azurerm_network_security_rule" "ssh-from-vpn2-ext" {
name = "ssh-from-vpn2-ext"
priority = 147
direction = "Inbound"
access = "Allow"
protocol = "TCP"
source_port_range = "*"
source_address_prefix = "52.177.192.239"
destination_port_range = "22"
destination_address_prefix = "*"
resource_group_name = "${azurerm_resource_group.DeployPre.name}"
network_security_group_name = "${azurerm_network_security_group.DeployPre.name}"
}
resource "azurerm_network_security_rule" "ssh-from-internal" {
name = "ssh-from-internal"
priority = 148
direction = "Inbound"
access = "Allow"
protocol = "TCP"
source_port_range = "*"
source_address_prefix = "10.0.0.0/8"
destination_port_range = "22"
destination_address_prefix = "*"
resource_group_name = "${azurerm_resource_group.DeployPre.name}"
network_security_group_name = "${azurerm_network_security_group.DeployPre.name}"
}
resource "azurerm_network_security_rule" "ssh-from-vpn" {
name = "ssh-from-vpn"
priority = 149
direction = "Inbound"
access = "Allow"
protocol = "TCP"
source_port_range = "*"
source_address_prefix = "10.254.4.0/23"
destination_port_range = "22"
destination_address_prefix = "*"
resource_group_name = "${azurerm_resource_group.DeployPre.name}"
network_security_group_name = "${azurerm_network_security_group.DeployPre.name}"
}
resource "azurerm_network_security_rule" "ssh" {
name = "ssh"
priority = 150
direction = "Inbound"
access = "Deny"
protocol = "TCP"
source_port_range = "*"
source_address_prefix = "Internet"
destination_port_range = "22"
destination_address_prefix = "*"
resource_group_name = "${azurerm_resource_group.DeployPre.name}"
network_security_group_name = "${azurerm_network_security_group.DeployPre.name}"
}
resource "azurerm_subnet" "DeployPre" {
name = "DeployPre"
resource_group_name = "${var.vnet_resource_group}"
virtual_network_name = "${var.vnet_name}"
address_prefix = "${var.subnet_cidr}"
network_security_group_id = "${azurerm_network_security_group.DeployPre.id}"
}
output "subnet_id" {
value = "${azurerm_subnet.DeployPre.id}"
}
output "address_prefix" {
value = "${azurerm_subnet.DeployPre.address_prefix}"
}
output "resource_group_name" {
value = "DeployPre"
}
output "resource_group_id" {
value = "${azurerm_resource_group.DeployPre.id}"
}
variable "location" {}
variable "vnet_name" {}
variable "vnet_resource_group" {}
variable "subnet_cidr" {}
resource "azurerm_resource_group" "ElasticSearchPre" {
name = "ElasticSearchPre"