resource "aws_route53_resolver_endpoint" "private_resolver" { name = "xdr_msoc_local" direction = "INBOUND" security_group_ids = [aws_security_group.resolver_security_group.id] dynamic "ip_address" { for_each = var.subnets content { subnet_id = ip_address.value } } tags = merge(local.standard_tags, var.tags) } #---------------------------------------------------------------------------- # DNS Resolver Security Group #---------------------------------------------------------------------------- resource "aws_security_group" "resolver_security_group" { # checkov:skip=CKV2_AWS_5: this SG is attached to DNS Resolver name = "route53_resolver_inbound" description = "Allow DNS inbound traffic" vpc_id = var.primary_vpc #---------------------------------------------------------------------------- # INGRESS #---------------------------------------------------------------------------- ingress { description = "DNS_UDP - Inbound" from_port = 53 to_port = 53 protocol = "udp" cidr_blocks = ["10.0.0.0/8"] } ingress { description = "DNS_TCP - Inbound" from_port = 53 to_port = 53 protocol = "tcp" cidr_blocks = ["10.0.0.0/8"] } #---------------------------------------------------------------------------- # EGRESS #---------------------------------------------------------------------------- egress { description = "DNS_UDP - Outbound" from_port = 53 to_port = 53 protocol = "udp" cidr_blocks = ["10.0.0.0/8"] } egress { description = "DNS_TCP - Outbound" from_port = 53 to_port = 53 protocol = "tcp" cidr_blocks = ["10.0.0.0/8"] } tags = merge(local.standard_tags, var.tags) }