Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(ecs-patterns): adding support for custom HealthCheck in NetworkLoadBalancedFargateService #21083

Closed
wants to merge 3 commits into from

Conversation

daschaa
Copy link
Contributor

@daschaa daschaa commented Jul 10, 2022

Fixes #20233

Adds healthCheck property to NetworkLoadBalancedFargateService.


All Submissions:

Adding new Unconventional Dependencies:

  • This PR adds new unconventional dependencies following the process described here

New Features

  • Have you added the new feature to an integration test?
    • Did you use yarn integ to deploy the infrastructure and generate the snapshot (i.e. yarn integ without --dry-run)?

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license

@gitpod-io
Copy link

gitpod-io bot commented Jul 10, 2022

@github-actions github-actions bot added the p2 label Jul 10, 2022
@aws-cdk-automation aws-cdk-automation requested a review from a team July 10, 2022 16:11
@github-actions github-actions bot added effort/small Small work item – less than a day of effort feature-request A feature should be added or improved. labels Jul 10, 2022
@mergify mergify bot dismissed corymhall’s stale review July 11, 2022 19:04

Pull request has been modified.

@daschaa
Copy link
Contributor Author

daschaa commented Jul 11, 2022

@corymhall Thanks for your (as always) valuable feedback! I added more explanation to the docstring, I hope it is better now.
For the Readme I removed the property, but I don't know where to put a section about the health check. Maybe it is better to leave it out of the README and instead make the docstrings as good as possible? What do you think?

@aws-cdk-automation
Copy link
Collaborator

AWS CodeBuild CI Report

  • CodeBuild project: AutoBuildv2Project1C6BFA3F-wQm2hXv2jqQv
  • Commit ID: 76b9634
  • Result: SUCCEEDED
  • Build Logs (available for 30 days)

Powered by github-codebuild-logs, available on the AWS Serverless Application Repository

*
* @default - Health check configuration from container.
*/
readonly healthCheck?: HealthCheck;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

After thinking about this more, I'm not sure we should expose this on the top level props. For an ECS service there behind a load balancer there are two different types of health checks that you can use.

  1. ELB health checks (configured on the NLB in this case). The NLB will make a request to the service on a specific path/port and expect a certain response.
  2. Container health checks (what this PR exposes). The service itself can perform health checks against the running containers (in addition to the ELB health checks).

I'm not sure this is a common use case for services running behind an ELB. The other linked PR that implemented this for the QueueProcessing service makes more sense because it is a worker service that is not running behind an ELB so container health checks are the only type of health check available.

I think in the majority of cases the user wants to configure the ELB health check and exposing this at the top level (an not the elb health check) would lead to more confusion and users configuring container health checks when they don't need to.

cc @madeline-k for a second opinion.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@corymhall Ok I think this makes sense. Maybe we should close this (and the linked issue) and come up with a solution if there is a real need for this. And even then explicitly document the consequences.

And I want to apologize for implementing this feature without really thinking about it. I will try to go more in-depth in a topic I will implement in the future.

@corymhall corymhall closed this Aug 3, 2022
@daschaa daschaa deleted the ecs_patterns_health_check branch August 8, 2022 18:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
effort/small Small work item – less than a day of effort feature-request A feature should be added or improved. p2
Projects
None yet
Development

Successfully merging this pull request may close these issues.

@aws-cdk/aws-ecs-patterns: Add ability to set healthCheck for NetworkLoadBalancedFargateService
3 participants