-
Notifications
You must be signed in to change notification settings - Fork 3.9k
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -113,6 +113,16 @@ export interface ApplicationMultipleTargetGroupsServiceBaseProps { | |
* @default - false | ||
*/ | ||
readonly enableExecuteCommand?: boolean; | ||
|
||
/** | ||
* The minimum number of tasks, specified as a percentage of | ||
* the Amazon ECS service's DesiredCount value, that must | ||
* continue to run and remain healthy during a deployment. | ||
* | ||
* @see https://docs.aws.amazon.com/AmazonECS/latest/APIReference/API_DeploymentConfiguration.html | ||
* @default - 0 if daemon, otherwise 50 | ||
*/ | ||
readonly minHealthyPercent?: number; | ||
} | ||
|
||
/** | ||
|
@@ -267,6 +277,26 @@ export interface ApplicationTargetProps { | |
* @default No path condition | ||
*/ | ||
readonly pathPattern?: string; | ||
|
||
/** | ||
* The amount of time for Elastic Load Balancing to wait before deregistering a target. | ||
* | ||
* The range is 0-3600 seconds. | ||
* | ||
* @default 300 | ||
*/ | ||
readonly deregistrationDelay?: Duration; | ||
/** | ||
* The stickiness cookie expiration period. | ||
* | ||
* Setting this value enables load balancer stickiness. | ||
* | ||
* 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) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This should actually be |
||
*/ | ||
readonly stickinessCookieDuration?: Duration; | ||
} | ||
|
||
/** | ||
|
@@ -515,6 +545,8 @@ export abstract class ApplicationMultipleTargetGroupsServiceBase extends Constru | |
}), | ||
], | ||
conditions, | ||
deregistrationDelay: targetProps.deregistrationDelay, | ||
stickinessCookieDuration: targetProps.stickinessCookieDuration, | ||
priority: targetProps.priority, | ||
}); | ||
this.targetGroups.push(targetGroup); | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -104,6 +104,16 @@ export interface NetworkMultipleTargetGroupsServiceBaseProps { | |
* @default - false | ||
*/ | ||
readonly enableExecuteCommand?: boolean; | ||
|
||
/** | ||
* The minimum number of tasks, specified as a percentage of | ||
* the Amazon ECS service's DesiredCount value, that must | ||
* continue to run and remain healthy during a deployment. | ||
* | ||
* @see https://docs.aws.amazon.com/AmazonECS/latest/APIReference/API_DeploymentConfiguration.html | ||
* @default - 0 if daemon, otherwise 50 | ||
*/ | ||
readonly minHealthyPercent?: number; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. could you add an There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. also, I think I'd prefer this to be There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 https://github.com/aws/aws-cdk/blob/v2.133.0/packages/aws-cdk-lib/aws-ecs/lib/base/base-service.ts#L298 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 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @cheruvian I didn't see it in There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Rest LGTM, if you want to change this back. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Any thoughts on whether this should actually just |
||
} | ||
|
||
/** | ||
|
@@ -267,6 +277,15 @@ export interface NetworkTargetProps { | |
* @default - default listener (first added listener) | ||
*/ | ||
readonly listener?: string; | ||
|
||
/** | ||
* The amount of time for Elastic Load Balancing to wait before deregistering a target. | ||
* | ||
* The range is 0-3600 seconds. | ||
* | ||
* @default 300 | ||
*/ | ||
readonly deregistrationDelay?: Duration; | ||
} | ||
|
||
/** | ||
|
@@ -393,6 +412,7 @@ export abstract class NetworkMultipleTargetGroupsServiceBase extends Construct { | |
containerPort: targetProps.containerPort, | ||
}), | ||
], | ||
deregistrationDelay: targetProps.deregistrationDelay, | ||
}); | ||
this.targetGroups.push(targetGroup); | ||
} | ||
|
There was a problem hiding this comment.
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?