Skip to content

Commit 69e53ef

Browse files
committed
mid work
1 parent bc6e336 commit 69e53ef

File tree

3 files changed

+84
-0
lines changed

3 files changed

+84
-0
lines changed

packages/aws-cdk/lib/cli/convert-to-user-input.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,9 @@ export function convertYargsToUserInput(args: any): UserInput {
114114
rollback: args.rollback,
115115
hotswap: args.hotswap,
116116
hotswapFallback: args.hotswapFallback,
117+
hotswapEcsMinimumHealthyPercent: args.hotswapEcsMinimumHealthyPercent,
118+
hotswapEcsMaximumHealthyPercent: args.hotswapEcsMaximumHealthyPercent,
119+
hotswapEcsStabilizationTimeoutSeconds: args.hotswapEcsStabilizationTimeoutSeconds,
117120
watch: args.watch,
118121
logs: args.logs,
119122
concurrency: args.concurrency,
@@ -159,6 +162,9 @@ export function convertYargsToUserInput(args: any): UserInput {
159162
rollback: args.rollback,
160163
hotswap: args.hotswap,
161164
hotswapFallback: args.hotswapFallback,
165+
hotswapEcsMinimumHealthyPercent: args.hotswapEcsMinimumHealthyPercent,
166+
hotswapEcsMaximumHealthyPercent: args.hotswapEcsMaximumHealthyPercent,
167+
hotswapEcsStabilizationTimeoutSeconds: args.hotswapEcsStabilizationTimeoutSeconds,
162168
logs: args.logs,
163169
concurrency: args.concurrency,
164170
STACKS: args.STACKS,
@@ -356,6 +362,9 @@ export function convertConfigToUserInput(config: any): UserInput {
356362
rollback: config.deploy?.rollback,
357363
hotswap: config.deploy?.hotswap,
358364
hotswapFallback: config.deploy?.hotswapFallback,
365+
hotswapEcsMinimumHealthyPercent: config.deploy?.hotswapEcsMinimumHealthyPercent,
366+
hotswapEcsMaximumHealthyPercent: config.deploy?.hotswapEcsMaximumHealthyPercent,
367+
hotswapEcsStabilizationTimeoutSeconds: config.deploy?.hotswapEcsStabilizationTimeoutSeconds,
359368
watch: config.deploy?.watch,
360369
logs: config.deploy?.logs,
361370
concurrency: config.deploy?.concurrency,
@@ -389,6 +398,9 @@ export function convertConfigToUserInput(config: any): UserInput {
389398
rollback: config.watch?.rollback,
390399
hotswap: config.watch?.hotswap,
391400
hotswapFallback: config.watch?.hotswapFallback,
401+
hotswapEcsMinimumHealthyPercent: config.watch?.hotswapEcsMinimumHealthyPercent,
402+
hotswapEcsMaximumHealthyPercent: config.watch?.hotswapEcsMaximumHealthyPercent,
403+
hotswapEcsStabilizationTimeoutSeconds: config.watch?.hotswapEcsStabilizationTimeoutSeconds,
392404
logs: config.watch?.logs,
393405
concurrency: config.watch?.concurrency,
394406
};

packages/aws-cdk/lib/cli/parse-command-line-arguments.ts

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -464,6 +464,21 @@ export function parseCommandLineArguments(args: Array<string>): any {
464464
type: 'boolean',
465465
desc: "Attempts to perform a 'hotswap' deployment, which skips CloudFormation and updates the resources directly, and falls back to a full deployment if that is not possible. Do not use this in production environments",
466466
})
467+
.option('hotswap-ecs-minimum-healthy-percent', {
468+
default: undefined,
469+
type: 'string',
470+
desc: "Lower limit on the number of your service's tasks that must remain in the RUNNING state during a deployment, as a percentage of the desiredCount",
471+
})
472+
.option('hotswap-ecs-maximum-healthy-percent', {
473+
default: undefined,
474+
type: 'string',
475+
desc: "Upper limit on the number of your service's tasks that are allowed in the RUNNING or PENDING state during a deployment, as a percentage of the desiredCount",
476+
})
477+
.option('hotswap-ecs-stabilization-timeout-seconds', {
478+
default: undefined,
479+
type: 'string',
480+
desc: 'Number of seconds to wait for a single service to reach stable state, where the desiredCount is equal to the runningCount',
481+
})
467482
.option('watch', {
468483
default: undefined,
469484
type: 'boolean',
@@ -628,6 +643,21 @@ export function parseCommandLineArguments(args: Array<string>): any {
628643
type: 'boolean',
629644
desc: "Attempts to perform a 'hotswap' deployment, which skips CloudFormation and updates the resources directly, and falls back to a full deployment if that is not possible.",
630645
})
646+
.option('hotswap-ecs-minimum-healthy-percent', {
647+
default: undefined,
648+
type: 'string',
649+
desc: "Lower limit on the number of your service's tasks that must remain in the RUNNING state during a deployment, as a percentage of the desiredCount",
650+
})
651+
.option('hotswap-ecs-maximum-healthy-percent', {
652+
default: undefined,
653+
type: 'string',
654+
desc: "Upper limit on the number of your service's tasks that are allowed in the RUNNING or PENDING state during a deployment, as a percentage of the desiredCount",
655+
})
656+
.option('hotswap-ecs-stabilization-timeout-seconds', {
657+
default: undefined,
658+
type: 'string',
659+
desc: 'Number of seconds to wait for a single service to reach stable state, where the desiredCount is equal to the runningCount',
660+
})
631661
.option('logs', {
632662
default: true,
633663
type: 'boolean',

packages/aws-cdk/lib/cli/user-input.ts

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -739,6 +739,27 @@ export interface DeployOptions {
739739
*/
740740
readonly hotswapFallback?: boolean;
741741

742+
/**
743+
* Lower limit on the number of your service's tasks that must remain in the RUNNING state during a deployment, as a percentage of the desiredCount
744+
*
745+
* @default - undefined
746+
*/
747+
readonly hotswapEcsMinimumHealthyPercent?: string;
748+
749+
/**
750+
* Upper limit on the number of your service's tasks that are allowed in the RUNNING or PENDING state during a deployment, as a percentage of the desiredCount
751+
*
752+
* @default - undefined
753+
*/
754+
readonly hotswapEcsMaximumHealthyPercent?: string;
755+
756+
/**
757+
* Number of seconds to wait for a single service to reach stable state, where the desiredCount is equal to the runningCount
758+
*
759+
* @default - undefined
760+
*/
761+
readonly hotswapEcsStabilizationTimeoutSeconds?: string;
762+
742763
/**
743764
* Continuously observe the project files, and deploy the given stack(s) automatically when changes are detected. Implies --hotswap by default
744765
*
@@ -978,6 +999,27 @@ export interface WatchOptions {
978999
*/
9791000
readonly hotswapFallback?: boolean;
9801001

1002+
/**
1003+
* Lower limit on the number of your service's tasks that must remain in the RUNNING state during a deployment, as a percentage of the desiredCount
1004+
*
1005+
* @default - undefined
1006+
*/
1007+
readonly hotswapEcsMinimumHealthyPercent?: string;
1008+
1009+
/**
1010+
* Upper limit on the number of your service's tasks that are allowed in the RUNNING or PENDING state during a deployment, as a percentage of the desiredCount
1011+
*
1012+
* @default - undefined
1013+
*/
1014+
readonly hotswapEcsMaximumHealthyPercent?: string;
1015+
1016+
/**
1017+
* Number of seconds to wait for a single service to reach stable state, where the desiredCount is equal to the runningCount
1018+
*
1019+
* @default - undefined
1020+
*/
1021+
readonly hotswapEcsStabilizationTimeoutSeconds?: string;
1022+
9811023
/**
9821024
* Show CloudWatch log events from all resources in the selected Stacks in the terminal. 'true' by default, use --no-logs to turn off
9831025
*

0 commit comments

Comments
 (0)