Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
/**
* Indicates whether to use Availability Zone rebalancing for an ECS service.
*
* @see https://docs.aws.amazon.com/AmazonECS/latest/developerguide/service-rebalancing.html
*/
export enum AvailabilityZoneRebalancing {
/**
* Availability zone rebalancing is enabled.
*/
ENABLED = 'ENABLED',

/**
* Availability zone rebalancing is disabled.
*/
DISABLED = 'DISABLED',
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { FargatePlatformVersion, FargateTaskDefinition, RuntimePlatform } from '../../../aws-ecs';
import { AvailabilityZoneRebalancing } from '../availability-zone-rebalancing';

export interface FargateServiceBaseProps {
/**
Expand Down Expand Up @@ -89,4 +90,15 @@ export interface FargateServiceBaseProps {
* @default - If the property is undefined, `operatingSystemFamily` is LINUX and `cpuArchitecture` is X86_64
*/
readonly runtimePlatform?: RuntimePlatform;

/**
* Whether to use Availability Zone rebalancing for the service.
*
* If enabled, `maxHealthyPercent` must be greater than 100, and the service must not be a target
* of a Classic Load Balancer.
*
* @see https://docs.aws.amazon.com/AmazonECS/latest/developerguide/service-rebalancing.html
* @default AvailabilityZoneRebalancing.DISABLED
*/
readonly availabilityZoneRebalancing?: AvailabilityZoneRebalancing;
}
2 changes: 2 additions & 0 deletions packages/aws-cdk-lib/aws-ecs-patterns/lib/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,5 @@ export * from './fargate/application-multiple-target-groups-fargate-service';
export * from './base/network-multiple-target-groups-service-base';
export * from './ecs/network-multiple-target-groups-ecs-service';
export * from './fargate/network-multiple-target-groups-fargate-service';

export * from './availability-zone-rebalancing';
Original file line number Diff line number Diff line change
@@ -1,16 +1 @@
/**
* Indicates whether to use Availability Zone rebalancing for an ECS service.
*
* @see https://docs.aws.amazon.com/AmazonECS/latest/developerguide/service-rebalancing.html
*/
export enum AvailabilityZoneRebalancing {
/**
* Availability zone rebalancing is enabled.
*/
ENABLED = 'ENABLED',

/**
* Availability zone rebalancing is disabled.
*/
DISABLED = 'DISABLED',
}
export { AvailabilityZoneRebalancing } from '../../aws-ecs-patterns';
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import * as ec2 from '../../../aws-ec2';
import * as elb from '../../../aws-elasticloadbalancing';
import * as cdk from '../../../core';
import { addConstructMetadata, MethodMetadata } from '../../../core/lib/metadata-resource';
import { AvailabilityZoneRebalancing } from '../availability-zone-rebalancing';
import { AvailabilityZoneRebalancing } from '../../../aws-ecs-patterns';
import { BaseService, BaseServiceOptions, DeploymentControllerType, IBaseService, IService, LaunchType } from '../base/base-service';
import { fromServiceAttributes, extractServiceNameFromArn } from '../base/from-service-attributes';
import { TaskDefinition } from '../base/task-definition';
Expand Down
Loading