Skip to content

Commit

Permalink
add health checks
Browse files Browse the repository at this point in the history
  • Loading branch information
ris-tlp committed Feb 29, 2024
1 parent 18dc7ce commit b037dc2
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 1 deletion.
4 changes: 4 additions & 0 deletions api/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,10 @@
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-amqp</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-actuator</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
Expand Down
1 change: 1 addition & 0 deletions api/src/main/resources/config/application.properties
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
spring.application.name=observation-tracker
spring.profiles.active=prod

management.endpoint.health.show-details=always
10 changes: 9 additions & 1 deletion infrastructure/ecr_alb.tf
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,14 @@ resource "aws_lb_target_group" "observation_tracker_api" {
target_type = "ip"
vpc_id = aws_vpc.vpc.id

health_check {
enabled = true
healthy_threshold = 2
interval = 30
path = "/actuator/health/db"
matcher = "200"
}

depends_on = [aws_alb.observation_tracker_alb]
}

Expand All @@ -28,7 +36,7 @@ resource "aws_alb" "observation_tracker_alb" {

resource "aws_alb_listener" "sun_api_http" {
load_balancer_arn = aws_alb.observation_tracker_alb.arn
port = "80"
port = 80
protocol = "HTTP"

default_action {
Expand Down

0 comments on commit b037dc2

Please sign in to comment.