Skip to content

Commit ce97b63

Browse files
author
awstools
committed
feat(client-auto-scaling): This release adds support for Amazon EC2 Auto Scaling group deletion protection
1 parent 55f5f7f commit ce97b63

File tree

11 files changed

+117
-14
lines changed

11 files changed

+117
-14
lines changed

clients/client-auto-scaling/src/commands/AttachLoadBalancersCommand.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ export interface AttachLoadBalancersCommandOutput extends AttachLoadBalancersRes
2828

2929
/**
3030
* <note>
31-
* <p>This API operation is superseded by <a href="https://docs.aws.amazon.com/autoscaling/ec2/APIReference/API_AttachTrafficSources.html">https://docs.aws.amazon.com/autoscaling/ec2/APIReference/API_AttachTrafficSources.html</a>, which
31+
* <p>This API operation is superseded by <a href="https://docs.aws.amazon.com/autoscaling/ec2/APIReference/API_AttachTrafficSources.html">AttachTrafficSources</a>, which
3232
* can attach multiple traffic sources types. We recommend using
3333
* <code>AttachTrafficSources</code> to simplify how you manage traffic sources.
3434
* However, we continue to support <code>AttachLoadBalancers</code>. You can use both

clients/client-auto-scaling/src/commands/CreateAutoScalingGroupCommand.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -195,6 +195,7 @@ export interface CreateAutoScalingGroupCommandOutput extends __MetadataBearer {}
195195
* RoleARN: "STRING_VALUE",
196196
* },
197197
* ],
198+
* DeletionProtection: "none" || "prevent-force-deletion" || "prevent-all-deletion",
198199
* Tags: [ // Tags
199200
* { // Tag
200201
* ResourceId: "STRING_VALUE",

clients/client-auto-scaling/src/commands/DescribeAutoScalingGroupsCommand.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -260,6 +260,7 @@ export interface DescribeAutoScalingGroupsCommandOutput extends AutoScalingGroup
260260
* // MinHealthyPercentage: Number("int"),
261261
* // MaxHealthyPercentage: Number("int"),
262262
* // },
263+
* // DeletionProtection: "none" || "prevent-force-deletion" || "prevent-all-deletion",
263264
* // AvailabilityZoneDistribution: { // AvailabilityZoneDistribution
264265
* // CapacityDistributionStrategy: "balanced-only" || "balanced-best-effort",
265266
* // },

clients/client-auto-scaling/src/commands/DetachLoadBalancerTargetGroupsCommand.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ export interface DetachLoadBalancerTargetGroupsCommandOutput extends DetachLoadB
2828

2929
/**
3030
* <note>
31-
* <p>This API operation is superseded by <a href="https://docs.aws.amazon.com/autoscaling/ec2/APIReference/API_DescribeTrafficSources.html">DetachTrafficSources</a>, which
31+
* <p>This API operation is superseded by <a href="https://docs.aws.amazon.com/autoscaling/ec2/APIReference/API_DetachTrafficSources.html">DetachTrafficSources</a>, which
3232
* can detach multiple traffic sources types. We recommend using
3333
* <code>DetachTrafficSources</code> to simplify how you manage traffic sources.
3434
* However, we continue to support <code>DetachLoadBalancerTargetGroups</code>. You can

clients/client-auto-scaling/src/commands/UpdateAutoScalingGroupCommand.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -239,6 +239,7 @@ export interface UpdateAutoScalingGroupCommandOutput extends __MetadataBearer {}
239239
* TerminateHookAbandon: "retain" || "terminate",
240240
* },
241241
* },
242+
* DeletionProtection: "none" || "prevent-force-deletion" || "prevent-all-deletion",
242243
* };
243244
* const command = new UpdateAutoScalingGroupCommand(input);
244245
* const response = await client.send(command);

clients/client-auto-scaling/src/models/enums.ts

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,20 @@ export const CapacityReservationPreference = {
117117
export type CapacityReservationPreference =
118118
(typeof CapacityReservationPreference)[keyof typeof CapacityReservationPreference];
119119

120+
/**
121+
* @public
122+
* @enum
123+
*/
124+
export const DeletionProtection = {
125+
None: "none",
126+
PreventAllDeletion: "prevent-all-deletion",
127+
PreventForceDeletion: "prevent-force-deletion",
128+
} as const;
129+
/**
130+
* @public
131+
*/
132+
export type DeletionProtection = (typeof DeletionProtection)[keyof typeof DeletionProtection];
133+
120134
/**
121135
* @public
122136
* @enum

clients/client-auto-scaling/src/models/models_0.ts

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import {
88
CapacityDistributionStrategy,
99
CapacityReservationPreference,
1010
CpuManufacturer,
11+
DeletionProtection,
1112
ImpairedZoneHealthCheckBehavior,
1213
InstanceGeneration,
1314
InstanceMetadataEndpointState,
@@ -2104,6 +2105,23 @@ export interface CreateAutoScalingGroupType {
21042105
*/
21052106
LifecycleHookSpecificationList?: LifecycleHookSpecification[] | undefined;
21062107

