main.tf 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. resource "aws_route53_resolver_endpoint" "private_resolver" {
  2. name = "xdr_msoc_local"
  3. direction = "INBOUND"
  4. security_group_ids = [ aws_security_group.resolver_security_group.id ]
  5. dynamic "ip_address" {
  6. for_each = var.subnets
  7. content {
  8. subnet_id = ip_address.value
  9. }
  10. }
  11. tags = merge(var.standard_tags, var.tags)
  12. }
  13. resource "aws_security_group" "resolver_security_group" {
  14. name = "route53_resolver_inbound"
  15. description = "Allow DNS inbound traffic"
  16. vpc_id = var.primary_vpc
  17. ingress {
  18. description = "DNS_UDP"
  19. from_port = 53
  20. to_port = 53
  21. protocol = "udp"
  22. cidr_blocks = [ "10.0.0.0/8" ]
  23. }
  24. ingress {
  25. description = "DNS_TCP"
  26. from_port = 53
  27. to_port = 53
  28. protocol = "tcp"
  29. cidr_blocks = [ "10.0.0.0/8" ]
  30. }
  31. egress {
  32. description = "DNS_UDP"
  33. from_port = 53
  34. to_port = 53
  35. protocol = "udp"
  36. cidr_blocks = [ "10.0.0.0/8" ]
  37. }
  38. egress {
  39. description = "DNS_TCP"
  40. from_port = 53
  41. to_port = 53
  42. protocol = "tcp"
  43. cidr_blocks = [ "10.0.0.0/8" ]
  44. }
  45. tags = merge(var.standard_tags, var.tags)
  46. }