Skip to content

Commit

Permalink
feat(client-ecs): This release adds support for the Availability Zone…
Browse files Browse the repository at this point in the history
… rebalancing feature on Amazon ECS.
  • Loading branch information
awstools committed Nov 20, 2024
1 parent 9e49c84 commit 3d12b74
Show file tree
Hide file tree
Showing 9 changed files with 130 additions and 44 deletions.
2 changes: 2 additions & 0 deletions clients/client-ecs/src/commands/CreateServiceCommand.ts
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,7 @@ export interface CreateServiceCommandOutput extends CreateServiceResponse, __Met
* cluster: "STRING_VALUE",
* serviceName: "STRING_VALUE", // required
* taskDefinition: "STRING_VALUE",
* availabilityZoneRebalancing: "ENABLED" || "DISABLED",
* loadBalancers: [ // LoadBalancers
* { // LoadBalancer
* targetGroupArn: "STRING_VALUE",
Expand Down Expand Up @@ -558,6 +559,7 @@ export interface CreateServiceCommandOutput extends CreateServiceResponse, __Met
* // enableECSManagedTags: true || false,
* // propagateTags: "TASK_DEFINITION" || "SERVICE" || "NONE",
* // enableExecuteCommand: true || false,
* // availabilityZoneRebalancing: "ENABLED" || "DISABLED",
* // },
* // };
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ export interface DeleteCapacityProviderCommandOutput extends DeleteCapacityProvi
* <code>forceNewDeployment</code> option can be used to ensure that any tasks using the Amazon EC2
* instance capacity provided by the capacity provider are transitioned to use the capacity from the
* remaining capacity providers. Only capacity providers that aren't associated with a cluster can be
* 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>
* 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>
* @example
* Use a bare-bones client and the command you need to make an API call.
* ```javascript
Expand Down
1 change: 1 addition & 0 deletions clients/client-ecs/src/commands/DeleteServiceCommand.ts
Original file line number Diff line number Diff line change
Expand Up @@ -337,6 +337,7 @@ export interface DeleteServiceCommandOutput extends DeleteServiceResponse, __Met
* // enableECSManagedTags: true || false,
* // propagateTags: "TASK_DEFINITION" || "SERVICE" || "NONE",
* // enableExecuteCommand: true || false,
* // availabilityZoneRebalancing: "ENABLED" || "DISABLED",
* // },
* // };
*
Expand Down
1 change: 1 addition & 0 deletions clients/client-ecs/src/commands/DescribeServicesCommand.ts
Original file line number Diff line number Diff line change
Expand Up @@ -325,6 +325,7 @@ export interface DescribeServicesCommandOutput extends DescribeServicesResponse,
* // enableECSManagedTags: true || false,
* // propagateTags: "TASK_DEFINITION" || "SERVICE" || "NONE",
* // enableExecuteCommand: true || false,
* // availabilityZoneRebalancing: "ENABLED" || "DISABLED",
* // },
* // ],
* // failures: [ // Failures
Expand Down
2 changes: 2 additions & 0 deletions clients/client-ecs/src/commands/UpdateServiceCommand.ts
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,7 @@ export interface UpdateServiceCommandOutput extends UpdateServiceResponse, __Met
* enable: true || false, // required
* },
* },
* availabilityZoneRebalancing: "ENABLED" || "DISABLED",
* networkConfiguration: { // NetworkConfiguration
* awsvpcConfiguration: { // AwsVpcConfiguration
* subnets: [ // required
Expand Down Expand Up @@ -591,6 +592,7 @@ export interface UpdateServiceCommandOutput extends UpdateServiceResponse, __Met
* // enableECSManagedTags: true || false,
* // propagateTags: "TASK_DEFINITION" || "SERVICE" || "NONE",
* // enableExecuteCommand: true || false,
* // availabilityZoneRebalancing: "ENABLED" || "DISABLED",
* // },
* // };
*
Expand Down
73 changes: 35 additions & 38 deletions clients/client-ecs/src/models/models_0.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1294,6 +1294,21 @@ export class ClusterNotFoundException extends __BaseException {
}
}

/**
* @public
* @enum
*/
export const AvailabilityZoneRebalancing = {
DISABLED: "DISABLED",
ENABLED: "ENABLED",
} as const;

/**
* @public
*/
export type AvailabilityZoneRebalancing =
(typeof AvailabilityZoneRebalancing)[keyof typeof AvailabilityZoneRebalancing];

/**
* <p>One of the methods which provide a way for you to quickly identify when a deployment has failed, and
* then to optionally roll back the failure to the last working deployment.</p>
Expand Down Expand Up @@ -1495,8 +1510,7 @@ export const DeploymentControllerType = {
export type DeploymentControllerType = (typeof DeploymentControllerType)[keyof typeof DeploymentControllerType];

/**
* <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
* types</a> in the <i>Amazon Elastic Container Service Developer Guide</i>.</p>
* <p>The deployment controller to use for the service. </p>
* @public
*/
export interface DeploymentController {
Expand All @@ -1511,18 +1525,21 @@ export interface DeploymentController {
* adds or removes from the service during a rolling update is controlled by adjusting the
* minimum and maximum number of healthy tasks allowed during a service deployment, as
* specified in the <a href="https://docs.aws.amazon.com/AmazonECS/latest/APIReference/API_DeploymentConfiguration.html">DeploymentConfiguration</a>.</p>
* <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>
* </dd>
* <dt>CODE_DEPLOY</dt>
* <dd>
* <p>The blue/green (<code>CODE_DEPLOY</code>) deployment type uses the blue/green deployment
* model powered by CodeDeploy, which allows you to verify a new deployment of a service before
* sending production traffic to it.</p>
* <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>
* </dd>
* <dt>EXTERNAL</dt>
* <dd>
* <p>The external (<code>EXTERNAL</code>) deployment type enables you to use any third-party
* deployment controller for full control over the deployment process for an Amazon ECS
* service.</p>
* <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>
* </dd>
* </dl>
* @public
Expand Down Expand Up @@ -2647,6 +2664,14 @@ export interface CreateServiceRequest {
*/
taskDefinition?: string | undefined;

/**
* <p>Indicates whether to use Availability Zone rebalancing for the service.</p>
* <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
* the <i>Amazon Elastic Container Service Developer Guide</i>.</p>
* @public
*/
availabilityZoneRebalancing?: AvailabilityZoneRebalancing | undefined;

/**
* <p>A load balancer object representing the load balancers to use with your service. For more
* 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>
Expand Down Expand Up @@ -3775,6 +3800,14 @@ export interface Service {
* @public
*/
enableExecuteCommand?: boolean | undefined;

/**
* <p>Indicates whether to use Availability Zone rebalancing for the service.</p>
* <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
* the <i>Amazon Elastic Container Service Developer Guide</i>.</p>
* @public
*/
availabilityZoneRebalancing?: AvailabilityZoneRebalancing | undefined;
}

/**
Expand Down Expand Up @@ -12676,42 +12709,6 @@ export interface UntagResourceRequest {
*/
export interface UntagResourceResponse {}

/**
* <p>The details of the Auto Scaling group capacity provider to update.</p>
* @public
*/
export interface AutoScalingGroupProviderUpdate {
/**
* <p>The managed scaling settings for the Auto Scaling group capacity provider.</p>
* @public
*/
managedScaling?: ManagedScaling | undefined;

/**
* <p>The managed termination protection setting to use for the Auto Scaling group capacity provider. This
* determines whether the Auto Scaling group has managed termination protection.</p>
* <important>
* <p>When using managed termination protection, managed scaling must also be used otherwise managed
* termination protection doesn't work.</p>
* </important>
* <p>When managed termination protection is on, Amazon ECS prevents the Amazon EC2 instances in an Auto Scaling
* group that contain tasks from being terminated during a scale-in action. The Auto Scaling group and
* each instance in the Auto Scaling group must have instance protection from scale-in actions on. For
* more information, see <a href="https://docs.aws.amazon.com/autoscaling/ec2/userguide/as-instance-termination.html#instance-protection">Instance
* Protection</a> in the <i>Auto Scaling User Guide</i>.</p>
* <p>When managed termination protection is off, your Amazon EC2 instances aren't protected from termination
* when the Auto Scaling group scales in.</p>
* @public
*/
managedTerminationProtection?: ManagedTerminationProtection | undefined;

/**
* <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>
* @public
*/
managedDraining?: ManagedDraining | undefined;
}

/**
* @internal
*/
Expand Down
49 changes: 48 additions & 1 deletion clients/client-ecs/src/models/models_1.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { ExceptionOptionType as __ExceptionOptionType } from "@smithy/smithy-cli
import { ECSServiceException as __BaseException } from "./ECSServiceException";

import {
AutoScalingGroupProviderUpdate,
AvailabilityZoneRebalancing,
CapacityProvider,
CapacityProviderStrategyItem,
Cluster,
Expand All @@ -16,6 +16,9 @@ import {
DeploymentConfiguration,
Failure,
LoadBalancer,
ManagedDraining,
ManagedScaling,
ManagedTerminationProtection,
NetworkConfiguration,
PlacementConstraint,
PlacementStrategy,
Expand All @@ -30,6 +33,42 @@ import {
VpcLatticeConfiguration,
} from "./models_0";

/**
* <p>The details of the Auto Scaling group capacity provider to update.</p>
* @public
*/
export interface AutoScalingGroupProviderUpdate {
/**
* <p>The managed scaling settings for the Auto Scaling group capacity provider.</p>
* @public
*/
managedScaling?: ManagedScaling | undefined;

/**
* <p>The managed termination protection setting to use for the Auto Scaling group capacity provider. This
* determines whether the Auto Scaling group has managed termination protection.</p>
* <important>
* <p>When using managed termination protection, managed scaling must also be used otherwise managed
* termination protection doesn't work.</p>
* </important>
* <p>When managed termination protection is on, Amazon ECS prevents the Amazon EC2 instances in an Auto Scaling
* group that contain tasks from being terminated during a scale-in action. The Auto Scaling group and
* each instance in the Auto Scaling group must have instance protection from scale-in actions on. For
* more information, see <a href="https://docs.aws.amazon.com/autoscaling/ec2/userguide/as-instance-termination.html#instance-protection">Instance
* Protection</a> in the <i>Auto Scaling User Guide</i>.</p>
* <p>When managed termination protection is off, your Amazon EC2 instances aren't protected from termination
* when the Auto Scaling group scales in.</p>
* @public
*/
managedTerminationProtection?: ManagedTerminationProtection | undefined;

/**
* <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>
* @public
*/
managedDraining?: ManagedDraining | undefined;
}

/**
* @public
*/
Expand Down Expand Up @@ -328,6 +367,14 @@ export interface UpdateServiceRequest {
*/
deploymentConfiguration?: DeploymentConfiguration | undefined;

/**
* <p>Indicates whether to use Availability Zone rebalancing for the service.</p>
* <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
* the <i>Amazon Elastic Container Service Developer Guide</i>.</p>
* @public
*/
availabilityZoneRebalancing?: AvailabilityZoneRebalancing | undefined;

/**
* <p>An object representing the network configuration for the service.</p>
* @public
Expand Down
3 changes: 2 additions & 1 deletion clients/client-ecs/src/protocols/Aws_json1_1.ts
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,6 @@ import {
Attribute,
AttributeLimitExceededException,
AutoScalingGroupProvider,
AutoScalingGroupProviderUpdate,
AwsVpcConfiguration,
BlockedException,
CapacityProviderField,
Expand Down Expand Up @@ -385,6 +384,7 @@ import {
VpcLatticeConfiguration,
} from "../models/models_0";
import {
AutoScalingGroupProviderUpdate,
MissingVersionException,
NoUpdateAvailableException,
UpdateCapacityProviderRequest,
Expand Down Expand Up @@ -4105,6 +4105,7 @@ const de_Scale = (output: any, context: __SerdeContext): Scale => {
*/
const de_Service = (output: any, context: __SerdeContext): Service => {
return take(output, {
availabilityZoneRebalancing: __expectString,
capacityProviderStrategy: _json,
clusterArn: __expectString,
createdAt: (_: any) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))),
Expand Down
Loading

0 comments on commit 3d12b74

Please sign in to comment.