Add restricted web egress rules
This commit is contained in:
@@ -20,6 +20,21 @@ resource "aws_vpc_security_group_ingress_rule" "web" {
|
||||
referenced_security_group_id = each.value.use_vyos_security_group ? var.vyos_security_group_id : null
|
||||
}
|
||||
|
||||
resource "aws_vpc_security_group_egress_rule" "web" {
|
||||
for_each = local.web_egress_rules
|
||||
|
||||
region = var.region
|
||||
|
||||
security_group_id = aws_security_group.web.id
|
||||
description = each.value.description
|
||||
ip_protocol = each.value.ip_protocol
|
||||
from_port = each.value.from_port
|
||||
to_port = each.value.to_port
|
||||
cidr_ipv4 = each.value.cidr_ipv4
|
||||
}
|
||||
|
||||
# Keep the imported all-egress rule during stage 1. Stage 2 removes this
|
||||
# resource only after host inventory and the REJECT-monitoring query are ready.
|
||||
resource "aws_vpc_security_group_egress_rule" "web_all_ipv4" {
|
||||
region = var.region
|
||||
|
||||
|
||||
Reference in New Issue
Block a user