Skip to content

Commit 3d12b74

Browse files
author
awstools
committed
feat(client-ecs): This release adds support for the Availability Zone rebalancing feature on Amazon ECS.
1 parent 9e49c84 commit 3d12b74

File tree

9 files changed

+130
-44
lines changed

9 files changed

+130
-44
lines changed

clients/client-ecs/src/commands/CreateServiceCommand.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,7 @@ export interface CreateServiceCommandOutput extends CreateServiceResponse, __Met
122122
* cluster: "STRING_VALUE",
123123
* serviceName: "STRING_VALUE", // required
124124
* taskDefinition: "STRING_VALUE",
125+
* availabilityZoneRebalancing: "ENABLED" || "DISABLED",
125126
* loadBalancers: [ // LoadBalancers
126127
* { // LoadBalancer
127128
* targetGroupArn: "STRING_VALUE",
@@ -558,6 +559,7 @@ export interface CreateServiceCommandOutput extends CreateServiceResponse, __Met
558559
* // enableECSManagedTags: true || false,
559560
* // propagateTags: "TASK_DEFINITION" || "SERVICE" || "NONE",
560561
* // enableExecuteCommand: true || false,
562+
* // availabilityZoneRebalancing: "ENABLED" || "DISABLED",
561563
* // },
562564
* // };
563565
*

clients/client-ecs/src/commands/DeleteCapacityProviderCommand.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ export interface DeleteCapacityProviderCommandOutput extends DeleteCapacityProvi
3939
* <code>forceNewDeployment</code> option can be used to ensure that any tasks using the Amazon EC2
4040
* instance capacity provided by the capacity provider are transitioned to use the capacity from the
4141
* remaining capacity providers. Only capacity providers that aren't associated with a cluster can be
42-
* deleted. To remove a capacity provider from a cluster, you can either use <a href="https://docs.aws.amazon.com/AmazonECS/latest/APIReference/API_PutCapacityProviderProviders.html">PutCapacityProviderProviders</a> or delete the cluster.</p>
42+
* deleted. To remove a capacity provider from a cluster, you can either use <a href="https://docs.aws.amazon.com/AmazonECS/latest/APIReference/API_PutClusterCapacityProviders.html">PutClusterCapacityProviders</a> or delete the cluster.</p>
4343
* @example
4444
* Use a bare-bones client and the command you need to make an API call.
4545
* ```javascript

clients/client-ecs/src/commands/DeleteServiceCommand.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -337,6 +337,7 @@ export interface DeleteServiceCommandOutput extends DeleteServiceResponse, __Met
337337
* // enableECSManagedTags: true || false,
338338
* // propagateTags: "TASK_DEFINITION" || "SERVICE" || "NONE",
339339
* // enableExecuteCommand: true || false,
340+
* // availabilityZoneRebalancing: "ENABLED" || "DISABLED",
340341
* // },
341342
* // };
342343
*

clients/client-ecs/src/commands/DescribeServicesCommand.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -325,6 +325,7 @@ export interface DescribeServicesCommandOutput extends DescribeServicesResponse,
325325
* // enableECSManagedTags: true || false,
326326
* // propagateTags: "TASK_DEFINITION" || "SERVICE" || "NONE",
327327
* // enableExecuteCommand: true || false,
328+
* // availabilityZoneRebalancing: "ENABLED" || "DISABLED",
328329
* // },
329330
* // ],
330331
* // failures: [ // Failures

clients/client-ecs/src/commands/UpdateServiceCommand.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -190,6 +190,7 @@ export interface UpdateServiceCommandOutput extends UpdateServiceResponse, __Met
190190
* enable: true || false, // required
191191
* },
192192
* },
193+
* availabilityZoneRebalancing: "ENABLED" || "DISABLED",
193194
* networkConfiguration: { // NetworkConfiguration
194195
* awsvpcConfiguration: { // AwsVpcConfiguration
195196
* subnets: [ // required
@@ -591,6 +592,7 @@ export interface UpdateServiceCommandOutput extends UpdateServiceResponse, __Met
591592
* // enableECSManagedTags: true || false,
592593
* // propagateTags: "TASK_DEFINITION" || "SERVICE" || "NONE",
593594
* // enableExecuteCommand: true || false,
595+
* // availabilityZoneRebalancing: "ENABLED" || "DISABLED",
594596
* // },
595597
* // };
596598
*

clients/client-ecs/src/models/models_0.ts

Lines changed: 35 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -1294,6 +1294,21 @@ export class ClusterNotFoundException extends __BaseException {
12941294
}
12951295
}
12961296

1297+
/**
1298+
* @public
1299+
* @enum
1300+
*/
1301+
export const AvailabilityZoneRebalancing = {
1302+
DISABLED: "DISABLED",
1303+
ENABLED: "ENABLED",
1304+
} as const;
1305+
1306+
/**
1307+
* @public
1308+
*/
1309+
export type AvailabilityZoneRebalancing =
1310+
(typeof AvailabilityZoneRebalancing)[keyof typeof AvailabilityZoneRebalancing];
1311+
12971312
/**
12981313
* <p>One of the methods which provide a way for you to quickly identify when a deployment has failed, and
12991314
* then to optionally roll back the failure to the last working deployment.</p>
@@ -1495,8 +1510,7 @@ export const DeploymentControllerType = {
14951510
export type DeploymentControllerType = (typeof DeploymentControllerType)[keyof typeof DeploymentControllerType];
14961511

14971512
/**
1498-
* <p>The deployment controller to use for the service. For more information, see <a href="https://docs.aws.amazon.com/AmazonECS/latest/developerguide/deployment-types.html">Amazon ECS deployment
1499-
* types</a> in the <i>Amazon Elastic Container Service Developer Guide</i>.</p>
1513+
* <p>The deployment controller to use for the service. </p>
15001514
* @public
15011515
*/
15021516
export interface DeploymentController {
@@ -1511,18 +1525,21 @@ export interface DeploymentController {
15111525
* adds or removes from the service during a rolling update is controlled by adjusting the
15121526
* minimum and maximum number of healthy tasks allowed during a service deployment, as
15131527
* specified in the <a href="https://docs.aws.amazon.com/AmazonECS/latest/APIReference/API_DeploymentConfiguration.html">DeploymentConfiguration</a>.</p>
1528+
* <p>For more information about rolling deployments, see <a href="https://docs.aws.amazon.com/AmazonECS/latest/developerguide/deployment-type-ecs.html">Deploy Amazon ECS services by replacing tasks</a> in the <i>Amazon Elastic Container Service Developer Guide</i>.</p>
15141529
* </dd>
15151530
* <dt>CODE_DEPLOY</dt>
15161531
* <dd>
15171532
* <p>The blue/green (<code>CODE_DEPLOY</code>) deployment type uses the blue/green deployment
15181533
* model powered by CodeDeploy, which allows you to verify a new deployment of a service before
15191534
* sending production traffic to it.</p>
1535+
* <p>For more information about blue/green deployments, see <a href="https://docs.aws.amazon.com/AmazonECS/latest/developerguide/deployment-type-bluegreen.html">Validate the state of an Amazon ECS service before deployment </a> in the <i>Amazon Elastic Container Service Developer Guide</i>.</p>
15201536
* </dd>
15211537
* <dt>EXTERNAL</dt>
15221538
* <dd>
15231539
* <p>The external (<code>EXTERNAL</code>) deployment type enables you to use any third-party
15241540
* deployment controller for full control over the deployment process for an Amazon ECS
15251541
* service.</p>
1542+
* <p>For more information about external deployments, see <a href="https://docs.aws.amazon.com/AmazonECS/latest/developerguide/deployment-type-external.html">Deploy Amazon ECS services using a third-party controller </a> in the <i>Amazon Elastic Container Service Developer Guide</i>.</p>
15261543
* </dd>
15271544
* </dl>
15281545
* @public
@@ -2647,6 +2664,14 @@ export interface CreateServiceRequest {
26472664
*/
26482665
taskDefinition?: string | undefined;
26492666

2667+
/**
2668+
* <p>Indicates whether to use Availability Zone rebalancing for the service.</p>
2669+
* <p>For more information, see <a href="https://docs.aws.amazon.com/AmazonECS/latest/developerguide/service-rebalancing.html">Balancing an Amazon ECS service across Availability Zones</a> in
2670+
* the <i>Amazon Elastic Container Service Developer Guide</i>.</p>
2671+
* @public
2672+
*/
2673+
availabilityZoneRebalancing?: AvailabilityZoneRebalancing | undefined;
2674+
26502675
/**
26512676
* <p>A load balancer object representing the load balancers to use with your service. For more
26522677
* information, see <a href="https://docs.aws.amazon.com/AmazonECS/latest/developerguide/service-load-balancing.html">Service load balancing</a> in the <i>Amazon Elastic Container Service Developer Guide</i>.</p>
@@ -3775,6 +3800,14 @@ export interface Service {
37753800
* @public
37763801
*/
37773802
enableExecuteCommand?: boolean | undefined;
3803+
3804+
/**
3805+
* <p>Indicates whether to use Availability Zone rebalancing for the service.</p>
3806+
* <p>For more information, see <a href="https://docs.aws.amazon.com/AmazonECS/latest/developerguide/service-rebalancing.html">Balancing an Amazon ECS service across Availability Zones</a> in
3807+
* the <i>Amazon Elastic Container Service Developer Guide</i>.</p>
3808+
* @public
3809+
*/
3810+
availabilityZoneRebalancing?: AvailabilityZoneRebalancing | undefined;
37783811
}
37793812

37803813
/**
@@ -12676,42 +12709,6 @@ export interface UntagResourceRequest {
1267612709
*/
1267712710
export interface UntagResourceResponse {}
1267812711

12679-
/**
12680-
* <p>The details of the Auto Scaling group capacity provider to update.</p>
12681-
* @public
12682-
*/
12683-
export interface AutoScalingGroupProviderUpdate {
12684-
/**
12685-
* <p>The managed scaling settings for the Auto Scaling group capacity provider.</p>
12686-
* @public
12687-
*/
12688-
managedScaling?: ManagedScaling | undefined;
12689-
12690-
/**
12691-
* <p>The managed termination protection setting to use for the Auto Scaling group capacity provider. This
12692-
* determines whether the Auto Scaling group has managed termination protection.</p>
12693-
* <important>
12694-
* <p>When using managed termination protection, managed scaling must also be used otherwise managed
12695-
* termination protection doesn't work.</p>
12696-
* </important>
12697-
* <p>When managed termination protection is on, Amazon ECS prevents the Amazon EC2 instances in an Auto Scaling
12698-
* group that contain tasks from being terminated during a scale-in action. The Auto Scaling group and
12699-
* each instance in the Auto Scaling group must have instance protection from scale-in actions on. For
12700-
* more information, see <a href="https://docs.aws.amazon.com/autoscaling/ec2/userguide/as-instance-termination.html#instance-protection">Instance
12701-
* Protection</a> in the <i>Auto Scaling User Guide</i>.</p>
12702-
* <p>When managed termination protection is off, your Amazon EC2 instances aren't protected from termination
12703-
* when the Auto Scaling group scales in.</p>
12704-
* @public
12705-
*/
12706-
managedTerminationProtection?: ManagedTerminationProtection | undefined;
12707-
12708-
/**
12709-
* <p>The managed draining option for the Auto Scaling group capacity provider. When you enable this, Amazon ECS manages and gracefully drains the EC2 container instances that are in the Auto Scaling group capacity provider.</p>
12710-
* @public
12711-
*/
12712-
managedDraining?: ManagedDraining | undefined;
12713-
}
12714-
1271512712
/**
1271612713
* @internal
1271712714
*/

clients/client-ecs/src/models/models_1.ts

Lines changed: 48 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { ExceptionOptionType as __ExceptionOptionType } from "@smithy/smithy-cli
44
import { ECSServiceException as __BaseException } from "./ECSServiceException";
55

66
import {
7-
AutoScalingGroupProviderUpdate,
7+
AvailabilityZoneRebalancing,
88
CapacityProvider,
99
CapacityProviderStrategyItem,
1010
Cluster,
@@ -16,6 +16,9 @@ import {
1616
DeploymentConfiguration,
1717
Failure,
1818
LoadBalancer,
19+
ManagedDraining,
20+
ManagedScaling,
21+
ManagedTerminationProtection,
1922
NetworkConfiguration,
2023
PlacementConstraint,
2124
PlacementStrategy,
@@ -30,6 +33,42 @@ import {
3033
VpcLatticeConfiguration,
3134
} from "./models_0";
3235

36+
/**
37+
* <p>The details of the Auto Scaling group capacity provider to update.</p>
38+
* @public
39+
*/
40+
export interface AutoScalingGroupProviderUpdate {
41+
/**
42+
* <p>The managed scaling settings for the Auto Scaling group capacity provider.</p>
43+
* @public
44+
*/
45+
managedScaling?: ManagedScaling | undefined;
46+
47+
/**
48+
* <p>The managed termination protection setting to use for the Auto Scaling group capacity provider. This
49+
* determines whether the Auto Scaling group has managed termination protection.</p>
50+
* <important>
51+
* <p>When using managed termination protection, managed scaling must also be used otherwise managed
52+
* termination protection doesn't work.</p>
53+
* </important>
54+
* <p>When managed termination protection is on, Amazon ECS prevents the Amazon EC2 instances in an Auto Scaling
55+
* group that contain tasks from being terminated during a scale-in action. The Auto Scaling group and
56+
* each instance in the Auto Scaling group must have instance protection from scale-in actions on. For
57+
* more information, see <a href="https://docs.aws.amazon.com/autoscaling/ec2/userguide/as-instance-termination.html#instance-protection">Instance
58+
* Protection</a> in the <i>Auto Scaling User Guide</i>.</p>
59+
* <p>When managed termination protection is off, your Amazon EC2 instances aren't protected from termination
60+
* when the Auto Scaling group scales in.</p>
61+
* @public
62+
*/
63+
managedTerminationProtection?: ManagedTerminationProtection | undefined;
64+
65+
/**
66+
* <p>The managed draining option for the Auto Scaling group capacity provider. When you enable this, Amazon ECS manages and gracefully drains the EC2 container instances that are in the Auto Scaling group capacity provider.</p>
67+
* @public
68+
*/
69+
managedDraining?: ManagedDraining | undefined;
70+
}
71+
3372
/**
3473
* @public
3574
*/
@@ -328,6 +367,14 @@ export interface UpdateServiceRequest {
328367
*/
329368
deploymentConfiguration?: DeploymentConfiguration | undefined;
330369

370+
/**
371+
* <p>Indicates whether to use Availability Zone rebalancing for the service.</p>
372+
* <p>For more information, see <a href="https://docs.aws.amazon.com/AmazonECS/latest/developerguide/service-rebalancing.html">Balancing an Amazon ECS service across Availability Zones</a> in
373+
* the <i>Amazon Elastic Container Service Developer Guide</i>.</p>
374+
* @public
375+
*/
376+
availabilityZoneRebalancing?: AvailabilityZoneRebalancing | undefined;
377+
331378
/**
332379
* <p>An object representing the network configuration for the service.</p>
333380
* @public

clients/client-ecs/src/protocols/Aws_json1_1.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,6 @@ import {
187187
Attribute,
188188
AttributeLimitExceededException,
189189
AutoScalingGroupProvider,
190-
AutoScalingGroupProviderUpdate,
191190
AwsVpcConfiguration,
192191
BlockedException,
193192
CapacityProviderField,
@@ -385,6 +384,7 @@ import {
385384
VpcLatticeConfiguration,
386385
} from "../models/models_0";
387386
import {
387+
AutoScalingGroupProviderUpdate,
388388
MissingVersionException,
389389
NoUpdateAvailableException,
390390
UpdateCapacityProviderRequest,
@@ -4105,6 +4105,7 @@ const de_Scale = (output: any, context: __SerdeContext): Scale => {
41054105
*/
41064106
const de_Service = (output: any, context: __SerdeContext): Service => {
41074107
return take(output, {
4108+
availabilityZoneRebalancing: __expectString,
41084109
capacityProviderStrategy: _json,
41094110
clusterArn: __expectString,
41104111
createdAt: (_: any) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))),

0 commit comments

Comments
 (0)