terraform-modules/network/main.tf

23 lines
703 B
HCL

resource "stackit_network" "this" {
project_id = var.project_id
name = var.name
ipv4_nameservers = var.ipv4_nameservers
labels = var.labels
routed = true
}
resource "stackit_network_interface" "static" {
count = var.static_ipv4 == null ? 0 : 1
project_id = var.project_id
network_id = stackit_network.this.network_id
ipv4 = var.static_ipv4
labels = var.nic_labels
name = var.nic_name == null ? "${var.name}-nic" : var.nic_name
security = var.nic_security
security_group_ids = var.nic_security ? var.nic_security_group_ids : null
allowed_addresses = var.nic_security ? var.nic_allowed_addresses : null
}