169163334 - Adds LB module
This commit is contained in:
parent
585d52f045
commit
7aeda9377e
22
terraform/modules/lb/main.tf
Normal file
22
terraform/modules/lb/main.tf
Normal file
@ -0,0 +1,22 @@
|
||||
resource "azurerm_resource_group" "lb" {
|
||||
name = "${var.name}-${var.environment}-lb"
|
||||
location = var.region
|
||||
}
|
||||
|
||||
resource "azurerm_public_ip" "lb" {
|
||||
name = "${var.name}-${var.environment}-ip"
|
||||
location = var.region
|
||||
resource_group_name = azurerm_resource_group.lb.name
|
||||
allocation_method = "Static"
|
||||
}
|
||||
|
||||
resource "azurerm_lb" "lb" {
|
||||
name = "${var.name}-${var.environment}-lb"
|
||||
location = var.region
|
||||
resource_group_name = azurerm_resource_group.lb.name
|
||||
|
||||
frontend_ip_configuration {
|
||||
name = "${var.name}-${var.environment}-ip"
|
||||
public_ip_address_id = azurerm_public_ip.lb.id
|
||||
}
|
||||
}
|
0
terraform/modules/lb/outputs.tf
Normal file
0
terraform/modules/lb/outputs.tf
Normal file
19
terraform/modules/lb/variables.tf
Normal file
19
terraform/modules/lb/variables.tf
Normal file
@ -0,0 +1,19 @@
|
||||
variable "region" {
|
||||
type = string
|
||||
description = "Region this module and resources will be created in"
|
||||
}
|
||||
|
||||
variable "name" {
|
||||
type = string
|
||||
description = "Unique name for the services in this module"
|
||||
}
|
||||
|
||||
variable "environment" {
|
||||
type = string
|
||||
description = "Environment these resources reside (prod, dev, staging, etc)"
|
||||
}
|
||||
|
||||
variable "owner" {
|
||||
type = string
|
||||
description = "Owner of the environment and resources created in this module"
|
||||
}
|
@ -9,3 +9,10 @@ module "k8s" {
|
||||
vnet_subnet_id = module.vpc.subnets #FIXME - output from module.vpc.subnets should be map
|
||||
}
|
||||
|
||||
module "lb" {
|
||||
source = "../../modules/lb"
|
||||
region = var.region
|
||||
name = var.name
|
||||
environment = var.environment
|
||||
owner = var.owner
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user