From e3565cb0787dc2a8ed867e2642c9a46886cbaadf Mon Sep 17 00:00:00 2001 From: Michael Sambol Date: Thu, 29 Feb 2024 16:11:34 -0700 Subject: [PATCH] add feedback from Grace --- packages/aws-cdk-lib/aws-ecs/lib/cluster.ts | 2 ++ packages/aws-cdk-lib/aws-ecs/test/cluster.test.ts | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/packages/aws-cdk-lib/aws-ecs/lib/cluster.ts b/packages/aws-cdk-lib/aws-ecs/lib/cluster.ts index 2a49c0cc5fac8..95979e740f8b2 100644 --- a/packages/aws-cdk-lib/aws-ecs/lib/cluster.ts +++ b/packages/aws-cdk-lib/aws-ecs/lib/cluster.ts @@ -1168,6 +1168,8 @@ export interface AsgCapacityProviderProps extends AddAutoScalingGroupCapacityOpt * The name of the capacity provider. If a name is specified, * it cannot start with `aws`, `ecs`, or `fargate`. If no name is specified, * a default name in the CFNStackName-CFNResourceName-RandomString format is used. + * If the stack name starts with `aws`, `ecs`, or `fargate`, a unique resource name + * is generated that starts with `cp-`. * * @default CloudFormation-generated name */ diff --git a/packages/aws-cdk-lib/aws-ecs/test/cluster.test.ts b/packages/aws-cdk-lib/aws-ecs/test/cluster.test.ts index 1901afc481353..260cd89b60c9c 100644 --- a/packages/aws-cdk-lib/aws-ecs/test/cluster.test.ts +++ b/packages/aws-cdk-lib/aws-ecs/test/cluster.test.ts @@ -2928,7 +2928,7 @@ test('can add ASG capacity via Capacity Provider by not specifying machineImageT }); -test('throws when ASG Capacity Provider with capacityProviderName starting with aws, ecs or faragte', () => { +test('throws when ASG Capacity Provider with capacityProviderName starting with aws, ecs or fargate', () => { // GIVEN const app = new cdk.App(); const stack = new cdk.Stack(app, 'test'); @@ -2965,7 +2965,7 @@ test('throws when ASG Capacity Provider with capacityProviderName starting with }).toThrow(/Invalid Capacity Provider Name: ecscp, If a name is specified, it cannot start with aws, ecs, or fargate./); }); -test('throws when ASG Capacity Provider with no capacityProviderName but stack name starting with aws, ecs or faragte', () => { +test('throws when ASG Capacity Provider with no capacityProviderName but stack name starting with aws, ecs or fargate', () => { // GIVEN const app = new cdk.App(); const stack = new cdk.Stack(app, 'ecscp');