Skip to content

Commit 6bd8960

Browse files
authored
Add Application Load Balancer health check settings since the ALB health check does not take into account the Elastic Beanstalk health check path (#12)
1 parent 60e4d13 commit 6bd8960

File tree

2 files changed

+19
-2
lines changed

2 files changed

+19
-2
lines changed

main.tf

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -570,7 +570,6 @@ resource "aws_elastic_beanstalk_environment" "default" {
570570
name = "Application Healthcheck URL"
571571
value = "HTTP:80${var.healthcheck_url}"
572572
}
573-
574573
setting {
575574
namespace = "aws:elasticbeanstalk:environment"
576575
name = "LoadBalancerType"
@@ -882,6 +881,25 @@ resource "aws_elastic_beanstalk_environment" "default" {
882881
name = "${null_resource.env_vars.49.triggers.key}"
883882
value = "${null_resource.env_vars.49.triggers.value}"
884883
}
884+
###===================== Application Load Balancer Health check settings =====================================================###
885+
# The Application Load Balancer health check does not take into account the Elastic Beanstalk health check path
886+
# http://docs.aws.amazon.com/elasticbeanstalk/latest/dg/environments-cfg-applicationloadbalancer.html
887+
# http://docs.aws.amazon.com/elasticbeanstalk/latest/dg/environments-cfg-applicationloadbalancer.html#alb-default-process.config
888+
setting {
889+
namespace = "aws:elasticbeanstalk:environment:process:default"
890+
name = "HealthCheckPath"
891+
value = "${var.healthcheck_url}"
892+
}
893+
setting {
894+
namespace = "aws:elasticbeanstalk:environment:process:default"
895+
name = "Port"
896+
value = "80"
897+
}
898+
setting {
899+
namespace = "aws:elasticbeanstalk:environment:process:default"
900+
name = "Protocol"
901+
value = "HTTP"
902+
}
885903
depends_on = ["aws_security_group.default"]
886904
}
887905

variables.tf

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ variable "http_listener_enabled" {
2626
default = false
2727
}
2828

29-
3029
variable "zone_id" {
3130
default = ""
3231
}

0 commit comments

Comments
 (0)