169163334 - Adds LB module
This commit is contained in:
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"
|
||||
}
|
Reference in New Issue
Block a user