|
@@ -21,14 +21,17 @@ resource "aws_eip" "hec_static" {
|
|
count = 2
|
|
count = 2
|
|
vpc = true
|
|
vpc = true
|
|
|
|
|
|
- tags = merge(var.standard_tags, var.tags)
|
|
|
|
|
|
+ lifecycle {
|
|
|
|
+ prevent_destroy = true # Even if everything else goes away, we want to keep these.
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ tags = merge(var.standard_tags, var.tags, { "Name" : "${var.prefix}-hec-static" })
|
|
}
|
|
}
|
|
|
|
|
|
#########################
|
|
#########################
|
|
# ELB
|
|
# ELB
|
|
resource "aws_lb" "hec_static" {
|
|
resource "aws_lb" "hec_static" {
|
|
- tags = merge(var.standard_tags, var.tags)
|
|
|
|
- name = "${var.prefix}-hec-static"
|
|
|
|
|
|
+ name_prefix = substr("${var.prefix}-hec-static", 0, 6)
|
|
load_balancer_type = "network"
|
|
load_balancer_type = "network"
|
|
internal = false # tfsec:ignore:aws-elb-alb-not-public LB is intentionally public
|
|
internal = false # tfsec:ignore:aws-elb-alb-not-public LB is intentionally public
|
|
|
|
|
|
@@ -48,6 +51,8 @@ resource "aws_lb" "hec_static" {
|
|
# bucket = "xdr-elb-${ var.environment }"
|
|
# bucket = "xdr-elb-${ var.environment }"
|
|
# enabled = true
|
|
# enabled = true
|
|
#}
|
|
#}
|
|
|
|
+
|
|
|
|
+ tags = merge(var.standard_tags, var.tags, { "Name" : "${var.prefix}-hec-static" })
|
|
}
|
|
}
|
|
|
|
|
|
#resource "aws_lb_listener" "front_end" {
|
|
#resource "aws_lb_listener" "front_end" {
|
|
@@ -72,6 +77,9 @@ resource "aws_lb_listener" "hec_static_443" {
|
|
type = "forward"
|
|
type = "forward"
|
|
target_group_arn = aws_lb_target_group.hec_static_8088.arn
|
|
target_group_arn = aws_lb_target_group.hec_static_8088.arn
|
|
}
|
|
}
|
|
|
|
+ lifecycle {
|
|
|
|
+ create_before_destroy = true
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
|
|
resource "aws_lb_listener" "hec_static_8088" {
|
|
resource "aws_lb_listener" "hec_static_8088" {
|
|
@@ -82,19 +90,30 @@ resource "aws_lb_listener" "hec_static_8088" {
|
|
type = "forward"
|
|
type = "forward"
|
|
target_group_arn = aws_lb_target_group.hec_static_8088.arn
|
|
target_group_arn = aws_lb_target_group.hec_static_8088.arn
|
|
}
|
|
}
|
|
|
|
+ lifecycle {
|
|
|
|
+ create_before_destroy = true
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
|
|
resource "aws_lb_target_group" "hec_static_8088" {
|
|
resource "aws_lb_target_group" "hec_static_8088" {
|
|
- name = "${var.prefix}-hec-static-targets"
|
|
|
|
|
|
+ name_prefix = substr("${var.prefix}-hec-static-targets", 0, 6)
|
|
port = 8088
|
|
port = 8088
|
|
protocol = "TCP"
|
|
protocol = "TCP"
|
|
target_type = "alb"
|
|
target_type = "alb"
|
|
vpc_id = var.vpc_id
|
|
vpc_id = var.vpc_id
|
|
|
|
|
|
- # health_chec_static {
|
|
|
|
- # path = "/services/collector/health/1.0"
|
|
|
|
- # protocol = "HTTPS"
|
|
|
|
- # }
|
|
|
|
|
|
+ health_check {
|
|
|
|
+ port = 8088
|
|
|
|
+ protocol = "HTTPS"
|
|
|
|
+ path = "/services/collector/health/1.0"
|
|
|
|
+ interval = "10"
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ lifecycle {
|
|
|
|
+ create_before_destroy = true
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ tags = merge(var.standard_tags, var.tags, { "Name" : "${var.prefix}-hec-static" })
|
|
}
|
|
}
|
|
|
|
|
|
resource "aws_lb_target_group_attachment" "hec_static" {
|
|
resource "aws_lb_target_group_attachment" "hec_static" {
|