2108+
/**
2109+
* <p>
2110+
* The deletion protection setting for the Auto Scaling group. This setting helps safeguard your Auto Scaling group and its
2111+
* instances by controlling whether the <code>DeleteAutoScalingGroup</code> operation is allowed. When deletion
2112+
* protection is enabled, users cannot delete the Auto Scaling group according to the specified protection level until
2113+
* the setting is changed back to a less restrictive level.
2114+
* </p>
2115+
* <p>
2116+
* The valid values are <code>none</code>, <code>prevent-force-deletion</code>, and <code>prevent-all-deletion</code>.
2117+
* </p>
2118+
* <p>
2119+
* Default: <code>none</code>
2120+
* </p>
2121+
* @public
2122+
*/
2123+
DeletionProtection?: DeletionProtection | undefined;
2124+
21072125
/**
21082126
* <p>One or more tags. You can tag your Auto Scaling group and propagate the tags to the Amazon EC2
21092127
* instances it launches. Tags are not propagated to Amazon EBS volumes. To add tags to Amazon EBS
@@ -3569,6 +3587,12 @@ export interface AutoScalingGroup {
35693587
*/
35703588
InstanceMaintenancePolicy?: InstanceMaintenancePolicy | undefined;
35713589

3590+
/**
3591+
* <p>The deletion protection setting for the Auto Scaling group.</p>
3592+
* @public
3593+
*/
3594+
DeletionProtection?: DeletionProtection | undefined;
3595+
35723596
/**
35733597
* <p>The EC2 instance capacity distribution across Availability Zones for the Auto Scaling group.</p>
35743598
* @public
@@ -8496,4 +8520,21 @@ export interface UpdateAutoScalingGroupType {
84968520
* @public
84978521
*/
84988522
InstanceLifecyclePolicy?: InstanceLifecyclePolicy | undefined;
8523+
8524+
/**
8525+
* <p>
8526+
* The deletion protection setting for the Auto Scaling group. This setting helps safeguard your Auto Scaling group and its
8527+
* instances by controlling whether the <code>DeleteAutoScalingGroup</code> operation is allowed. When deletion
8528+
* protection is enabled, users cannot delete the Auto Scaling group according to the specified protection level until
8529+
* the setting is changed back to a less restrictive level.
8530+
* </p>
8531+
* <p>
8532+
* The valid values are <code>none</code>, <code>prevent-force-deletion</code>, and <code>prevent-all-deletion</code>.
8533+
* </p>
8534+
* <p>
8535+
* Default: <code>none</code>
8536+
* </p>
8537+
* @public
8538+
*/
8539+
DeletionProtection?: DeletionProtection | undefined;
84998540
}

