Skip to content

Commit 4137d54

Browse files
author
awstools
committed
feat(client-auto-scaling): This release updates validation for instance types used in the AllowedInstanceTypes and ExcludedInstanceTypes parameters of the InstanceRequirements property of a MixedInstancesPolicy.
1 parent d6e75cf commit 4137d54

11 files changed

+124
-35
lines changed

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,8 +72,8 @@ export interface CompleteLifecycleActionCommandOutput extends CompleteLifecycleA
7272
* </p>
7373
* </li>
7474
* </ol>
75-
* <p>For more information, see <a href="https://docs.aws.amazon.com/autoscaling/ec2/userguide/lifecycle-hooks.html">Amazon EC2 Auto Scaling lifecycle
76-
* hooks</a> in the <i>Amazon EC2 Auto Scaling User Guide</i>.</p>
75+
* <p>For more information, see <a href="https://docs.aws.amazon.com/autoscaling/ec2/userguide/completing-lifecycle-hooks.html">Complete a lifecycle
76+
* action</a> in the <i>Amazon EC2 Auto Scaling User Guide</i>.</p>
7777
* @example
7878
* Use a bare-bones client and the command you need to make an API call.
7979
* ```javascript

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

Lines changed: 22 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -286,38 +286,53 @@ export interface DescribeAutoScalingGroupsCommandOutput extends AutoScalingGroup
286286
* {
287287
* "AutoScalingGroups": [
288288
* {
289-
* "AutoScalingGroupARN": "arn:aws:autoscaling:us-west-2:123456789012:autoScalingGroup:930d940e-891e-4781-a11a-7b0acd480f03:autoScalingGroupName/my-auto-scaling-group",
289+
* "AutoScalingGroupARN": "arn:aws:autoscaling:us-west-1:123456789012:autoScalingGroup:12345678-1234-1234-1234-123456789012:autoScalingGroupName/my-auto-scaling-group",
290290
* "AutoScalingGroupName": "my-auto-scaling-group",
291291
* "AvailabilityZones": [
292+
* "us-west-2a",
293+
* "us-west-2b",
292294
* "us-west-2c"
293295
* ],
294-
* "CreatedTime": "2013-08-19T20:53:25.584Z",
296+
* "CreatedTime": "2023-03-09T22:15:11.611Z",
295297
* "DefaultCooldown": 300,
296-
* "DesiredCapacity": 1,
298+
* "DesiredCapacity": 2,
297299
* "EnabledMetrics": [],
298300
* "HealthCheckGracePeriod": 300,
299301
* "HealthCheckType": "EC2",
300302
* "Instances": [
301303
* {
302304
* "AvailabilityZone": "us-west-2c",
303305
* "HealthStatus": "Healthy",
304-
* "InstanceId": "i-4ba0837f",
306+
* "InstanceId": "i-05b4f7d5be44822a6",
307+
* "InstanceType": "t3.micro",
308+
* "LaunchConfigurationName": "my-launch-config",
309+
* "LifecycleState": "InService",
310+
* "ProtectedFromScaleIn": false
311+
* },
312+
* {
313+
* "AvailabilityZone": "us-west-2b",
314+
* "HealthStatus": "Healthy",
315+
* "InstanceId": "i-0c20ac468fa3049e8",
316+
* "InstanceType": "t3.micro",
305317
* "LaunchConfigurationName": "my-launch-config",
306318
* "LifecycleState": "InService",
307319
* "ProtectedFromScaleIn": false
308320
* }
309321
* ],
310322
* "LaunchConfigurationName": "my-launch-config",
311323
* "LoadBalancerNames": [],
312-
* "MaxSize": 1,
313-
* "MinSize": 0,
324+
* "MaxSize": 5,
325+
* "MinSize": 1,
314326
* "NewInstancesProtectedFromScaleIn": false,
327+
* "ServiceLinkedRoleARN": "arn:aws:iam::123456789012:role/aws-service-role/autoscaling.amazonaws.com/AWSServiceRoleForAutoScaling",
315328
* "SuspendedProcesses": [],
316329
* "Tags": [],
330+
* "TargetGroupARNs": [],
317331
* "TerminationPolicies": [
318332
* "Default"
319333
* ],
320-
* "VPCZoneIdentifier": "subnet-12345678"
334+
* "TrafficSources": [],
335+
* "VPCZoneIdentifier": "subnet-5ea0c127,subnet-6194ea3b,subnet-c934b782"
321336
* }
322337
* ]
323338
* }

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

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ export interface DescribeAutoScalingInstancesCommandOutput extends AutoScalingIn
9797
* // This example describes the specified Auto Scaling instance.
9898
* const input = {
9999
* "InstanceIds": [
100-
* "i-4ba0837f"
100+
* "i-05b4f7d5be44822a6"
101101
* ]
102102
* };
103103
* const command = new DescribeAutoScalingInstancesCommand(input);
@@ -109,7 +109,8 @@ export interface DescribeAutoScalingInstancesCommandOutput extends AutoScalingIn
109109
* "AutoScalingGroupName": "my-auto-scaling-group",
110110
* "AvailabilityZone": "us-west-2c",
111111
* "HealthStatus": "HEALTHY",
112-
* "InstanceId": "i-4ba0837f",
112+
* "InstanceId": "i-05b4f7d5be44822a6",
113+
* "InstanceType": "t3.micro",
113114
* "LaunchConfigurationName": "my-launch-config",
114115
* "LifecycleState": "InService",
115116
* "ProtectedFromScaleIn": false

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

Lines changed: 24 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -247,18 +247,35 @@ export interface DescribeInstanceRefreshesCommandOutput extends DescribeInstance
247247
* {
248248
* "AutoScalingGroupName": "my-auto-scaling-group",
249249
* "InstanceRefreshId": "08b91cf7-8fa6-48af-b6a6-d227f40f1b9b",
250-
* "InstancesToUpdate": 5,
251-
* "PercentageComplete": 0,
252-
* "StartTime": "2020-06-02T18:11:27Z",
253-
* "Status": "InProgress"
250+
* "InstancesToUpdate": 0,
251+
* "PercentageComplete": 50,
252+
* "Preferences": {
253+
* "AutoRollback": true,
254+
* "InstanceWarmup": 60,
255+
* "MinHealthyPercentage": 90,
256+
* "ScaleInProtectedInstances": "Ignore",
257+
* "SkipMatching": false,
258+
* "StandbyInstances": "Ignore"
259+
* },
260+
* "StartTime": "2023-06-13T16:46:52+00:00",
261+
* "Status": "InProgress",
262+
* "StatusReason": "Waiting for instances to warm up before continuing. For example: i-0645704820a8e83ff is warming up."
254263
* },
255264
* {
256265
* "AutoScalingGroupName": "my-auto-scaling-group",
257-
* "EndTime": "2020-06-02T16:53:37Z",
258-
* "InstanceRefreshId": "dd7728d0-5bc4-4575-96a3-1b2c52bf8bb1",
266+
* "EndTime": "2023-06-02T13:59:45+00:00",
267+
* "InstanceRefreshId": "0e151305-1e57-4a32-a256-1fd14157c5ec",
259268
* "InstancesToUpdate": 0,
260269
* "PercentageComplete": 100,
261-
* "StartTime": "2020-06-02T16:43:19Z",
270+
* "Preferences": {
271+
* "AutoRollback": true,
272+
* "InstanceWarmup": 60,
273+
* "MinHealthyPercentage": 90,
274+
* "ScaleInProtectedInstances": "Ignore",
275+
* "SkipMatching": false,
276+
* "StandbyInstances": "Ignore"
277+
* },
278+
* "StartTime": "2023-06-02T13:53:37+00:00",
262279
* "Status": "Successful"
263280
* }
264281
* ]

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,7 @@ export interface DescribeScalingActivitiesCommandOutput extends ActivitiesType,
113113
* "Activities": [
114114
* {
115115
* "ActivityId": "f9f2d65b-f1f2-43e7-b46d-d86756459699",
116+
* "AutoScalingGroupARN": "arn:aws:autoscaling:us-east-1:123456789012:autoScalingGroup:12345678-1234-1234-1234-123456789012:autoScalingGroupName/my-auto-scaling-group",
116117
* "AutoScalingGroupName": "my-auto-scaling-group",
117118
* "Cause": "At 2013-08-19T20:53:25Z a user request created an AutoScalingGroup changing the desired capacity from 0 to 1. At 2013-08-19T20:53:29Z an instance was started in response to a difference between desired and actual capacity, increasing the capacity from 0 to 1.",
118119
* "Description": "Launching a new EC2 instance: i-4ba0837f",

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ export interface DetachTrafficSourcesCommandOutput extends DetachTrafficSourcesR
3737
/**
3838
* @public
3939
* <p>Detaches one or more traffic sources from the specified Auto Scaling group.</p>
40-
* <p>When you detach a taffic, it enters the <code>Removing</code> state while
40+
* <p>When you detach a traffic source, it enters the <code>Removing</code> state while
4141
* deregistering the instances in the group. When all instances are deregistered, then you
4242
* can no longer describe the traffic source using the <a>DescribeTrafficSources</a> API call. The instances continue to run.</p>
4343
* @example

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ export interface RollbackInstanceRefreshCommandOutput extends RollbackInstanceRe
6666
* // const { AutoScalingClient, RollbackInstanceRefreshCommand } = require("@aws-sdk/client-auto-scaling"); // CommonJS import
6767
* const client = new AutoScalingClient(config);
6868
* const input = { // RollbackInstanceRefreshType
69-
* AutoScalingGroupName: "STRING_VALUE",
69+
* AutoScalingGroupName: "STRING_VALUE", // required
7070
* };
7171
* const command = new RollbackInstanceRefreshCommand(input);
7272
* const response = await client.send(command);

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

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5064,11 +5064,7 @@ export interface StepAdjustment {
50645064
/**
50655065
* <p>The amount by which to scale, based on the specified adjustment type. A positive value
50665066
* adds to the current capacity while a negative number removes from the current
5067-
* capacity.</p>
5068-
* <p>The amount by which to scale. The adjustment is based on the value that you specified
5069-
* in the <code>AdjustmentType</code> property (either an absolute number or a percentage).
5070-
* A positive value adds to the current capacity and a negative number subtracts from the
5071-
* current capacity. </p>
5067+
* capacity. For exact capacity, you must specify a non-negative value.</p>
50725068
*/
50735069
ScalingAdjustment: number | undefined;
50745070
}
@@ -6688,7 +6684,7 @@ export interface PutScalingPolicyType {
66886684
/**
66896685
* <p>The amount by which to scale, based on the specified adjustment type. A positive value
66906686
* adds to the current capacity while a negative number removes from the current capacity.
6691-
* For exact capacity, you must specify a positive value.</p>
6687+
* For exact capacity, you must specify a non-negative value.</p>
66926688
* <p>Required if the policy type is <code>SimpleScaling</code>. (Not used with any other
66936689
* policy type.) </p>
66946690
*/
@@ -7064,7 +7060,7 @@ export interface RollbackInstanceRefreshType {
70647060
/**
70657061
* <p>The name of the Auto Scaling group.</p>
70667062
*/
7067-
AutoScalingGroupName?: string;
7063+
AutoScalingGroupName: string | undefined;
70687064
}
70697065

70707066
/**
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
// smithy-typescript generated code
2+
import { Paginator } from "@smithy/types";
3+
4+
import { AutoScalingClient } from "../AutoScalingClient";
5+
import {
6+
DescribeWarmPoolCommand,
7+
DescribeWarmPoolCommandInput,
8+
DescribeWarmPoolCommandOutput,
9+
} from "../commands/DescribeWarmPoolCommand";
10+
import { AutoScalingPaginationConfiguration } from "./Interfaces";
11+
12+
/**
13+
* @internal
14+
*/
15+
const makePagedClientRequest = async (
16+
client: AutoScalingClient,
17+
input: DescribeWarmPoolCommandInput,
18+
...args: any
19+
): Promise<DescribeWarmPoolCommandOutput> => {
20+
// @ts-ignore
21+
return await client.send(new DescribeWarmPoolCommand(input), ...args);
22+
};
23+
/**
24+
* @public
25+
*/
26+
export async function* paginateDescribeWarmPool(
27+
config: AutoScalingPaginationConfiguration,
28+
input: DescribeWarmPoolCommandInput,
29+
...additionalArguments: any
30+
): Paginator<DescribeWarmPoolCommandOutput> {
31+
// ToDo: replace with actual type instead of typeof input.NextToken
32+
let token: typeof input.NextToken | undefined = config.startingToken || undefined;
33+
let hasNext = true;
34+
let page: DescribeWarmPoolCommandOutput;
35+
while (hasNext) {
36+
input.NextToken = token;
37+
input["MaxRecords"] = config.pageSize;
38+
if (config.client instanceof AutoScalingClient) {
39+
page = await makePagedClientRequest(config.client, input, ...additionalArguments);
40+
} else {
41+
throw new Error("Invalid client, expected AutoScaling | AutoScalingClient");
42+
}
43+
yield page;
44+
const prevToken = token;
45+
token = page.NextToken;
46+
hasNext = !!(token && (!config.stopOnSameToken || token !== prevToken));
47+
}
48+
// @ts-ignore
49+
return undefined;
50+
}

clients/client-auto-scaling/src/pagination/index.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,5 +15,7 @@ export * from "./DescribeScheduledActionsPaginator";
1515
export * from "./DescribeTagsPaginator";
1616

1717
export * from "./DescribeTrafficSourcesPaginator";
18+
19+
export * from "./DescribeWarmPoolPaginator";
1820
// smithy-typescript generated code
1921
export * from "./Interfaces";

0 commit comments

Comments
 (0)