diff --git a/packages/aws-cdk/README.md b/packages/aws-cdk/README.md index e3c5c06e3947b..bfd959d0d0920 100644 --- a/packages/aws-cdk/README.md +++ b/packages/aws-cdk/README.md @@ -456,7 +456,6 @@ You can optionally configure the behavior of your hotswap deployments in `cdk.js } ``` - **⚠ Note #1**: This command deliberately introduces drift in CloudFormation stacks in order to speed up deployments. For this reason, only use it for development purposes. **Never use this flag for your production deployments**! diff --git a/packages/aws-cdk/lib/api/hotswap/common.ts b/packages/aws-cdk/lib/api/hotswap/common.ts index 0f67256dc4d28..9000e3464e6c7 100644 --- a/packages/aws-cdk/lib/api/hotswap/common.ts +++ b/packages/aws-cdk/lib/api/hotswap/common.ts @@ -126,6 +126,7 @@ export class EcsHotswapProperties { if (maximumHealthyPercent !== undefined && maximumHealthyPercent < 0 ) { throw new Error('hotswap-ecs-maximum-healthy-percent can\'t be a negative number'); } + // In order to preserve the current behaviour, when minimumHealthyPercent is not defined, it will be set to the currently default value of 0 if (minimumHealthyPercent == undefined) { this.minimumHealthyPercent = 0; } else { diff --git a/packages/aws-cdk/lib/api/hotswap/ecs-services.ts b/packages/aws-cdk/lib/api/hotswap/ecs-services.ts index c6e621b72059e..e38cd3b9b4748 100644 --- a/packages/aws-cdk/lib/api/hotswap/ecs-services.ts +++ b/packages/aws-cdk/lib/api/hotswap/ecs-services.ts @@ -34,7 +34,7 @@ export async function isHotswappableEcsServiceChange( // hotswap is not possible in FALL_BACK mode reportNonHotswappableChange(ret, change, undefined, 'No ECS services reference the changed task definition', false); } if (resourcesReferencingTaskDef.length > ecsServicesReferencingTaskDef.length) { - // if something besides an ECS Service is rxeferencing the TaskDefinition, + // if something besides an ECS Service is referencing the TaskDefinition, // hotswap is not possible in FALL_BACK mode const nonEcsServiceTaskDefRefs = resourcesReferencingTaskDef.filter(r => r.Type !== 'AWS::ECS::Service'); for (const taskRef of nonEcsServiceTaskDefRefs) { diff --git a/packages/aws-cdk/test/api/hotswap/ecs-services-hotswap-deployments.test.ts b/packages/aws-cdk/test/api/hotswap/ecs-services-hotswap-deployments.test.ts index 8a48cc57f4a7b..176515e222e11 100644 --- a/packages/aws-cdk/test/api/hotswap/ecs-services-hotswap-deployments.test.ts +++ b/packages/aws-cdk/test/api/hotswap/ecs-services-hotswap-deployments.test.ts @@ -641,7 +641,6 @@ describe.each([HotswapMode.FALL_BACK, HotswapMode.HOTSWAP_ONLY])('%p mode', (hot describe.each([ new Configuration().settings.set(['hotswap'], { ecs: { minimumHealthyPercent: 10 } }), new Configuration().settings.set(['hotswap'], { ecs: { minimumHealthyPercent: 10, maximumHealthyPercent: 100 } }), - new Configuration().settings.set(['hotswap'], { ecs: { minimumHealthyPercent: 10, maximumHealthyPercent: 100 } }), ])('hotswap properties', (settings) => { test('should handle all possible hotswap properties', async () => { // GIVEN