clients/client-auto-scaling/src/schemas/schemas_0.ts

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -160,10 +160,11 @@ const _DNCT = "DeleteNotificationConfigurationType";
160160
const _DNCTe = "DescribeNotificationConfigurationsType";
161161
const _DNCe = "DescribeNotificationConfigurations";
162162
const _DOT = "DeleteOnTermination";
163-
const _DP = "DeletePolicy";
163+
const _DP = "DeletionProtection";
164164
const _DPT = "DeletePolicyType";
165165
const _DPTe = "DescribePoliciesType";
166-
const _DPe = "DescribePolicies";
166+
const _DPe = "DeletePolicy";
167+
const _DPes = "DescribePolicies";
167168
const _DR = "DefaultResult";
168169
const _DSA = "DeleteScheduledAction";
169170
const _DSAT = "DeleteScheduledActionType";
@@ -695,8 +696,8 @@ export var AttachTrafficSourcesType$: StaticStructureSchema = [3, n0, _ATST,
695696
];
696697
export var AutoScalingGroup$: StaticStructureSchema = [3, n0, _ASG,
697698
0,
698-
[_ASGN, _MS, _MSa, _DC, _DCe, _AZ, _HCT, _CT, _ASGARN, _LCN, _LT, _MIP, _PC, _LBN, _TGARN, _HCGP, _I, _SP, _PG, _VPCZI, _EM, _S, _T, _TP, _NIPFSI, _SLRARN, _MIL, _CR, _WPC, _WPS, _Co, _DCT, _DIW, _TS, _IMP, _AZD, _AZIP, _CRS, _ILP],
699-
[0, 1, 1, 1, 1, 64 | 0, 0, 4, 0, 0, () => LaunchTemplateSpecification$, [() => MixedInstancesPolicy$, 0], 1, 64 | 0, 64 | 0, 1, () => Instances, () => SuspendedProcesses, 0, 0, () => EnabledMetrics, 0, () => TagDescriptionList, 64 | 0, 2, 0, 1, 2, () => WarmPoolConfiguration$, 1, 0, 0, 1, () => TrafficSources, () => InstanceMaintenancePolicy$, () => AvailabilityZoneDistribution$, () => AvailabilityZoneImpairmentPolicy$, () => CapacityReservationSpecification$, () => InstanceLifecyclePolicy$], 8
699+
[_ASGN, _MS, _MSa, _DC, _DCe, _AZ, _HCT, _CT, _ASGARN, _LCN, _LT, _MIP, _PC, _LBN, _TGARN, _HCGP, _I, _SP, _PG, _VPCZI, _EM, _S, _T, _TP, _NIPFSI, _SLRARN, _MIL, _CR, _WPC, _WPS, _Co, _DCT, _DIW, _TS, _IMP, _DP, _AZD, _AZIP, _CRS, _ILP],
700+
[0, 1, 1, 1, 1, 64 | 0, 0, 4, 0, 0, () => LaunchTemplateSpecification$, [() => MixedInstancesPolicy$, 0], 1, 64 | 0, 64 | 0, 1, () => Instances, () => SuspendedProcesses, 0, 0, () => EnabledMetrics, 0, () => TagDescriptionList, 64 | 0, 2, 0, 1, 2, () => WarmPoolConfiguration$, 1, 0, 0, 1, () => TrafficSources, () => InstanceMaintenancePolicy$, 0, () => AvailabilityZoneDistribution$, () => AvailabilityZoneImpairmentPolicy$, () => CapacityReservationSpecification$, () => InstanceLifecyclePolicy$], 8
700701
];
701702
export var AutoScalingGroupNamesType$: StaticStructureSchema = [3, n0, _ASGNT,
702703
0,
@@ -805,8 +806,8 @@ export var CpuPerformanceFactorRequest$: StaticStructureSchema = [3, n0, _CPFR,
805806
];
806807
export var CreateAutoScalingGroupType$: StaticStructureSchema = [3, n0, _CASGT,
807808
0,
808-
[_ASGN, _MS, _MSa, _LCN, _LT, _MIP, _IIns, _DC, _DCe, _AZ, _LBN, _TGARN, _HCT, _HCGP, _PG, _VPCZI, _TP, _NIPFSI, _CR, _LHSL, _T, _SLRARN, _MIL, _Co, _DCT, _DIW, _TS, _IMP, _AZD, _AZIP, _SZSV, _CRS, _ILP],
809-
[0, 1, 1, 0, () => LaunchTemplateSpecification$, [() => MixedInstancesPolicy$, 0], 0, 1, 1, 64 | 0, 64 | 0, 64 | 0, 0, 1, 0, 0, 64 | 0, 2, 2, () => LifecycleHookSpecifications, () => Tags, 0, 1, 0, 0, 1, () => TrafficSources, () => InstanceMaintenancePolicy$, () => AvailabilityZoneDistribution$, () => AvailabilityZoneImpairmentPolicy$, 2, () => CapacityReservationSpecification$, () => InstanceLifecyclePolicy$], 3
809+
[_ASGN, _MS, _MSa, _LCN, _LT, _MIP, _IIns, _DC, _DCe, _AZ, _LBN, _TGARN, _HCT, _HCGP, _PG, _VPCZI, _TP, _NIPFSI, _CR, _LHSL, _DP, _T, _SLRARN, _MIL, _Co, _DCT, _DIW, _TS, _IMP, _AZD, _AZIP, _SZSV, _CRS, _ILP],
810+
[0, 1, 1, 0, () => LaunchTemplateSpecification$, [() => MixedInstancesPolicy$, 0], 0, 1, 1, 64 | 0, 64 | 0, 64 | 0, 0, 1, 0, 0, 64 | 0, 2, 2, () => LifecycleHookSpecifications, 0, () => Tags, 0, 1, 0, 0, 1, () => TrafficSources, () => InstanceMaintenancePolicy$, () => AvailabilityZoneDistribution$, () => AvailabilityZoneImpairmentPolicy$, 2, () => CapacityReservationSpecification$, () => InstanceLifecyclePolicy$], 3
810811
];
811812
export var CreateLaunchConfigurationType$: StaticStructureSchema = [3, n0, _CLCT,
812813
0,
@@ -1614,8 +1615,8 @@ export var TrafficSourceState$: StaticStructureSchema = [3, n0, _TSS,
16141615
];
16151616
export var UpdateAutoScalingGroupType$: StaticStructureSchema = [3, n0, _UASGT,
16161617
0,
1617-
[_ASGN, _LCN, _LT, _MIP, _MS, _MSa, _DC, _DCe, _AZ, _HCT, _HCGP, _PG, _VPCZI, _TP, _NIPFSI, _SLRARN, _MIL, _CR, _Co, _DCT, _DIW, _IMP, _AZD, _AZIP, _SZSV, _CRS, _ILP],
1618-
[0, 0, () => LaunchTemplateSpecification$, [() => MixedInstancesPolicy$, 0], 1, 1, 1, 1, 64 | 0, 0, 1, 0, 0, 64 | 0, 2, 0, 1, 2, 0, 0, 1, () => InstanceMaintenancePolicy$, () => AvailabilityZoneDistribution$, () => AvailabilityZoneImpairmentPolicy$, 2, () => CapacityReservationSpecification$, () => InstanceLifecyclePolicy$], 1
1618+
[_ASGN, _LCN, _LT, _MIP, _MS, _MSa, _DC, _DCe, _AZ, _HCT, _HCGP, _PG, _VPCZI, _TP, _NIPFSI, _SLRARN, _MIL, _CR, _Co, _DCT, _DIW, _IMP, _AZD, _AZIP, _SZSV, _CRS, _ILP, _DP],
1619+
[0, 0, () => LaunchTemplateSpecification$, [() => MixedInstancesPolicy$, 0], 1, 1, 1, 1, 64 | 0, 0, 1, 0, 0, 64 | 0, 2, 0, 1, 2, 0, 0, 1, () => InstanceMaintenancePolicy$, () => AvailabilityZoneDistribution$, () => AvailabilityZoneImpairmentPolicy$, 2, () => CapacityReservationSpecification$, () => InstanceLifecyclePolicy$, 0], 1
16191620
];
16201621
export var VCpuCountRequest$: StaticStructureSchema = [3, n0, _VCCR,
16211622
0,
@@ -1829,7 +1830,7 @@ export var DeleteLifecycleHook$: StaticOperationSchema = [9, n0, _DLH,
18291830
export var DeleteNotificationConfiguration$: StaticOperationSchema = [9, n0, _DNC,
18301831
0, () => DeleteNotificationConfigurationType$, () => __Unit
18311832
];
1832-
export var DeletePolicy$: StaticOperationSchema = [9, n0, _DP,
1833+
export var DeletePolicy$: StaticOperationSchema = [9, n0, _DPe,
18331834
0, () => DeletePolicyType$, () => __Unit
18341835
];
18351836
export var DeleteScheduledAction$: StaticOperationSchema = [9, n0, _DSA,
@@ -1880,7 +1881,7 @@ export var DescribeMetricCollectionTypes$: StaticOperationSchema = [9, n0, _DMCT
18801881
export var DescribeNotificationConfigurations$: StaticOperationSchema = [9, n0, _DNCe,
18811882
0, () => DescribeNotificationConfigurationsType$, () => DescribeNotificationConfigurationsAnswer$
18821883
];
1883-
export var DescribePolicies$: StaticOperationSchema = [9, n0, _DPe,
1884+
export var DescribePolicies$: StaticOperationSchema = [9, n0, _DPes,
18841885
0, () => DescribePoliciesType$, () => PoliciesType$
18851886
];
18861887
export var DescribeScalingActivities$: StaticOperationSchema = [9, n0, _DSAe,

clients/client-auto-scaling/test/index-objects.spec.mjs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,7 @@ import {
102102
DeleteWarmPoolAnswer$,
103103
DeleteWarmPoolCommand,
104104
DeleteWarmPoolType$,
105+
DeletionProtection,
105106
DescribeAccountLimits$,
106107
DescribeAccountLimitsAnswer$,
107108
DescribeAccountLimitsCommand,
@@ -736,6 +737,7 @@ assert(typeof BurstablePerformance === "object");
736737
assert(typeof CapacityDistributionStrategy === "object");
737738
assert(typeof CapacityReservationPreference === "object");
738739
assert(typeof CpuManufacturer === "object");
740+
assert(typeof DeletionProtection === "object");
739741
assert(typeof ImpairedZoneHealthCheckBehavior === "object");
740742
assert(typeof InstanceGeneration === "object");
741743
assert(typeof InstanceMetadataEndpointState === "object");

clients/client-auto-scaling/test/index-types.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -208,6 +208,7 @@ export type {
208208
CapacityDistributionStrategy,
209209
CapacityReservationPreference,
210210
CpuManufacturer,
211+
DeletionProtection,
211212
ImpairedZoneHealthCheckBehavior,
212213
InstanceGeneration,
213214
InstanceMetadataEndpointState,

0 commit comments

Comments
 (0)