Skip to content

Commit

Permalink
Merge pull request #739 from wellcomecollection/rk/add-healthcheck-en…
Browse files Browse the repository at this point in the history
…dpoint-items

Adds a simple healthcheck endpoint for the items service
  • Loading branch information
kenoir authored Jan 25, 2024
2 parents 0d7e139 + 1da4ee6 commit b600b23
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
7 changes: 7 additions & 0 deletions items/src/main/scala/weco/api/items/ItemsApi.scala
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,13 @@ class ItemsApi(
case id =>
notFound(s"Work not found for identifier $id")
}
},
pathPrefix("management") {
concat(path("healthcheck") {
get {
complete("message" -> "ok")
}
})
}
)
}
3 changes: 3 additions & 0 deletions terraform/modules/stack/services.tf
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,9 @@ module "items_api" {
vpc_id = var.vpc_id
load_balancer_arn = aws_lb.catalogue_api.arn

# Use the HTTP healthcheck with a default path of /management/healthcheck
tcp_healthcheck = false

use_fargate_spot = var.environment_name == "stage" ? true : false
turn_off_outside_office_hours = var.environment_name == "stage" ? true : false
}
Expand Down

0 comments on commit b600b23

Please sign in to comment.