serverless-fargate icon indicating copy to clipboard operation
serverless-fargate copied to clipboard

Define HealthCheck command

Open alex-shortt opened this issue 3 years ago • 1 comments

Couldn't find if there's a way to hook up a load balancer to this service, but regardless it would be nice to have the ability to set a HealthCheck command .. docs here: https://docs.aws.amazon.com/AmazonECS/latest/APIReference/API_HealthCheck.html

alex-shortt avatar Aug 11 '22 00:08 alex-shortt

You should be able to specify a container health-check (https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecs-taskdefinition-containerdefinitions.html) using the recently added cloudFormationResource configuration. This allows you to add additional CloudFormation properties for given resources, in this case the container.

eddmann avatar Aug 22 '22 22:08 eddmann

Hello. I'm a user of the project. Thanks a bunch to all the contributors.

I came upon this issue because I wanted to add a healthCheck to my container. Initially, I thought I'd need to fork the project or make a PR until I found the cloudFormationResource configuration. Would the healthCheck feature be something you'd consider adding to the main config? If not, could you please explain where the line is drawn between adding things to the main config and using, what I see as the escape hatch, the cloudFormationResource configuration?

I think it would be valuable to add the healthCheck to the main config for a task, and I would be willing to contribute this feature.

daniel1dolan avatar Aug 16 '23 15:08 daniel1dolan