Adding generic health check for sample service
This commit is contained in:
		
							parent
							
								
									fafaae4ba7
								
							
						
					
					
						commit
						6b0f985cd9
					
				@ -14,15 +14,21 @@ resource "aws_lb" "alpha" {
 | 
			
		||||
    enable_deletion_protection = false
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
# ECS services manage themselves when it comes to registering to the
 | 
			
		||||
# target group so we only need to provide the pool
 | 
			
		||||
####################################################################
 | 
			
		||||
## ECS services manage themselves when it comes to registering to the
 | 
			
		||||
## target group so we only need to provide the pool
 | 
			
		||||
#####################################################################
 | 
			
		||||
resource "aws_lb_target_group" "alpha_cluster" {
 | 
			
		||||
  name = "${var.athens_prefix}-alpha-cluster"
 | 
			
		||||
  port = 80
 | 
			
		||||
  protocol = "HTTP"
 | 
			
		||||
  target_type = "ip"
 | 
			
		||||
  vpc_id = aws_vpc.athens_vpc.id
 | 
			
		||||
  health_check {
 | 
			
		||||
    path = "/"
 | 
			
		||||
    matcher = "200-299"
 | 
			
		||||
    port = 80
 | 
			
		||||
    interval = 60
 | 
			
		||||
  }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
resource "aws_lb_listener" "http" {
 | 
			
		||||
@ -34,3 +40,4 @@ resource "aws_lb_listener" "http" {
 | 
			
		||||
      target_group_arn = aws_lb_target_group.alpha_cluster.arn
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
		Loading…
	
		Reference in New Issue
	
	Block a user