|
@@ -1,17 +1,21 @@
|
|
|
locals {
|
|
|
# alb_clients access the SH
|
|
|
- alb_clients = toset(concat(
|
|
|
- var.cidr_map["vpc-access"], # VPN users
|
|
|
- var.cidr_map["vpc-system-services"], # Salt master, etc
|
|
|
- var.cidr_map["vpc-private-services"], # fm-shared search, qcompliance, phantom
|
|
|
- var.trusted_ips,
|
|
|
- var.splunk_customer_cidrs,
|
|
|
- ))
|
|
|
+ #
|
|
|
+ # Old way: restricted
|
|
|
+ #alb_clients = toset(concat(
|
|
|
+ # var.cidr_map["vpc-access"], # VPN users
|
|
|
+ # var.cidr_map["vpc-system-services"], # Salt master, etc
|
|
|
+ # var.cidr_map["vpc-private-services"], # fm-shared search, qcompliance, phantom
|
|
|
+ # var.trusted_ips,
|
|
|
+ # var.splunk_customer_cidrs,
|
|
|
+ #))
|
|
|
+ # New way: WAF protects us
|
|
|
+ alb_clients = [ "0.0.0.0/0" ]
|
|
|
}
|
|
|
|
|
|
resource "aws_lb" "searchhead-alb" {
|
|
|
- name = var.alb_name != "" ? "${local.alb_name}-alb" : "${var.prefix}-cust-sh"
|
|
|
- internal = true
|
|
|
+ name = local.alb_name
|
|
|
+ internal = false
|
|
|
load_balancer_type = "application"
|
|
|
# Not supported for NLB
|
|
|
security_groups = [aws_security_group.searchhead-alb-sg.id]
|
|
@@ -62,7 +66,7 @@ resource "aws_lb_listener" "searchhead-alb-listener-http" {
|
|
|
#########################
|
|
|
# Targets
|
|
|
resource "aws_lb_target_group" "searchhead-alb-target-8000" {
|
|
|
- name = var.alb_name != "" ? "${local.alb_name}-customer-alb-target-8000" : "${var.prefix}-cust-alb-8000"
|
|
|
+ name = "${local.alb_name}-8000"
|
|
|
port = 8000
|
|
|
protocol = "HTTPS"
|
|
|
target_type = "instance"
|
|
@@ -93,7 +97,7 @@ resource "aws_lb_target_group_attachment" "searchhead-alb-target-8000-instance"
|
|
|
#########################
|
|
|
# Security Group for ALB
|
|
|
resource "aws_security_group" "searchhead-alb-sg" {
|
|
|
- name = var.alb_name != "" ? "${local.alb_name}-customer-alb-sh" : "${var.prefix}-customer-sh-alb-sg"
|
|
|
+ name = "${local.alb_name}-customer-alb-sh"
|
|
|
description = "Security Group for the Customer Searchhead ALB"
|
|
|
vpc_id = var.vpc_id
|
|
|
tags = merge(var.standard_tags, var.tags)
|
|
@@ -130,10 +134,10 @@ resource "aws_security_group_rule" "searchhead-alb-8000-out" {
|
|
|
|
|
|
#########################
|
|
|
# DNS Entry
|
|
|
-module "public_dns_record_hec_ack" {
|
|
|
+module "public_dns_record_cust-elb" {
|
|
|
source = "../../../submodules/dns/public_ALIAS_record"
|
|
|
|
|
|
- name = local.alb_name
|
|
|
+ name = local.dns_short_name
|
|
|
|
|
|
target_dns_name = aws_lb.searchhead-alb.dns_name
|
|
|
target_zone_id = aws_lb.searchhead-alb.zone_id
|