From 1095daa11c12a5792e81864b4d6f422c2af80742 Mon Sep 17 00:00:00 2001 From: Nick Lynch Date: Tue, 23 Nov 2021 13:24:17 +0000 Subject: [PATCH] chore(ecs): undeprecate Cluster.addCapacity (#17652) The `Cluster.addCapacity` method was deprecated in #14386 as part of the introduction of `Cluster.addAsgCapacityProvider`. However, the corresponding `ClusterProps.capacity` property and `AddCapacityOptions` interface were not deprecated, leading to a confusing mismash of deprecated and undeprecated usage. The README for ECS still heavily references `Cluster.addCapacity`, further leading to potential confusion for users just following the module's guidance. As part of cleaning up deprecated usage as part of the lead-up to the V2 launch, opting to un-deprecate the `addCapacity` method rather than deprecating the other two elements and rewriting the README. ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license* --- DEPRECATED_APIs.md | 1 - deprecated_apis.txt | 1 - packages/@aws-cdk/aws-ecs/lib/cluster.ts | 4 ++-- 3 files changed, 2 insertions(+), 4 deletions(-) diff --git a/DEPRECATED_APIs.md b/DEPRECATED_APIs.md index fdf0a1877b5dc..de3f69163db65 100644 --- a/DEPRECATED_APIs.md +++ b/DEPRECATED_APIs.md @@ -751,7 +751,6 @@ | @aws-cdk/aws-ecs | BaseService.​configureAwsVpcNetworking() | use configureAwsVpcNetworkingWithSecurityGroups instead. | | @aws-cdk/aws-ecs | BaseServiceOptions.​propagateTaskTagsFrom | Use `propagateTags` instead. | | @aws-cdk/aws-ecs | Cluster.​addAutoScalingGroup() | Use {@link Cluster.addAsgCapacityProvider} instead. | -| @aws-cdk/aws-ecs | Cluster.​addCapacity() | Use {@link Cluster.addAsgCapacityProvider} instead. | | @aws-cdk/aws-ecs | Cluster.​addCapacityProvider() | Use {@link enableFargateCapacityProviders} instead. | | @aws-cdk/aws-ecs | ClusterProps.​capacityProviders | Use {@link ClusterProps.enableFargateCapacityProviders} instead. | | @aws-cdk/aws-ecs | Ec2ServiceProps.​securityGroup | use securityGroups instead. | diff --git a/deprecated_apis.txt b/deprecated_apis.txt index cfda6c5068605..433d6fe5438eb 100644 --- a/deprecated_apis.txt +++ b/deprecated_apis.txt @@ -747,7 +747,6 @@ constructs.Node#uniqueId @aws-cdk/aws-ecs.BaseService#configureAwsVpcNetworking @aws-cdk/aws-ecs.BaseServiceOptions#propagateTaskTagsFrom @aws-cdk/aws-ecs.Cluster#addAutoScalingGroup -@aws-cdk/aws-ecs.Cluster#addCapacity @aws-cdk/aws-ecs.Cluster#addCapacityProvider @aws-cdk/aws-ecs.ClusterProps#capacityProviders @aws-cdk/aws-ecs.Ec2ServiceProps#securityGroup diff --git a/packages/@aws-cdk/aws-ecs/lib/cluster.ts b/packages/@aws-cdk/aws-ecs/lib/cluster.ts index 1b42dc6af4088..1dc50ac97ae49 100644 --- a/packages/@aws-cdk/aws-ecs/lib/cluster.ts +++ b/packages/@aws-cdk/aws-ecs/lib/cluster.ts @@ -287,11 +287,11 @@ export class Cluster extends Resource implements ICluster { } /** + * It is highly recommended to use {@link Cluster.addAsgCapacityProvider} instead of this method. + * * This method adds compute capacity to a cluster by creating an AutoScalingGroup with the specified options. * * Returns the AutoScalingGroup so you can add autoscaling settings to it. - * - * @deprecated Use {@link Cluster.addAsgCapacityProvider} instead. */ public addCapacity(id: string, options: AddCapacityOptions): autoscaling.AutoScalingGroup { // Do 2-way defaulting here: if the machineImageType is BOTTLEROCKET, pick the right AMI.