Skip to content

Commit

Permalink
feat(client-auto-scaling): Amazon EC2 Auto Scaling now supports Amazo…
Browse files Browse the repository at this point in the history
…n Application Recovery Controller (ARC) zonal shift and zonal autoshift to help you quickly recover an impaired application from failures in an Availability Zone (AZ).
  • Loading branch information
awstools committed Nov 18, 2024
1 parent 6c6c9c8 commit f8fdf92
Show file tree
Hide file tree
Showing 7 changed files with 249 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ export interface AttachTrafficSourcesCommandOutput extends AttachTrafficSourcesR
* Type: "STRING_VALUE",
* },
* ],
* SkipZonalShiftValidation: true || false,
* };
* const command = new AttachTrafficSourcesCommand(input);
* const response = await client.send(command);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,11 @@ export interface CreateAutoScalingGroupCommandOutput extends __MetadataBearer {}
* AvailabilityZoneDistribution: { // AvailabilityZoneDistribution
* CapacityDistributionStrategy: "balanced-only" || "balanced-best-effort",
* },
* AvailabilityZoneImpairmentPolicy: { // AvailabilityZoneImpairmentPolicy
* ZonalShiftEnabled: true || false,
* ImpairedZoneHealthCheckBehavior: "ReplaceUnhealthy" || "IgnoreUnhealthy",
* },
* SkipZonalShiftValidation: true || false,
* };
* const command = new CreateAutoScalingGroupCommand(input);
* const response = await client.send(command);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -250,6 +250,10 @@ export interface DescribeAutoScalingGroupsCommandOutput extends AutoScalingGroup
* // AvailabilityZoneDistribution: { // AvailabilityZoneDistribution
* // CapacityDistributionStrategy: "balanced-only" || "balanced-best-effort",
* // },
* // AvailabilityZoneImpairmentPolicy: { // AvailabilityZoneImpairmentPolicy
* // ZonalShiftEnabled: true || false,
* // ImpairedZoneHealthCheckBehavior: "ReplaceUnhealthy" || "IgnoreUnhealthy",
* // },
* // },
* // ],
* // NextToken: "STRING_VALUE",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,11 @@ export interface UpdateAutoScalingGroupCommandOutput extends __MetadataBearer {}
* AvailabilityZoneDistribution: { // AvailabilityZoneDistribution
* CapacityDistributionStrategy: "balanced-only" || "balanced-best-effort",
* },
* AvailabilityZoneImpairmentPolicy: { // AvailabilityZoneImpairmentPolicy
* ZonalShiftEnabled: true || false,
* ImpairedZoneHealthCheckBehavior: "ReplaceUnhealthy" || "IgnoreUnhealthy",
* },
* SkipZonalShiftValidation: true || false,
* };
* const command = new UpdateAutoScalingGroupCommand(input);
* const response = await client.send(command);
Expand Down
93 changes: 93 additions & 0 deletions clients/client-auto-scaling/src/models/models_0.ts
Original file line number Diff line number Diff line change
Expand Up @@ -496,6 +496,15 @@ export interface AttachTrafficSourcesType {
* @public
*/
TrafficSources: TrafficSourceIdentifier[] | undefined;

/**
* <p>
* If you enable zonal shift with cross-zone disabled load balancers, capacity could become imbalanced across Availability Zones. To skip the validation, specify <code>true</code>. For more information, see
* <a href="https://docs.aws.amazon.com/autoscaling/ec2/userguide/ec2-auto-scaling-zonal-shift.html">Auto Scaling group zonal shift</a> in the <i>Amazon EC2 Auto Scaling User Guide</i>.
* </p>
* @public
*/
SkipZonalShiftValidation?: boolean | undefined;
}

/**
Expand Down Expand Up @@ -784,6 +793,48 @@ export interface AvailabilityZoneDistribution {
CapacityDistributionStrategy?: CapacityDistributionStrategy | undefined;
}

/**
* @public
* @enum
*/
export const ImpairedZoneHealthCheckBehavior = {
IgnoreUnhealthy: "IgnoreUnhealthy",
ReplaceUnhealthy: "ReplaceUnhealthy",
} as const;

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

/**
* <p>
* Describes an Availability Zone impairment policy.
* </p>
* @public
*/
export interface AvailabilityZoneImpairmentPolicy {
/**
* <p>
* If <code>true</code>, enable zonal shift for your Auto Scaling group.
* </p>
* @public
*/
ZonalShiftEnabled?: boolean | undefined;

/**
* <p>
* Specifies the health check behavior for the impaired Availability Zone in an active zonal shift. If you select <code>Replace unhealthy</code>, instances that appear unhealthy will be replaced in all Availability Zones.
* If you select <code>Ignore unhealthy</code>, instances will not be replaced in the Availability Zone with the active zonal shift. For more information, see <a href="https://docs.aws.amazon.com/autoscaling/ec2/userguide/ec2-auto-scaling-zonal-shift.html">Auto Scaling group zonal shift</a>
* in the <i>Amazon EC2 Auto Scaling User Guide</i>.
*
* </p>
* @public
*/
ImpairedZoneHealthCheckBehavior?: ImpairedZoneHealthCheckBehavior | undefined;
}

/**
* <p>Describes an instance maintenance policy.</p>
* <p>For more information, see <a href="https://docs.aws.amazon.com/autoscaling/ec2/userguide/ec2-auto-scaling-instance-maintenance-policy.html">Set instance maintenance policy</a> in the
Expand Down Expand Up @@ -2149,6 +2200,23 @@ export interface CreateAutoScalingGroupType {
* @public
*/
AvailabilityZoneDistribution?: AvailabilityZoneDistribution | undefined;

/**
* <p>
* The policy for Availability Zone impairment.
* </p>
* @public
*/
AvailabilityZoneImpairmentPolicy?: AvailabilityZoneImpairmentPolicy | undefined;

/**
* <p>
* If you enable zonal shift with cross-zone disabled load balancers, capacity could become imbalanced across Availability Zones. To skip the validation, specify <code>true</code>. For more information, see
* <a href="https://docs.aws.amazon.com/autoscaling/ec2/userguide/ec2-auto-scaling-zonal-shift.html">Auto Scaling group zonal shift</a> in the <i>Amazon EC2 Auto Scaling User Guide</i>.
* </p>
* @public
*/
SkipZonalShiftValidation?: boolean | undefined;
}

/**
Expand Down Expand Up @@ -3535,6 +3603,14 @@ export interface AutoScalingGroup {
* @public
*/
AvailabilityZoneDistribution?: AvailabilityZoneDistribution | undefined;

/**
* <p>
* The Availability Zone impairment policy.
* </p>
* @public
*/
AvailabilityZoneImpairmentPolicy?: AvailabilityZoneImpairmentPolicy | undefined;
}

/**
Expand Down Expand Up @@ -8303,4 +8379,21 @@ export interface UpdateAutoScalingGroupType {
* @public
*/
AvailabilityZoneDistribution?: AvailabilityZoneDistribution | undefined;

/**
* <p>
* The policy for Availability Zone impairment.
* </p>
* @public
*/
AvailabilityZoneImpairmentPolicy?: AvailabilityZoneImpairmentPolicy | undefined;

/**
* <p>
* If you enable zonal shift with cross-zone disabled load balancers, capacity could become imbalanced across Availability Zones. To skip the validation, specify <code>true</code>. For more information, see
* <a href="https://docs.aws.amazon.com/autoscaling/ec2/userguide/ec2-auto-scaling-zonal-shift.html">Auto Scaling group zonal shift</a> in the <i>Amazon EC2 Auto Scaling User Guide</i>.
* </p>
* @public
*/
SkipZonalShiftValidation?: boolean | undefined;
}
62 changes: 62 additions & 0 deletions clients/client-auto-scaling/src/protocols/Aws_query.ts
Original file line number Diff line number Diff line change
Expand Up @@ -254,6 +254,7 @@ import {
AutoScalingInstanceDetails,
AutoScalingInstancesType,
AvailabilityZoneDistribution,
AvailabilityZoneImpairmentPolicy,
BaselineEbsBandwidthMbpsRequest,
BatchDeleteScheduledActionAnswer,
BatchDeleteScheduledActionType,
Expand Down Expand Up @@ -3180,6 +3181,9 @@ const se_AttachTrafficSourcesType = (input: AttachTrafficSourcesType, context: _
entries[loc] = value;
});
}
if (input[_SZSV] != null) {
entries[_SZSV] = input[_SZSV];
}
return entries;
};

Expand Down Expand Up @@ -3260,6 +3264,20 @@ const se_AvailabilityZoneDistribution = (input: AvailabilityZoneDistribution, co
return entries;
};

