Add restricted web egress rules
This commit is contained in:
@@ -103,6 +103,26 @@ variable "ssh_ingress_rules" {
|
||||
}))
|
||||
}
|
||||
|
||||
variable "web_egress_policy" {
|
||||
description = "Restricted outbound ports for the public web instance. Homelab destinations are the two VyOS route CIDRs; public TCP destinations use IPv4 any-address."
|
||||
type = object({
|
||||
homelab_tcp_ports = set(number)
|
||||
homelab_udp_ports = set(number)
|
||||
public_tcp_ports = set(number)
|
||||
})
|
||||
|
||||
validation {
|
||||
condition = alltrue([
|
||||
for port in setunion(
|
||||
var.web_egress_policy.homelab_tcp_ports,
|
||||
var.web_egress_policy.homelab_udp_ports,
|
||||
var.web_egress_policy.public_tcp_ports,
|
||||
) : port >= 1 && port <= 65535 && port == floor(port)
|
||||
])
|
||||
error_message = "Every web egress port must be an integer from 1 through 65535."
|
||||
}
|
||||
}
|
||||
|
||||
variable "web_instance" {
|
||||
description = "Existing public web EC2 instance. user_data is intentionally absent."
|
||||
type = object({
|
||||
|
||||
Reference in New Issue
Block a user