This commit is contained in:
2025-11-18 03:20:27 +00:00
parent c50d803865
commit fadee048d7
49 changed files with 3243 additions and 0 deletions

View File

@ -0,0 +1,16 @@
resource "aws_security_group_rule" "sg-rule-add" {
# description = "Security groups rule add"
type = var.type
// rules
for_each = var.rules
from_port = each.value.from_port
to_port = each.value.to_port
protocol = each.value.protocol
cidr_blocks = [each.value.cidr_blocks]
security_group_id = var.security_group_id
description = "${var.tag_name}-sg-rule"
}

View File

View File

@ -0,0 +1,34 @@
variable "type" {
description = "security rule type"
type = string
}
# variable "from_port" {
# description = "from port"
# type = number
# }
# variable "to_port" {
# description = "to_port"
# type = number
# }
# variable "protocol" {
# description = "protocol"
# type = string
# }
# variable "cidr_blocks" {
# description = "cidr_blocks"
# type = list(string)
# }
variable "rules" {
description = "sg rules"
type = map(map(string))
}
variable "security_group_id" {
}
variable "tag_name" {
description = "tag_name"
type = string
}