update structure for nested resources in project

This commit is contained in:
Maximilian_Schlenz 2025-07-14 13:55:16 +02:00
parent 7b16b3e7d5
commit 93f2af55c7
2 changed files with 4 additions and 4 deletions

View file

@ -13,7 +13,7 @@ resource "stackit_security_group_rule" "rule" {
direction = var.rules[count.index].direction
project_id = var.project_id
security_group_id = stackit_security_group.this.id
security_group_id = stackit_security_group.this.security_group_id
description = var.rules[count.index].description
ether_type = var.rules[count.index].ether_type

View file

@ -17,7 +17,7 @@ variable "description" {
variable "rules" {
description = "List of rules to attach to this security-group"
type = list(object({
direction = string
direction = string
description = optional(string)
ether_type = optional(string)
icmp_parameters = optional(object({
@ -30,12 +30,12 @@ variable "rules" {
max = number
}))
protocol = optional(object({
name = optional(string)
name = optional(string)
}))
remote_security_group_id = optional(string)
}))
default = []
validation {
validation {
condition = alltrue([
for rule in var.rules : contains(["ingress", "egress"], rule.direction)
# ... need more validations