Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions packages/aws-cdk/lib/cli/cli-config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -183,15 +183,15 @@ export async function makeConfig(): Promise<CliConfig> {
'Do not use this in production environments',
},
'hotswap-ecs-minimum-healthy-percent': {
type: 'string',
type: 'number',
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',
},
'hotswap-ecs-maximum-healthy-percent': {
type: 'string',
type: 'number',
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',
},
'hotswap-ecs-stabilization-timeout-seconds': {
type: 'string',
type: 'number',
desc: 'Number of seconds to wait for a single service to reach stable state, where the desiredCount is equal to the runningCount',
},
'watch': {
Expand Down Expand Up @@ -312,15 +312,15 @@ export async function makeConfig(): Promise<CliConfig> {
'and falls back to a full deployment if that is not possible.',
},
'hotswap-ecs-minimum-healthy-percent': {
type: 'string',
type: 'number',
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',
},
'hotswap-ecs-maximum-healthy-percent': {
type: 'string',
type: 'number',
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',
},
'hotswap-ecs-stabilization-timeout-seconds': {
type: 'string',
type: 'number',
desc: 'Number of seconds to wait for a single service to reach stable state, where the desiredCount is equal to the runningCount',
},
'logs': {
Expand Down
12 changes: 6 additions & 6 deletions packages/aws-cdk/lib/cli/cli-type-registry.json
Original file line number Diff line number Diff line change
Expand Up @@ -518,15 +518,15 @@
"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"
},
"hotswap-ecs-minimum-healthy-percent": {
"type": "string",
"type": "number",
"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"
},
"hotswap-ecs-maximum-healthy-percent": {
"type": "string",
"type": "number",
"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"
},
"hotswap-ecs-stabilization-timeout-seconds": {
"type": "string",
"type": "number",
"desc": "Number of seconds to wait for a single service to reach stable state, where the desiredCount is equal to the runningCount"
},
"watch": {
Expand Down Expand Up @@ -696,15 +696,15 @@
"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."
},
"hotswap-ecs-minimum-healthy-percent": {
"type": "string",
"type": "number",
"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"
},
"hotswap-ecs-maximum-healthy-percent": {
"type": "string",
"type": "number",
"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"
},
"hotswap-ecs-stabilization-timeout-seconds": {
"type": "string",
"type": "number",
"desc": "Number of seconds to wait for a single service to reach stable state, where the desiredCount is equal to the runningCount"
},
"logs": {
Expand Down
12 changes: 6 additions & 6 deletions packages/aws-cdk/lib/cli/parse-command-line-arguments.ts
Original file line number Diff line number Diff line change
Expand Up @@ -550,17 +550,17 @@ export function parseCommandLineArguments(args: Array<string>): any {
})
.option('hotswap-ecs-minimum-healthy-percent', {
default: undefined,
type: 'string',
type: 'number',
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",
})
.option('hotswap-ecs-maximum-healthy-percent', {
default: undefined,
type: 'string',
type: 'number',
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",
})
.option('hotswap-ecs-stabilization-timeout-seconds', {
default: undefined,
type: 'string',
type: 'number',
desc: 'Number of seconds to wait for a single service to reach stable state, where the desiredCount is equal to the runningCount',
})
.option('watch', {
Expand Down Expand Up @@ -729,17 +729,17 @@ export function parseCommandLineArguments(args: Array<string>): any {
})
.option('hotswap-ecs-minimum-healthy-percent', {
default: undefined,
type: 'string',
type: 'number',
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",
})
.option('hotswap-ecs-maximum-healthy-percent', {
default: undefined,
type: 'string',
type: 'number',
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",
})
.option('hotswap-ecs-stabilization-timeout-seconds', {
default: undefined,
type: 'string',
type: 'number',
desc: 'Number of seconds to wait for a single service to reach stable state, where the desiredCount is equal to the runningCount',
})
.option('logs', {
Expand Down
12 changes: 6 additions & 6 deletions packages/aws-cdk/lib/cli/user-input.ts
Original file line number Diff line number Diff line change
Expand Up @@ -867,21 +867,21 @@ export interface DeployOptions {
*
* @default - undefined
*/
readonly hotswapEcsMinimumHealthyPercent?: string;
readonly hotswapEcsMinimumHealthyPercent?: number;

/**
* 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
*
* @default - undefined
*/
readonly hotswapEcsMaximumHealthyPercent?: string;
readonly hotswapEcsMaximumHealthyPercent?: number;

/**
* Number of seconds to wait for a single service to reach stable state, where the desiredCount is equal to the runningCount
*
* @default - undefined
*/
readonly hotswapEcsStabilizationTimeoutSeconds?: string;
readonly hotswapEcsStabilizationTimeoutSeconds?: number;

/**
* Continuously observe the project files, and deploy the given stack(s) automatically when changes are detected. Implies --hotswap by default
Expand Down Expand Up @@ -1127,21 +1127,21 @@ export interface WatchOptions {
*
* @default - undefined
*/
readonly hotswapEcsMinimumHealthyPercent?: string;
readonly hotswapEcsMinimumHealthyPercent?: number;

/**
* 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
*
* @default - undefined
*/
readonly hotswapEcsMaximumHealthyPercent?: string;
readonly hotswapEcsMaximumHealthyPercent?: number;

/**
* Number of seconds to wait for a single service to reach stable state, where the desiredCount is equal to the runningCount
*
* @default - undefined
*/
readonly hotswapEcsStabilizationTimeoutSeconds?: string;
readonly hotswapEcsStabilizationTimeoutSeconds?: number;

/**
* Show CloudWatch log events from all resources in the selected Stacks in the terminal. 'true' by default, use --no-logs to turn off
Expand Down
23 changes: 23 additions & 0 deletions packages/aws-cdk/test/cli/cli-arguments.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,29 @@ describe('yargs', () => {
globalOptions: expect.anything(),
});
});

test('hotswap ECS arguments are correctly parsed', async () => {
const input = await parseCommandLineArguments([
'deploy',
'--hotswap',
'--hotswap-ecs-minimum-healthy-percent', '100',
'--hotswap-ecs-maximum-healthy-percent', '250',
'--hotswap-ecs-stabilization-timeout-seconds', '300',
]);

const result = convertYargsToUserInput(input);

expect(result).toEqual({
command: 'deploy',
deploy: expect.objectContaining({
hotswap: true,
hotswapEcsMinimumHealthyPercent: 100,
hotswapEcsMaximumHealthyPercent: 250,
hotswapEcsStabilizationTimeoutSeconds: 300,
}),
globalOptions: expect.anything(),
});
});
});

describe('config', () => {
Expand Down
Loading