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-pattens): pass healthy percent & deregistration delay params #28627

Closed
wants to merge 3 commits into from

Conversation

cheruvian
Copy link
Contributor

The ecs-patterns for multiple target groups expose a subset of the available properties for each of the lower level constructs form which it is composed. This subset seems to be manually curated today, however it excludes a number of production critical properties.

This change adds 2 such important properties that I have needed recently.

  • minHealthyPercent from AWS::ECS::Service
  • deregistrationDelay from AWS::ElasticLoadBalancingV2::TargetGroup's TargetGroupAttributes

I believe it may be possible/beneficial to operate on a block list rather than allow list of properties and include all the properties of the included child constructs (including docs, etc...) except for those that don't make sense in a multiple target group context. However, it wasn't clear if this change would be approved and as such I have considered this out of scope for this change, if that is acceptable or desired, I propose that as a different / additional scope of work.


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

@github-actions github-actions bot added beginning-contributor [Pilot] contributed between 0-2 PRs to the CDK p2 labels Jan 9, 2024
@aws-cdk-automation aws-cdk-automation requested a review from a team January 9, 2024 10:12
Copy link
Contributor

@kylelaker kylelaker left a comment

Choose a reason for hiding this comment

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

Providing a meaningful review is challenging while the build is failing. Reviewing the build logs, applying these changes to the README should fix the failing build.

packages/aws-cdk-lib/aws-ecs-patterns/README.md Outdated Show resolved Hide resolved
packages/aws-cdk-lib/aws-ecs-patterns/README.md Outdated Show resolved Hide resolved
@aws-cdk-automation aws-cdk-automation added the pr/needs-community-review This PR needs a review from a Trusted Community Member or Core Team Member. label Jan 16, 2024
@cheruvian
Copy link
Contributor Author

Any thoughts on this now that the build is passing @kylelaker?

@cheruvian
Copy link
Contributor Author

Found another one that I need today

stickinessCookieDuration

Can someone from AWS please advise if ApplicationTargetProps should just extend or otherwise delegate AddApplicationTargetsProps since that seems to be a majority of it's function. This would also allow for udpates to ALB Target Groups to be taken for 'free' ™ by the ecs patterns

*
* @default - 0 if daemon, otherwise 50
*/
readonly minHealthyPercent?: number;
Copy link
Contributor

Choose a reason for hiding this comment

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

could you add an @see here with a link to the docs?

Copy link
Contributor

Choose a reason for hiding this comment

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

also, I think I'd prefer this to be minimumHealthyPercent to match CloudFormation.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Not clear which docs link you'd prefer (CDK, CF or ECS), chose this: https://docs.aws.amazon.com/AmazonECS/latest/APIReference/API_DeploymentConfiguration.html

I also changed the naming per your recommendation to get this approved, however I don't love this since it diverges from the usage/naming used throughout the CDK (already been established in BaseServiceOptions)

https://github.com/aws/aws-cdk/blob/v2.133.0/packages/aws-cdk-lib/aws-ecs/lib/base/base-service.ts#L298
https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_ecs.FargateService.html#minhealthypercent

If CDK should match the CF naming then it should be updated everywhere rather than piecemeal IMO. This also makes it more of a challenge to re-use BaseServiceOptions similar to the above recommendation to just use ApplciationTargetProps. Are there any thoughts on this from the CDK team?

Copy link
Contributor

Choose a reason for hiding this comment

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

@cheruvian I didn't see it in BaseServiceOptions. Apologies, you can change it to make that.

Copy link
Contributor

Choose a reason for hiding this comment

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

Rest LGTM, if you want to change this back.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Any thoughts on whether this should actually just extend Omit<BaseServiceOptions, ...>?

@aws-cdk-automation
Copy link
Collaborator

AWS CodeBuild CI Report

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

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

* After this period, the cookie is considered stale. The minimum value is
* 1 second and the maximum value is 7 days (604800 seconds).
*
* @default Duration.days(1)
Copy link
Contributor

Choose a reason for hiding this comment

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

This should actually be Stickiness is disabled. See #29726

targetGroups: [
{
containerPort: 80,
deregistrationDelay: Duration.seconds(10),
stickinessCookieDuration: Duration.minutes(4),
Copy link
Contributor

Choose a reason for hiding this comment

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

can you add an integration test for NLB as well?

@TheRealAmazonKendra TheRealAmazonKendra changed the title feat(ecs): pass healthy percent & deregistraiton delay params in L3 constructs feat(ecs-pattens): pass healthy percent & deregistration delay params Apr 16, 2024
Copy link
Contributor

@TheRealAmazonKendra TheRealAmazonKendra left a comment

Choose a reason for hiding this comment

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

A couple things here:

Firstly +1 to the comments inline.

Secondly, from the amounts of updates in the integ test files, it looks like they were manually updated and that the test wasn't actually run. Please remove the manual updates and run the test with the --update-on-failed flag and then add all the resulting changes to this PR.

@aws-cdk-automation aws-cdk-automation removed the pr/needs-community-review This PR needs a review from a Trusted Community Member or Core Team Member. label Apr 16, 2024
@aws-cdk-automation
Copy link
Collaborator

This PR has been in the CHANGES REQUESTED state for 3 weeks, and looks abandoned. To keep this PR from being closed, please continue work on it. If not, it will automatically be closed in a week.

@aws-cdk-automation
Copy link
Collaborator

This PR has been deemed to be abandoned, and will be automatically closed. Please create a new PR for these changes if you think this decision has been made in error.

@aws-cdk-automation aws-cdk-automation added the closed-for-staleness This issue was automatically closed because it hadn't received any attention in a while. label May 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
beginning-contributor [Pilot] contributed between 0-2 PRs to the CDK closed-for-staleness This issue was automatically closed because it hadn't received any attention in a while. p2
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants