Skip to content

Commit

Permalink
feat(client-auto-scaling): This release updates validation for instan…
Browse files Browse the repository at this point in the history
…ce types used in the AllowedInstanceTypes and ExcludedInstanceTypes parameters of the InstanceRequirements property of a MixedInstancesPolicy.
  • Loading branch information
awstools committed Jul 27, 2023
1 parent d6e75cf commit 4137d54
Show file tree
Hide file tree
Showing 11 changed files with 124 additions and 35 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,8 @@ export interface CompleteLifecycleActionCommandOutput extends CompleteLifecycleA
* </p>
* </li>
* </ol>
* <p>For more information, see <a href="https://docs.aws.amazon.com/autoscaling/ec2/userguide/lifecycle-hooks.html">Amazon EC2 Auto Scaling lifecycle
* hooks</a> in the <i>Amazon EC2 Auto Scaling User Guide</i>.</p>
* <p>For more information, see <a href="https://docs.aws.amazon.com/autoscaling/ec2/userguide/completing-lifecycle-hooks.html">Complete a lifecycle
* action</a> in the <i>Amazon EC2 Auto Scaling User Guide</i>.</p>
* @example
* Use a bare-bones client and the command you need to make an API call.
* ```javascript
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -286,38 +286,53 @@ export interface DescribeAutoScalingGroupsCommandOutput extends AutoScalingGroup
* {
* "AutoScalingGroups": [
* {
* "AutoScalingGroupARN": "arn:aws:autoscaling:us-west-2:123456789012:autoScalingGroup:930d940e-891e-4781-a11a-7b0acd480f03:autoScalingGroupName/my-auto-scaling-group",
* "AutoScalingGroupARN": "arn:aws:autoscaling:us-west-1:123456789012:autoScalingGroup:12345678-1234-1234-1234-123456789012:autoScalingGroupName/my-auto-scaling-group",
* "AutoScalingGroupName": "my-auto-scaling-group",
* "AvailabilityZones": [
* "us-west-2a",
* "us-west-2b",
* "us-west-2c"
* ],
* "CreatedTime": "2013-08-19T20:53:25.584Z",
* "CreatedTime": "2023-03-09T22:15:11.611Z",
* "DefaultCooldown": 300,
* "DesiredCapacity": 1,
* "DesiredCapacity": 2,
* "EnabledMetrics": [],
* "HealthCheckGracePeriod": 300,
* "HealthCheckType": "EC2",
* "Instances": [
* {
* "AvailabilityZone": "us-west-2c",
* "HealthStatus": "Healthy",
* "InstanceId": "i-4ba0837f",
* "InstanceId": "i-05b4f7d5be44822a6",
* "InstanceType": "t3.micro",
* "LaunchConfigurationName": "my-launch-config",
* "LifecycleState": "InService",
* "ProtectedFromScaleIn": false
* },
* {
* "AvailabilityZone": "us-west-2b",
* "HealthStatus": "Healthy",
* "InstanceId": "i-0c20ac468fa3049e8",
* "InstanceType": "t3.micro",
* "LaunchConfigurationName": "my-launch-config",
* "LifecycleState": "InService",
* "ProtectedFromScaleIn": false
* }
* ],
* "LaunchConfigurationName": "my-launch-config",
* "LoadBalancerNames": [],
* "MaxSize": 1,
* "MinSize": 0,
* "MaxSize": 5,
* "MinSize": 1,
* "NewInstancesProtectedFromScaleIn": false,
* "ServiceLinkedRoleARN": "arn:aws:iam::123456789012:role/aws-service-role/autoscaling.amazonaws.com/AWSServiceRoleForAutoScaling",
* "SuspendedProcesses": [],
* "Tags": [],
* "TargetGroupARNs": [],
* "TerminationPolicies": [
* "Default"
* ],
* "VPCZoneIdentifier": "subnet-12345678"
* "TrafficSources": [],
* "VPCZoneIdentifier": "subnet-5ea0c127,subnet-6194ea3b,subnet-c934b782"
* }
* ]
* }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ export interface DescribeAutoScalingInstancesCommandOutput extends AutoScalingIn
* // This example describes the specified Auto Scaling instance.
* const input = {
* "InstanceIds": [
* "i-4ba0837f"
* "i-05b4f7d5be44822a6"
* ]
* };
* const command = new DescribeAutoScalingInstancesCommand(input);
Expand All @@ -109,7 +109,8 @@ export interface DescribeAutoScalingInstancesCommandOutput extends AutoScalingIn
* "AutoScalingGroupName": "my-auto-scaling-group",
* "AvailabilityZone": "us-west-2c",
* "HealthStatus": "HEALTHY",
* "InstanceId": "i-4ba0837f",
* "InstanceId": "i-05b4f7d5be44822a6",
* "InstanceType": "t3.micro",
* "LaunchConfigurationName": "my-launch-config",
* "LifecycleState": "InService",
* "ProtectedFromScaleIn": false
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -247,18 +247,35 @@ export interface DescribeInstanceRefreshesCommandOutput extends DescribeInstance
* {
* "AutoScalingGroupName": "my-auto-scaling-group",
* "InstanceRefreshId": "08b91cf7-8fa6-48af-b6a6-d227f40f1b9b",
* "InstancesToUpdate": 5,
* "PercentageComplete": 0,
* "StartTime": "2020-06-02T18:11:27Z",
* "Status": "InProgress"
* "InstancesToUpdate": 0,
* "PercentageComplete": 50,
* "Preferences": {
* "AutoRollback": true,
* "InstanceWarmup": 60,
* "MinHealthyPercentage": 90,
* "ScaleInProtectedInstances": "Ignore",
* "SkipMatching": false,
* "StandbyInstances": "Ignore"
* },
* "StartTime": "2023-06-13T16:46:52+00:00",
* "Status": "InProgress",
* "StatusReason": "Waiting for instances to warm up before continuing. For example: i-0645704820a8e83ff is warming up."
* },
* {
* "AutoScalingGroupName": "my-auto-scaling-group",
* "EndTime": "2020-06-02T16:53:37Z",
* "InstanceRefreshId": "dd7728d0-5bc4-4575-96a3-1b2c52bf8bb1",
* "EndTime": "2023-06-02T13:59:45+00:00",
* "InstanceRefreshId": "0e151305-1e57-4a32-a256-1fd14157c5ec",
* "InstancesToUpdate": 0,
* "PercentageComplete": 100,
* "StartTime": "2020-06-02T16:43:19Z",
* "Preferences": {
* "AutoRollback": true,
* "InstanceWarmup": 60,
* "MinHealthyPercentage": 90,
* "ScaleInProtectedInstances": "Ignore",
* "SkipMatching": false,
* "StandbyInstances": "Ignore"
* },
* "StartTime": "2023-06-02T13:53:37+00:00",
* "Status": "Successful"
* }
* ]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,7 @@ export interface DescribeScalingActivitiesCommandOutput extends ActivitiesType,
* "Activities": [
* {
* "ActivityId": "f9f2d65b-f1f2-43e7-b46d-d86756459699",
* "AutoScalingGroupARN": "arn:aws:autoscaling:us-east-1:123456789012:autoScalingGroup:12345678-1234-1234-1234-123456789012:autoScalingGroupName/my-auto-scaling-group",
* "AutoScalingGroupName": "my-auto-scaling-group",
* "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.",
* "Description": "Launching a new EC2 instance: i-4ba0837f",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ export interface DetachTrafficSourcesCommandOutput extends DetachTrafficSourcesR
/**
* @public
* <p>Detaches one or more traffic sources from the specified Auto Scaling group.</p>
* <p>When you detach a taffic, it enters the <code>Removing</code> state while
* <p>When you detach a traffic source, it enters the <code>Removing</code> state while
* deregistering the instances in the group. When all instances are deregistered, then you
* can no longer describe the traffic source using the <a>DescribeTrafficSources</a> API call. The instances continue to run.</p>
* @example
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ export interface RollbackInstanceRefreshCommandOutput extends RollbackInstanceRe
* // const { AutoScalingClient, RollbackInstanceRefreshCommand } = require("@aws-sdk/client-auto-scaling"); // CommonJS import
* const client = new AutoScalingClient(config);
* const input = { // RollbackInstanceRefreshType
* AutoScalingGroupName: "STRING_VALUE",
* AutoScalingGroupName: "STRING_VALUE", // required
* };
* const command = new RollbackInstanceRefreshCommand(input);
* const response = await client.send(command);
Expand Down
10 changes: 3 additions & 7 deletions clients/client-auto-scaling/src/models/models_0.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5064,11 +5064,7 @@ export interface StepAdjustment {
/**
* <p>The amount by which to scale, based on the specified adjustment type. A positive value
* adds to the current capacity while a negative number removes from the current
* capacity.</p>
* <p>The amount by which to scale. The adjustment is based on the value that you specified
* in the <code>AdjustmentType</code> property (either an absolute number or a percentage).
* A positive value adds to the current capacity and a negative number subtracts from the
* current capacity. </p>
* capacity. For exact capacity, you must specify a non-negative value.</p>
*/
ScalingAdjustment: number | undefined;
}
Expand Down Expand Up @@ -6688,7 +6684,7 @@ export interface PutScalingPolicyType {
/**
* <p>The amount by which to scale, based on the specified adjustment type. A positive value
* adds to the current capacity while a negative number removes from the current capacity.
* For exact capacity, you must specify a positive value.</p>
* For exact capacity, you must specify a non-negative value.</p>
* <p>Required if the policy type is <code>SimpleScaling</code>. (Not used with any other
* policy type.) </p>
*/
Expand Down Expand Up @@ -7064,7 +7060,7 @@ export interface RollbackInstanceRefreshType {
/**
* <p>The name of the Auto Scaling group.</p>
*/
AutoScalingGroupName?: string;
AutoScalingGroupName: string | undefined;
}

/**
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
// smithy-typescript generated code
import { Paginator } from "@smithy/types";

import { AutoScalingClient } from "../AutoScalingClient";
import {
DescribeWarmPoolCommand,
DescribeWarmPoolCommandInput,
DescribeWarmPoolCommandOutput,
} from "../commands/DescribeWarmPoolCommand";
import { AutoScalingPaginationConfiguration } from "./Interfaces";

/**
* @internal
*/
const makePagedClientRequest = async (
client: AutoScalingClient,
input: DescribeWarmPoolCommandInput,
...args: any
): Promise<DescribeWarmPoolCommandOutput> => {
// @ts-ignore
return await client.send(new DescribeWarmPoolCommand(input), ...args);
};
/**
* @public
*/
export async function* paginateDescribeWarmPool(
config: AutoScalingPaginationConfiguration,
input: DescribeWarmPoolCommandInput,
...additionalArguments: any
): Paginator<DescribeWarmPoolCommandOutput> {
// ToDo: replace with actual type instead of typeof input.NextToken
let token: typeof input.NextToken | undefined = config.startingToken || undefined;
let hasNext = true;
let page: DescribeWarmPoolCommandOutput;
while (hasNext) {
input.NextToken = token;
input["MaxRecords"] = config.pageSize;
if (config.client instanceof AutoScalingClient) {
page = await makePagedClientRequest(config.client, input, ...additionalArguments);
} else {
throw new Error("Invalid client, expected AutoScaling | AutoScalingClient");
}
yield page;
const prevToken = token;
token = page.NextToken;
hasNext = !!(token && (!config.stopOnSameToken || token !== prevToken));
}
// @ts-ignore
return undefined;
}
2 changes: 2 additions & 0 deletions clients/client-auto-scaling/src/pagination/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,7 @@ export * from "./DescribeScheduledActionsPaginator";
export * from "./DescribeTagsPaginator";

export * from "./DescribeTrafficSourcesPaginator";

export * from "./DescribeWarmPoolPaginator";
// smithy-typescript generated code
export * from "./Interfaces";
Loading

0 comments on commit 4137d54

Please sign in to comment.