42 lines
1.8 KiB
Terraform
42 lines
1.8 KiB
Terraform
output "route_target_network_interface_id" {
|
|
value = aws_network_interface.route_target.id
|
|
}
|
|
|
|
output "vyos_source_security_group_id" {
|
|
value = aws_security_group.vyos_source.id
|
|
}
|
|
|
|
output "vyos_route_network_interface_ids" {
|
|
value = module.network_public.vyos_route_network_interface_ids
|
|
}
|
|
|
|
output "vyos_source_security_group_ids" {
|
|
value = module.network_public.vyos_source_security_group_ids
|
|
}
|
|
|
|
output "web_egress_policy_matches" {
|
|
value = length(module.network_public.web_egress_rule_specs) == 20 && alltrue([
|
|
for cidr in ["192.0.2.0/24", "198.51.100.0/24"] :
|
|
toset([for rule in values(module.network_public.web_egress_rule_specs) : rule.from_port if rule.cidr_ipv4 == cidr && rule.ip_protocol == "tcp"]) == toset([3000, 3001, 8200, 8300, 8301, 9000, 25090]) &&
|
|
toset([for rule in values(module.network_public.web_egress_rule_specs) : rule.from_port if rule.cidr_ipv4 == cidr && rule.ip_protocol == "udp"]) == toset([123])
|
|
]) && toset([for rule in values(module.network_public.web_egress_rule_specs) : rule.from_port if rule.cidr_ipv4 == "0.0.0.0/0" && rule.ip_protocol == "tcp"]) == toset([80, 443]) && alltrue([
|
|
for rule in values(module.network_public.web_egress_rule_specs) : rule.description != "" && rule.from_port == rule.to_port
|
|
]) && toset([
|
|
for key, rule in module.network_public.web_egress_rule_specs : "${key}|${rule.ip_protocol}|${rule.from_port}|${rule.cidr_ipv4}"
|
|
if startswith(key, "service_")
|
|
]) == toset([
|
|
"service_consul_serf_lan|udp|8301|203.0.113.0/24",
|
|
"service_loki_ingest|tcp|3100|203.0.113.0/24",
|
|
])
|
|
}
|
|
|
|
output "named_resources" {
|
|
value = merge(
|
|
module.network_public.named_resource_names,
|
|
{
|
|
route_target_network_interface = aws_network_interface.route_target.tags["Name"]
|
|
vyos_source_security_group = aws_security_group.vyos_source.name
|
|
},
|
|
)
|
|
}
|