169163334 - Initial VPC TF and structure

169163334 - Make supernet configurable

169163334 - Makes DNS servers configurable

169163334 - Adds bucket for state storage

169163334 - Adds k8s, keyvault, azuread provider

169163334 - Adds route tables

169163334 - Adds route table associations

169163334 - Adds default routes to route tables and fixes route table association flapping
This commit is contained in:
Rob Gil
2019-12-12 11:58:31 -05:00
parent 3f824ccc41
commit 955a1c483b
14 changed files with 355 additions and 0 deletions

View File

@@ -0,0 +1,11 @@
module "k8s" {
source = "../../modules/k8s"
region = var.region
name = var.name
environment = var.environment
owner = var.owner
k8s_dns_prefix = var.k8s_dns_prefix
k8s_node_size = var.k8s_node_size
vnet_subnet_id = module.vpc.subnets #FIXME - output from module.vpc.subnets should be map
}

View File

@@ -0,0 +1,7 @@
#module "keyvault" {
# source = "../../modules/keyvault"
# name = var.name
# region = var.region
# owner = var.owner
# environment = var.environment
#}

View File

@@ -0,0 +1,17 @@
provider "azurerm" {
version = "=1.38.0"
}
provider "azuread" {
# Whilst version is optional, we /strongly recommend/ using it to pin the version of the Provider being used
version = "=0.7.0"
}
terraform {
backend "azurerm" {
resource_group_name = "cloudzero-dev-tfstate"
storage_account_name = "cloudzerodevtfstate"
container_name = "tfstate"
key = "dev.terraform.tfstate"
}
}

View File

@@ -0,0 +1,56 @@
variable "environment" {
default = "dev"
}
variable "region" {
default = "eastus2"
}
variable "owner" {
default = "dev"
}
variable "name" {
default = "cloudzero"
}
variable "virtual_network" {
type = string
default = "10.1.0.0/16"
}
variable "networks" {
type = map
default = {
#format
#name = "CIDR, route table, Security Group Name"
public = "10.1.1.0/24,public" # LBs
private = "10.1.2.0/24,private" # k8s, postgres, redis, dns, ad
}
}
variable "route_tables" {
description = "Route tables and their default routes"
type = map
default = {
public = "Internet"
private = "VnetLocal"
}
}
variable "dns_servers" {
type = list
default = ["10.1.2.4", "10.1.2.5"]
}
variable "k8s_node_size" {
type = string
default = "Standard_A1_v2"
}
variable "k8s_dns_prefix" {
type = string
default = "atat"
}

View File

@@ -0,0 +1,12 @@
module "vpc" {
source = "../../modules/vpc/"
environment = var.environment
region = var.region
virtual_network = var.virtual_network
networks = var.networks
route_tables = var.route_tables
owner = var.owner
name = var.name
dns_servers = var.dns_servers
}