-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.tf
25 lines (21 loc) · 822 Bytes
/
main.tf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
######################### Security Group
resource "aws_security_group" "Creating_SG" {
vpc_id = var.VPC_ID
name = "Testing-SG-Add-Rule"
description = "Testing-SG-Add-Rule"
tags = {
Name = "Testing-SG-Add-Rule"
}
}
# Create Rules in Security Groups
resource "aws_security_group_rule" "Creating_SG_rules_input" {
depends_on = [ aws_security_group.Creating_SG ]
count = length(local.sg_access)
description = count.index
type = "ingress"
from_port = local.sg_access[count.index]["from_port"]
to_port = local.sg_access[count.index]["to_port"]
protocol = local.sg_access[count.index]["protocol"]
cidr_blocks = local.sg_access[count.index]["cidr_blocks"]
security_group_id = aws_security_group.Creating_SG.id
}