QueueProcessingFargateService currently does not offer healthCheck options property, even though it is very simple to add it here:
|
this.taskDefinition.addContainer(containerName, { |
So, there is no good way to set a healthCheck on a container.
Use Case
I use healthcheck to make sure the tasks are healthy. Fargate ignores HEALTHCHECK instruction in Dockerfile, so I am forced to supply the healthCheck instruction via CDK. However, QueueProcessingFargateService does not let me.
Proposed Solution
Add a healthcheck property here:
|
export interface QueueProcessingFargateServiceProps extends QueueProcessingServiceBaseProps { |
Pass it to the container here:
|
this.taskDefinition.addContainer(containerName, { |
Workaround
This is not nice, but works.
// @ts-ignore
service.taskDefinition.defaultContainer!.props.healthCheck = <ecs.HealthCheck>{
command: ['CMD', 'node /app/healthcheck.js'],
interval: cdk.Duration.seconds(15),
retries: 3,
timeout: cdk.Duration.seconds(5),
};
This is a 🚀 Feature Request
QueueProcessingFargateServicecurrently does not offerhealthCheckoptions property, even though it is very simple to add it here:aws-cdk/packages/@aws-cdk/aws-ecs-patterns/lib/fargate/queue-processing-fargate-service.ts
Line 124 in 8668e15
So, there is no good way to set a
healthCheckon a container.Use Case
I use healthcheck to make sure the tasks are healthy. Fargate ignores
HEALTHCHECKinstruction inDockerfile, so I am forced to supply thehealthCheckinstruction via CDK. However,QueueProcessingFargateServicedoes not let me.Proposed Solution
Add a healthcheck property here:
aws-cdk/packages/@aws-cdk/aws-ecs-patterns/lib/fargate/queue-processing-fargate-service.ts
Line 10 in 8668e15
Pass it to the container here:
aws-cdk/packages/@aws-cdk/aws-ecs-patterns/lib/fargate/queue-processing-fargate-service.ts
Line 124 in 8668e15
Workaround
This is not nice, but works.
This is a 🚀 Feature Request