NEW: more samples
This commit is contained in:
+25
@@ -0,0 +1,25 @@
|
||||
locals {
|
||||
csv_file = file("sg.csv")
|
||||
rules = csvdecode(local.csv_file)
|
||||
}
|
||||
|
||||
data aws_caller_identity self {}
|
||||
|
||||
resource "aws_security_group" "security-groups" {
|
||||
description = "sg description"
|
||||
name = "sg1"
|
||||
vpc_id = data.aws_caller_identity.self.id
|
||||
|
||||
for_each = {
|
||||
for rule in local.rules : rule.rule_no => rule
|
||||
}
|
||||
|
||||
ingress {
|
||||
description = each.value.description
|
||||
from_port = each.value.from_port
|
||||
to_port = each.value.to_port
|
||||
protocol = each.value.proto
|
||||
cidr_blocks = [each.value.source]
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user