Skip to content

Commit 1e1dc30

Browse files
committed
chore: update naming conventions and clean up variables in sandboxes and examples
1 parent fb6365f commit 1e1dc30

6 files changed

Lines changed: 19 additions & 67 deletions

File tree

CODEOWNERS

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
* david.wenzel@stackit.cloud @mahauber
2+
docs/* @lweberru
3+
scripts/* @lweberru

examples/01-standalone/main.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ module "devops" {
4747
module "sandboxes" {
4848
source = "../../modules/sandboxes"
4949

50-
naming_pattern = "${var.company_code}-sbx"
50+
naming_prefix = "${var.company_code}-sbx"
5151
parent_container_id = module.governance.folder_container_ids.sandbox
5252
sandboxes = var.sandboxes
5353
}

examples/02-hub-spoke/main.tf

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,9 @@ module "management" {
3333
module "connectivity_global" {
3434
source = "../../modules/connectivity-global"
3535

36-
organization_id = var.organization_id
37-
labels = var.labels
38-
network_areas = var.network_areas
36+
organization_id = var.organization_id
37+
labels = var.labels
38+
network_areas = var.network_areas
3939
}
4040

4141
#############################
@@ -80,7 +80,7 @@ module "devops" {
8080
module "sandboxes" {
8181
source = "../../modules/sandboxes"
8282

83-
naming_pattern = "${var.company_code}-sbx"
83+
naming_prefix = "${var.company_code}-sbx"
8484
parent_container_id = module.governance.folder_container_ids.sandbox
8585
sandboxes = var.sandboxes
8686
}
@@ -93,8 +93,9 @@ module "landing_zone" {
9393
source = "../../modules/landing-zone"
9494
for_each = var.landing_zones
9595

96-
parent_container_id = module.governance.folder_container_ids.landing_zones_public
96+
parent_container_id = each.value.corporate ? module.governance.folder_container_ids.landing_zones_corporate : module.governance.folder_container_ids.landing_zones_public
9797
naming_pattern = "${var.company_code}-lz-${each.value.project_code}-${each.value.env}"
98+
network_area_id = each.value.corporate ? module.connectivity_global.network_area_ids[var.connectivity_regional_network_area] : null
9899
owner_email = each.value.owner_email
99100
labels = var.labels
100101
role_assignments = each.value.role_assignments

examples/02-hub-spoke/variables.tf

Lines changed: 6 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -52,15 +52,9 @@ variable "platform_admins" {
5252
default = []
5353
}
5454

55-
variable "landing_zone_admins" {
56-
type = list(string)
57-
description = "List of landing zone administrators."
58-
default = []
59-
}
60-
61-
##############################
62-
## CONNECTIVITY - GLOBAL ##
63-
##############################
55+
###########################
56+
## CONNECTIVITY - GLOBAL ##
57+
###########################
6458

6559
variable "network_areas" {
6660
type = list(object({
@@ -75,9 +69,9 @@ variable "network_areas" {
7569
description = "List of network areas to create with their IP ranges and configuration."
7670
}
7771

78-
################################
79-
## CONNECTIVITY - REGIONAL ##
80-
################################
72+
#############################
73+
## CONNECTIVITY - REGIONAL ##
74+
#############################
8175

8276
variable "connectivity_regional_network_area" {
8377
type = string
@@ -144,46 +138,6 @@ variable "landing_zones" {
144138
description = string
145139
permissions = list(string)
146140
})), [])
147-
kubernetes_clusters = optional(map(object({
148-
kubernetes_version = string
149-
enable_kubernetes_version_updates = optional(bool, true)
150-
enable_machine_image_version_updates = optional(bool, true)
151-
hibernations = optional(list(object({
152-
start = string
153-
end = string
154-
timezone = optional(string, "Europe/Berlin")
155-
})), [])
156-
node_pools = list(object({
157-
name = string
158-
machine_type = string
159-
availability_zones = list(string)
160-
os_version_min = optional(string)
161-
minimum = number
162-
maximum = number
163-
max_surge = optional(number)
164-
max_unavailable = optional(number)
165-
labels = optional(map(string))
166-
taints = optional(list(object({
167-
key = string
168-
value = string
169-
effect = string
170-
})))
171-
}))
172-
extensions = optional(object({
173-
acl = optional(object({
174-
allowed_cidrs = list(string)
175-
enabled = bool
176-
}))
177-
dns = optional(object({
178-
enabled = bool
179-
zones = optional(list(string))
180-
}))
181-
observability = optional(object({
182-
enabled = bool
183-
instance_id = optional(string)
184-
}))
185-
}))
186-
})), {})
187141
}))
188142
description = "Map of landing zones to create. Set corporate = true for network area connectivity, false for public."
189143
default = {}

modules/sandboxes/main.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ resource "stackit_resourcemanager_project" "this" {
66
for_each = { for sandbox in var.sandboxes : sandbox.project_name => sandbox }
77

88
parent_container_id = var.parent_container_id
9-
name = "${var.naming_pattern}-${each.value.project_name}"
9+
name = "${var.naming_prefix}-${each.value.project_name}"
1010
owner_email = each.value.project_owner_email
1111

1212
lifecycle {

modules/sandboxes/variables.tf

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,9 @@ variable "parent_container_id" {
33
description = "Parent container ID (folder or organization) where the project will be created."
44
}
55

6-
variable "naming_pattern" {
6+
variable "naming_prefix" {
77
type = string
8-
description = "Naming prefix for all resources in this module, e.g. \"myco-pltfm-net-prod\"."
9-
}
10-
11-
variable "project_name" {
12-
type = string
13-
description = "Name of the STACKIT project to create."
14-
default = null
8+
description = "Naming prefix for all resources in this module."
159
}
1610

1711
variable "sandboxes" {

0 commit comments

Comments
 (0)