jolly-fall-57688
11/17/2022, 9:17 PMsg = aws.ec2.SecurityGroup("dev-sg",
description = "Allow web traffic for cluster",
vpc_id = vpc.vpc_id,
ingress = [aws.ec2.SecurityGroupIngressArgs(
description = "Allow port 80 inbound from Internet",
from_port = 80,
to_port = 80,
protocol = "TCP",
cidr_blocks = ["0.0.0.0/0"]
)],
egress = [aws.ec2.SecurityGroupEgressArgs(
description = "Allow all traffic out from cluster",
from_port = 0,
to_port = 0,
protocol = "-1",
cidr_blocks = ["0.0.0.0/0"]
)]
)
How would I add a second ingress and egress rule to this security group?billowy-army-68599
11/17/2022, 9:22 PMingress
or egress
array, or define a rule for eachjolly-fall-57688
11/17/2022, 9:39 PMsg = aws.ec2.SecurityGroup("dev-sg",
description = "Allow web traffic for cluster",
vpc_id = vpc.vpc_id,
ingress = [aws.ec2.SecurityGroupIngressArgs(
description = "Allow port 80 inbound from Internet",
from_port = 80,
to_port = 80,
protocol = "TCP",
cidr_blocks = ["0.0.0.0/0"]
),
description = "Allow port 3000 in from the SG",
from_port = 3000,
to_port = 3000,
protocol = "TCP",
self = True
],
egress = [aws.ec2.SecurityGroupEgressArgs(
description = "Allow all traffic out from cluster",
from_port = 0,
to_port = 0,
protocol = "-1",
cidr_blocks = ["0.0.0.0/0"],
description = "Allow port 3000 out to the SG",
from_port = 3000,
to_prot = 3000,
protocol = "TCP",
self = True
)]
)
billowy-army-68599
11/17/2022, 9:43 PMsg = aws.ec2.SecurityGroup("dev-sg",
description = "Allow web traffic for cluster",
vpc_id = vpc.vpc_id,
ingress = [aws.ec2.SecurityGroupIngressArgs(
description = "Allow port 80 inbound from Internet",
from_port = 80,
to_port = 80,
protocol = "TCP",
cidr_blocks = ["0.0.0.0/0"]
),
aws.ec2.SecurityGroupIngressArgs(
description = "Allow port 3000 in from the SG",
from_port = 3000,
to_port = 3000,
protocol = "TCP",
self = True)
],
)
jolly-fall-57688
11/17/2022, 9:45 PMsg = aws.ec2.SecurityGroup("dev-sg",
description = "Allow web traffic for cluster",
vpc_id = vpc.vpc_id,
ingress = [aws.ec2.SecurityGroupIngressArgs(
description = "Allow port 80 inbound from Internet",
from_port = 80,
to_port = 80,
protocol = "TCP",
cidr_blocks = ["0.0.0.0/0"]
),
aws.ec2.SecurityGroupIngressArgs(
description = "Allow port 3000 in from the SG",
from_port = 3000,
to_port = 3000,
protocol = "TCP",
self = True
)],
egress = [aws.ec2.SecurityGroupEgressArgs(
description = "Allow all traffic out from cluster",
from_port = 0,
to_port = 0,
protocol = "-1",
cidr_blocks = ["0.0.0.0/0"],
),
aws.ec2.SecurityGroupIngressArgs(
description = "Allow port 3000 out to the SG",
from_port = 3000,
to_port = 3000,
protocol = "TCP",
self = True
)]
)