Bläddra i källkod

fm-shared-search and splunk-mc can now speak 8089 to anywhere

to be tagged v1.23.3
Fred Damstra 4 år sedan
förälder
incheckning
c493960e6b
1 ändrade filer med 13 tillägg och 0 borttagningar
  1. 13 0
      base/splunk_servers/searchhead/main.tf

+ 13 - 0
base/splunk_servers/searchhead/main.tf

@@ -4,6 +4,8 @@ locals {
   instance_name = var.instance_name != "" ? var.instance_name : "${ var.prefix }-splunk-sh"
   alb_name = var.alb_name != "" ? var.alb_name : "${ var.prefix }-splunk"
   is_moose = length(regexall("moose", var.prefix)) > 0 ? true : false
+  is_monitoring_console = var.alb_name == "splunk-mc" ? true : false
+  is_fm_searchhead = var.alb_name == "splunk-fm-shared-search" ? true : false
 }
 
 # Rather than pass in the aws security group, we just look it up. This will
@@ -256,6 +258,17 @@ resource "aws_security_group_rule" "splunk-api-out" {
   security_group_id = aws_security_group.searchhead_security_group.id
 }
 
+resource "aws_security_group_rule" "splunk-api-out-to-all" {
+  count             = local.is_monitoring_console || local.is_fm_searchhead  ? 1 : 0
+  description       = "Splunk API Outbound to talk to Other Segments"
+  type              = "egress"
+  from_port         = 8089
+  to_port           = 8089
+  protocol          = "tcp"
+  cidr_blocks       = [ "10.0.0.0/8" ]
+  security_group_id = aws_security_group.searchhead_security_group.id
+}
+
 resource "aws_security_group_rule" "splunk-data-out" {
   description       = "Splunk Data Outbound to talk to own indexers"
   type              = "egress"