Closed SylvainMartel closed 4 years ago
The book and code examples do not set the port
parameter in the health_check
block: https://github.com/brikis98/terraform-up-and-running-code/blob/master/code/terraform/02-intro-to-terraform-syntax/webserver-cluster/main.tf#L92-L109. That means it should fall back to the traffic port, which is set to var.server_port
, which is 8080. Are you seeing something different?
Found my mistake, error in the server_port variable. Closing this, thanks!
When we create the target group, with the load balancer and the health check, the result is always unhealthy so it keeps deregistering old vm and spinning new one. But looking at the code, the HTTP health check is done on port 80, while the VM security group, and the httpd are configured on port 8080 only