mirror of
https://github.com/edgelesssys/constellation.git
synced 2025-05-02 14:26:23 -04:00
terraform: Terraform module for AWS (#2503)
This commit is contained in:
parent
0bac72261d
commit
cea6204b37
94 changed files with 912 additions and 87 deletions
|
@ -0,0 +1,38 @@
|
|||
terraform {
|
||||
required_providers {
|
||||
azurerm = {
|
||||
source = "hashicorp/azurerm"
|
||||
version = "3.74.0"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
resource "azurerm_lb_backend_address_pool" "backend_pool" {
|
||||
loadbalancer_id = var.loadbalancer_id
|
||||
name = var.name
|
||||
}
|
||||
|
||||
resource "azurerm_lb_probe" "health_probes" {
|
||||
for_each = { for port in var.ports : port.name => port }
|
||||
|
||||
loadbalancer_id = var.loadbalancer_id
|
||||
name = each.value.name
|
||||
port = each.value.port
|
||||
protocol = each.value.health_check_protocol
|
||||
request_path = each.value.path
|
||||
interval_in_seconds = 5
|
||||
}
|
||||
|
||||
resource "azurerm_lb_rule" "rules" {
|
||||
for_each = azurerm_lb_probe.health_probes
|
||||
|
||||
loadbalancer_id = var.loadbalancer_id
|
||||
name = each.value.name
|
||||
protocol = "Tcp"
|
||||
frontend_port = each.value.port
|
||||
backend_port = each.value.port
|
||||
frontend_ip_configuration_name = var.frontend_ip_configuration_name
|
||||
backend_address_pool_ids = [azurerm_lb_backend_address_pool.backend_pool.id]
|
||||
probe_id = each.value.id
|
||||
disable_outbound_snat = true
|
||||
}
|
|
@ -0,0 +1,4 @@
|
|||
output "backendpool_id" {
|
||||
value = azurerm_lb_backend_address_pool.backend_pool.id
|
||||
description = "The ID of the created backend pool."
|
||||
}
|
|
@ -0,0 +1,25 @@
|
|||
variable "name" {
|
||||
type = string
|
||||
default = "constell"
|
||||
description = "Base name of the cluster."
|
||||
}
|
||||
|
||||
variable "frontend_ip_configuration_name" {
|
||||
type = string
|
||||
description = "The name of the frontend IP configuration to use for the load balancer."
|
||||
}
|
||||
|
||||
variable "loadbalancer_id" {
|
||||
type = string
|
||||
description = "The ID of the load balancer to add the backend to."
|
||||
}
|
||||
|
||||
variable "ports" {
|
||||
type = list(object({
|
||||
name = string
|
||||
port = number
|
||||
health_check_protocol = string
|
||||
path = string
|
||||
}))
|
||||
description = "The ports to add to the backend. Protocol can be either 'Tcp' or 'Https'. Path is only used for 'Https' protocol and can otherwise be null."
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue