Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 40 additions & 4 deletions modules/landing-zone/3-network.tf
Original file line number Diff line number Diff line change
@@ -1,12 +1,48 @@
#############
## NETWORK ##
## ROUTING ##
#############
resource "stackit_routing_table" "this" {
count = var.network_area_id != null ? 1 : 0
organization_id = var.organization_id
network_area_id = var.network_area_id
name = var.naming_pattern
system_routes = false

labels = local.labels
}

resource "stackit_routing_table_route" "this" {
count = var.network_area_id != null ? 1 : 0
routing_table_id = stackit_routing_table.this[0].routing_table_id

organization_id = var.organization_id
network_area_id = var.network_area_id

destination = {
type = "cidrv4"
value = "0.0.0.0/0"
}

next_hop = {
type = "ipv4"
value = var.firewall_next_hop_ip
}

labels = local.labels
}

#############
## NETWORK ##
#############
resource "stackit_network" "this" {
count = var.network_area_id != null ? 1 : 0
count = var.network_area_id != null ? 1 : 0
project_id = stackit_resourcemanager_project.this.project_id

project_id = stackit_resourcemanager_project.this.project_id
name = "${var.naming_pattern}-routed"
ipv4_prefix_length = var.network_prefix_length
routed = true
}
ipv4_nameservers = var.ipv4_nameservers
routing_table_id = stackit_routing_table.this[0].routing_table_id

labels = local.labels
}
17 changes: 17 additions & 0 deletions modules/landing-zone/variables.tf
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
variable "organization_id" {
type = string
description = "Container ID of the root organization."
}

variable "custom_roles" {
type = list(object({
name = string
Expand Down Expand Up @@ -53,4 +58,16 @@ variable "role_assignments" {
}))
description = "List of role assignments for the project. Subject can be a user email or service account email."
default = []
}

variable "firewall_next_hop_ip" {
type = string
description = "IP address of the firewall next hop."
default = null
}

variable "ipv4_nameservers" {
type = list(string)
description = "List of IPv4 nameservers for the network."
default = null
}
Loading