/**
* serializeAws_queryAvailabilityZoneImpairmentPolicy
*/
const se_AvailabilityZoneImpairmentPolicy = (input: AvailabilityZoneImpairmentPolicy, context: __SerdeContext): any => {
const entries: any = {};
if (input[_ZSE] != null) {
entries[_ZSE] = input[_ZSE];
}
if (input[_IZHCB] != null) {
entries[_IZHCB] = input[_IZHCB];
}
return entries;
};

/**
* serializeAws_queryAvailabilityZones
*/
Expand Down Expand Up @@ -3617,6 +3635,16 @@ const se_CreateAutoScalingGroupType = (input: CreateAutoScalingGroupType, contex
entries[loc] = value;
});
}
if (input[_AZIP] != null) {
const memberEntries = se_AvailabilityZoneImpairmentPolicy(input[_AZIP], context);
Object.entries(memberEntries).forEach(([key, value]) => {
const loc = `AvailabilityZoneImpairmentPolicy.${key}`;
entries[loc] = value;
});
}
if (input[_SZSV] != null) {
entries[_SZSV] = input[_SZSV];
}
return entries;
};

Expand Down Expand Up @@ -6385,6 +6413,16 @@ const se_UpdateAutoScalingGroupType = (input: UpdateAutoScalingGroupType, contex
entries[loc] = value;
});
}
if (input[_AZIP] != null) {
const memberEntries = se_AvailabilityZoneImpairmentPolicy(input[_AZIP], context);
Object.entries(memberEntries).forEach(([key, value]) => {
const loc = `AvailabilityZoneImpairmentPolicy.${key}`;
entries[loc] = value;
});
}
if (input[_SZSV] != null) {
entries[_SZSV] = input[_SZSV];
}
return entries;
};

Expand Down Expand Up @@ -6829,6 +6867,9 @@ const de_AutoScalingGroup = (output: any, context: __SerdeContext): AutoScalingG
if (output[_AZD] != null) {
contents[_AZD] = de_AvailabilityZoneDistribution(output[_AZD], context);
}
if (output[_AZIP] != null) {
contents[_AZIP] = de_AvailabilityZoneImpairmentPolicy(output[_AZIP], context);
}
return contents;
};

Expand Down Expand Up @@ -6946,6 +6987,23 @@ const de_AvailabilityZoneDistribution = (output: any, context: __SerdeContext):
return contents;
};

/**
* deserializeAws_queryAvailabilityZoneImpairmentPolicy
*/
const de_AvailabilityZoneImpairmentPolicy = (
output: any,
context: __SerdeContext
): AvailabilityZoneImpairmentPolicy => {
const contents: any = {};
if (output[_ZSE] != null) {
contents[_ZSE] = __parseBoolean(output[_ZSE]);
}
if (output[_IZHCB] != null) {
contents[_IZHCB] = __expectString(output[_IZHCB]);
}
return contents;
};

/**
* deserializeAws_queryAvailabilityZones
*/
Expand Down Expand Up @@ -9466,6 +9524,7 @@ const _ATd = "AdjustmentType";
const _ATdj = "AdjustmentTypes";
const _AZ = "AvailabilityZones";
const _AZD = "AvailabilityZoneDistribution";
const _AZIP = "AvailabilityZoneImpairmentPolicy";
const _AZv = "AvailabilityZone";
const _Ac = "Activities";
const _Act = "Activity";
Expand Down Expand Up @@ -9595,6 +9654,7 @@ const _IT = "InstanceType";
const _ITU = "InstancesToUpdate";
const _ITUOR = "InstancesToUpdateOnRollback";
const _IW = "InstanceWarmup";
const _IZHCB = "ImpairedZoneHealthCheckBehavior";
const _Id = "Id";
const _Ide = "Identifier";
const _In = "Instances";
Expand Down Expand Up @@ -9758,6 +9818,7 @@ const _SRGP = "ShouldRespectGracePeriod";
const _SRu = "SuspensionReason";
const _ST = "StartTime";
const _SUGA = "ScheduledUpdateGroupActions";
const _SZSV = "SkipZonalShiftValidation";
const _St = "Stat";
const _Sta = "Status";
const _Stat = "State";
Expand Down Expand Up @@ -9795,6 +9856,7 @@ const _WC = "WeightedCapacity";
const _WPC = "WarmPoolConfiguration";
const _WPP = "WarmPoolProgress";
const _WPS = "WarmPoolSize";
const _ZSE = "ZonalShiftEnabled";
const _m = "message";
const _me = "member";

Expand Down
Loading

0 comments on commit f8fdf92

Please sign in to comment.