Skip to content

Commit 1ff9976

Browse files
author
awstools
committed
feat(client-auto-scaling): Adds support for metric math for target tracking scaling policies, saving you the cost and effort of publishing a custom metric to CloudWatch. Also adds support for VPC Lattice by adding the Attach/Detach/DescribeTrafficSources APIs and a new health check type to the CreateAutoScalingGroup API.
1 parent c32b0a1 commit 1ff9976

File tree

57 files changed

+3144
-1545
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

57 files changed

+3144
-1545
lines changed

clients/client-auto-scaling/src/AutoScaling.ts

Lines changed: 307 additions & 183 deletions
Large diffs are not rendered by default.

clients/client-auto-scaling/src/AutoScalingClient.ts

Lines changed: 20 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,10 @@ import {
5656
AttachLoadBalancerTargetGroupsCommandInput,
5757
AttachLoadBalancerTargetGroupsCommandOutput,
5858
} from "./commands/AttachLoadBalancerTargetGroupsCommand";
59+
import {
60+
AttachTrafficSourcesCommandInput,
61+
AttachTrafficSourcesCommandOutput,
62+
} from "./commands/AttachTrafficSourcesCommand";
5963
import {
6064
BatchDeleteScheduledActionCommandInput,
6165
BatchDeleteScheduledActionCommandOutput,
@@ -174,6 +178,10 @@ import {
174178
DescribeTerminationPolicyTypesCommandInput,
175179
DescribeTerminationPolicyTypesCommandOutput,
176180
} from "./commands/DescribeTerminationPolicyTypesCommand";
181+
import {
182+
DescribeTrafficSourcesCommandInput,
183+
DescribeTrafficSourcesCommandOutput,
184+
} from "./commands/DescribeTrafficSourcesCommand";
177185
import { DescribeWarmPoolCommandInput, DescribeWarmPoolCommandOutput } from "./commands/DescribeWarmPoolCommand";
178186
import { DetachInstancesCommandInput, DetachInstancesCommandOutput } from "./commands/DetachInstancesCommand";
179187
import {
@@ -184,6 +192,10 @@ import {
184192
DetachLoadBalancerTargetGroupsCommandInput,
185193
DetachLoadBalancerTargetGroupsCommandOutput,
186194
} from "./commands/DetachLoadBalancerTargetGroupsCommand";
195+
import {
196+
DetachTrafficSourcesCommandInput,
197+
DetachTrafficSourcesCommandOutput,
198+
} from "./commands/DetachTrafficSourcesCommand";
187199
import {
188200
DisableMetricsCollectionCommandInput,
189201
DisableMetricsCollectionCommandOutput,
@@ -246,6 +258,7 @@ export type ServiceInputTypes =
246258
| AttachInstancesCommandInput
247259
| AttachLoadBalancerTargetGroupsCommandInput
248260
| AttachLoadBalancersCommandInput
261+
| AttachTrafficSourcesCommandInput
249262
| BatchDeleteScheduledActionCommandInput
250263
| BatchPutScheduledUpdateGroupActionCommandInput
251264
| CancelInstanceRefreshCommandInput
@@ -280,10 +293,12 @@ export type ServiceInputTypes =
280293
| DescribeScheduledActionsCommandInput
281294
| DescribeTagsCommandInput
282295
| DescribeTerminationPolicyTypesCommandInput
296+
| DescribeTrafficSourcesCommandInput
283297
| DescribeWarmPoolCommandInput
284298
| DetachInstancesCommandInput
285299
| DetachLoadBalancerTargetGroupsCommandInput
286300
| DetachLoadBalancersCommandInput
301+
| DetachTrafficSourcesCommandInput
287302
| DisableMetricsCollectionCommandInput
288303
| EnableMetricsCollectionCommandInput
289304
| EnterStandbyCommandInput
@@ -309,6 +324,7 @@ export type ServiceOutputTypes =
309324
| AttachInstancesCommandOutput
310325
| AttachLoadBalancerTargetGroupsCommandOutput
311326
| AttachLoadBalancersCommandOutput
327+
| AttachTrafficSourcesCommandOutput
312328
| BatchDeleteScheduledActionCommandOutput
313329
| BatchPutScheduledUpdateGroupActionCommandOutput
314330
| CancelInstanceRefreshCommandOutput
@@ -343,10 +359,12 @@ export type ServiceOutputTypes =
343359
| DescribeScheduledActionsCommandOutput
344360
| DescribeTagsCommandOutput
345361
| DescribeTerminationPolicyTypesCommandOutput
362+
| DescribeTrafficSourcesCommandOutput
346363
| DescribeWarmPoolCommandOutput
347364
| DetachInstancesCommandOutput
348365
| DetachLoadBalancerTargetGroupsCommandOutput
349366
| DetachLoadBalancersCommandOutput
367+
| DetachTrafficSourcesCommandOutput
350368
| DisableMetricsCollectionCommandOutput
351369
| EnableMetricsCollectionCommandOutput
352370
| EnterStandbyCommandOutput
@@ -519,22 +537,9 @@ export interface AutoScalingClientResolvedConfig extends AutoScalingClientResolv
519537

520538
/**
521539
* <fullname>Amazon EC2 Auto Scaling</fullname>
522-
*
523-
*
524-
*
525-
*
526-
*
527-
*
528-
*
529-
*
530-
*
531-
*
532-
*
533-
*
534-
*
535-
* <p>Amazon EC2 Auto Scaling is designed to automatically launch and terminate EC2 instances
540+
* <p>Amazon EC2 Auto Scaling is designed to automatically launch and terminate EC2 instances
536541
* based on user-defined scaling policies, scheduled actions, and health checks.</p>
537-
* <p>For more information, see the <a href="https://docs.aws.amazon.com/autoscaling/ec2/userguide/">Amazon EC2 Auto Scaling User Guide</a> and the <a href="https://docs.aws.amazon.com/autoscaling/ec2/APIReference/Welcome.html">Amazon EC2 Auto Scaling API Reference</a>.</p>
542+
* <p>For more information, see the <a href="https://docs.aws.amazon.com/autoscaling/ec2/userguide/">Amazon EC2 Auto Scaling User Guide</a> and the <a href="https://docs.aws.amazon.com/autoscaling/ec2/APIReference/Welcome.html">Amazon EC2 Auto Scaling API Reference</a>.</p>
538543
*/
539544
export class AutoScalingClient extends __Client<
540545
__HttpHandlerOptions,

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,14 +25,14 @@ export interface AttachInstancesCommandOutput extends __MetadataBearer {}
2525

2626
/**
2727
* <p>Attaches one or more EC2 instances to the specified Auto Scaling group.</p>
28-
* <p>When you attach instances, Amazon EC2 Auto Scaling increases the desired capacity of the group by the
28+
* <p>When you attach instances, Amazon EC2 Auto Scaling increases the desired capacity of the group by the
2929
* number of instances being attached. If the number of instances being attached plus the
3030
* desired capacity of the group exceeds the maximum size of the group, the operation
3131
* fails.</p>
32-
* <p>If there is a Classic Load Balancer attached to your Auto Scaling group, the instances are
32+
* <p>If there is a Classic Load Balancer attached to your Auto Scaling group, the instances are
3333
* also registered with the load balancer. If there are target groups attached to your Auto Scaling
3434
* group, the instances are also registered with the target groups.</p>
35-
* <p>For more information, see <a href="https://docs.aws.amazon.com/autoscaling/ec2/userguide/attach-instance-asg.html">Attach EC2 instances to
35+
* <p>For more information, see <a href="https://docs.aws.amazon.com/autoscaling/ec2/userguide/attach-instance-asg.html">Attach EC2 instances to
3636
* your Auto Scaling group</a> in the <i>Amazon EC2 Auto Scaling User Guide</i>.</p>
3737
* @example
3838
* Use a bare-bones client and the command you need to make an API call.

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

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -32,25 +32,25 @@ export interface AttachLoadBalancerTargetGroupsCommandOutput
3232

3333
/**
3434
* <p>Attaches one or more target groups to the specified Auto Scaling group.</p>
35-
* <p>This operation is used with the following load balancer types: </p>
36-
* <ul>
35+
* <p>This operation is used with the following load balancer types: </p>
36+
* <ul>
3737
* <li>
38-
* <p>Application Load Balancer - Operates at the application layer (layer 7) and supports HTTP and
38+
* <p>Application Load Balancer - Operates at the application layer (layer 7) and supports HTTP and
3939
* HTTPS. </p>
4040
* </li>
4141
* <li>
42-
* <p>Network Load Balancer - Operates at the transport layer (layer 4) and supports TCP, TLS, and
42+
* <p>Network Load Balancer - Operates at the transport layer (layer 4) and supports TCP, TLS, and
4343
* UDP. </p>
4444
* </li>
4545
* <li>
46-
* <p>Gateway Load Balancer - Operates at the network layer (layer 3).</p>
46+
* <p>Gateway Load Balancer - Operates at the network layer (layer 3).</p>
4747
* </li>
4848
* </ul>
49-
* <p>To describe the target groups for an Auto Scaling group, call the <a>DescribeLoadBalancerTargetGroups</a> API. To detach the target group from
49+
* <p>To describe the target groups for an Auto Scaling group, call the <a>DescribeLoadBalancerTargetGroups</a> API. To detach the target group from
5050
* the Auto Scaling group, call the <a>DetachLoadBalancerTargetGroups</a> API.</p>
51-
* <p>This operation is additive and does not detach existing target groups or Classic Load
51+
* <p>This operation is additive and does not detach existing target groups or Classic Load
5252
* Balancers from the Auto Scaling group.</p>
53-
* <p>For more information, see <a href="https://docs.aws.amazon.com/autoscaling/ec2/userguide/autoscaling-load-balancer.html">Use Elastic Load Balancing to
53+
* <p>For more information, see <a href="https://docs.aws.amazon.com/autoscaling/ec2/userguide/autoscaling-load-balancer.html">Use Elastic Load Balancing to
5454
* distribute traffic across the instances in your Auto Scaling group</a> in the
5555
* <i>Amazon EC2 Auto Scaling User Guide</i>. </p>
5656
* @example

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

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -31,14 +31,14 @@ export interface AttachLoadBalancersCommandOutput extends AttachLoadBalancersRes
3131
/**
3232
* <note>
3333
* <p>To attach an Application Load Balancer, Network Load Balancer, or Gateway Load Balancer, use the <a>AttachLoadBalancerTargetGroups</a> API operation instead.</p>
34-
* </note>
35-
* <p>Attaches one or more Classic Load Balancers to the specified Auto Scaling group. Amazon EC2 Auto Scaling registers the
34+
* </note>
35+
* <p>Attaches one or more Classic Load Balancers to the specified Auto Scaling group. Amazon EC2 Auto Scaling registers the
3636
* running instances with these Classic Load Balancers.</p>
37-
* <p>To describe the load balancers for an Auto Scaling group, call the <a>DescribeLoadBalancers</a> API. To detach a load balancer from the Auto Scaling
37+
* <p>To describe the load balancers for an Auto Scaling group, call the <a>DescribeLoadBalancers</a> API. To detach a load balancer from the Auto Scaling
3838
* group, call the <a>DetachLoadBalancers</a> API.</p>
39-
* <p>This operation is additive and does not detach existing Classic Load Balancers or
39+
* <p>This operation is additive and does not detach existing Classic Load Balancers or
4040
* target groups from the Auto Scaling group.</p>
41-
* <p>For more information, see <a href="https://docs.aws.amazon.com/autoscaling/ec2/userguide/autoscaling-load-balancer.html">Use Elastic Load Balancing to
41+
* <p>For more information, see <a href="https://docs.aws.amazon.com/autoscaling/ec2/userguide/autoscaling-load-balancer.html">Use Elastic Load Balancing to
4242
* distribute traffic across the instances in your Auto Scaling group</a> in the
4343
* <i>Amazon EC2 Auto Scaling User Guide</i>.</p>
4444
* @example
Lines changed: 122 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,122 @@
1+
// smithy-typescript generated code
2+
import { EndpointParameterInstructions, getEndpointPlugin } from "@aws-sdk/middleware-endpoint";
3+
import { getSerdePlugin } from "@aws-sdk/middleware-serde";
4+
import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@aws-sdk/protocol-http";
5+
import { Command as $Command } from "@aws-sdk/smithy-client";
6+
import {
7+
FinalizeHandlerArguments,
8+
Handler,
9+
HandlerExecutionContext,
10+
HttpHandlerOptions as __HttpHandlerOptions,
11+
MetadataBearer as __MetadataBearer,
12+
MiddlewareStack,
13+
SerdeContext as __SerdeContext,
14+
} from "@aws-sdk/types";
15+
16+
import { AutoScalingClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../AutoScalingClient";
17+
import {
18+
AttachTrafficSourcesResultType,
19+
AttachTrafficSourcesResultTypeFilterSensitiveLog,
20+
AttachTrafficSourcesType,
21+
AttachTrafficSourcesTypeFilterSensitiveLog,
22+
} from "../models/models_0";
23+
import {
24+
deserializeAws_queryAttachTrafficSourcesCommand,
25+
serializeAws_queryAttachTrafficSourcesCommand,
26+
} from "../protocols/Aws_query";
27+
28+
export interface AttachTrafficSourcesCommandInput extends AttachTrafficSourcesType {}
29+
export interface AttachTrafficSourcesCommandOutput extends AttachTrafficSourcesResultType, __MetadataBearer {}
30+
31+
/**
32+
* <p>
33+
* <b>Reserved for use with Amazon VPC Lattice, which is in preview and subject to change.
34+
* Do not use this API for production workloads. This API is also subject to change.</b>
35+
* </p>
36+
* <p>Attaches one or more traffic sources to the specified Auto Scaling group.</p>
37+
* <p>To describe the traffic sources for an Auto Scaling group, call the <a>DescribeTrafficSources</a> API. To detach a traffic source from the Auto Scaling
38+
* group, call the <a>DetachTrafficSources</a> API.</p>
39+
* <p>This operation is additive and does not detach existing traffic sources from the Auto Scaling
40+
* group.</p>
41+
* @example
42+
* Use a bare-bones client and the command you need to make an API call.
43+
* ```javascript
44+
* import { AutoScalingClient, AttachTrafficSourcesCommand } from "@aws-sdk/client-auto-scaling"; // ES Modules import
45+
* // const { AutoScalingClient, AttachTrafficSourcesCommand } = require("@aws-sdk/client-auto-scaling"); // CommonJS import
46+
* const client = new AutoScalingClient(config);
47+
* const command = new AttachTrafficSourcesCommand(input);
48+
* const response = await client.send(command);
49+
* ```
50+
*
51+
* @see {@link AttachTrafficSourcesCommandInput} for command's `input` shape.
52+
* @see {@link AttachTrafficSourcesCommandOutput} for command's `response` shape.
53+
* @see {@link AutoScalingClientResolvedConfig | config} for AutoScalingClient's `config` shape.
54+
*
55+
*/
56+
export class AttachTrafficSourcesCommand extends $Command<
57+
AttachTrafficSourcesCommandInput,
58+
AttachTrafficSourcesCommandOutput,
59+
AutoScalingClientResolvedConfig
60+
> {
61+
// Start section: command_properties
62+
// End section: command_properties
63+
64+
public static getEndpointParameterInstructions(): EndpointParameterInstructions {
65+
return {
66+
UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" },
67+
Endpoint: { type: "builtInParams", name: "endpoint" },
68+
Region: { type: "builtInParams", name: "region" },
69+
UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" },
70+
};
71+
}
72+
73+
constructor(readonly input: AttachTrafficSourcesCommandInput) {
74+
// Start section: command_constructor
75+
super();
76+
// End section: command_constructor
77+
}
78+
79+
/**
80+
* @internal
81+
*/
82+
resolveMiddleware(
83+
clientStack: MiddlewareStack<ServiceInputTypes, ServiceOutputTypes>,
84+
configuration: AutoScalingClientResolvedConfig,
85+
options?: __HttpHandlerOptions
86+
): Handler<AttachTrafficSourcesCommandInput, AttachTrafficSourcesCommandOutput> {
87+
this.middlewareStack.use(getSerdePlugin(configuration, this.serialize, this.deserialize));
88+
this.middlewareStack.use(
89+
getEndpointPlugin(configuration, AttachTrafficSourcesCommand.getEndpointParameterInstructions())
90+
);
91+
92+
const stack = clientStack.concat(this.middlewareStack);
93+
94+
const { logger } = configuration;
95+
const clientName = "AutoScalingClient";
96+
const commandName = "AttachTrafficSourcesCommand";
97+
const handlerExecutionContext: HandlerExecutionContext = {
98+
logger,
99+
clientName,
100+
commandName,
101+
inputFilterSensitiveLog: AttachTrafficSourcesTypeFilterSensitiveLog,
102+
outputFilterSensitiveLog: AttachTrafficSourcesResultTypeFilterSensitiveLog,
103+
};
104+
const { requestHandler } = configuration;
105+
return stack.resolve(
106+
(request: FinalizeHandlerArguments<any>) =>
107+
requestHandler.handle(request.request as __HttpRequest, options || {}),
108+
handlerExecutionContext
109+
);
110+
}
111+
112+
private serialize(input: AttachTrafficSourcesCommandInput, context: __SerdeContext): Promise<__HttpRequest> {
113+
return serializeAws_queryAttachTrafficSourcesCommand(input, context);
114+
}
115+
116+
private deserialize(output: __HttpResponse, context: __SerdeContext): Promise<AttachTrafficSourcesCommandOutput> {
117+
return deserializeAws_queryAttachTrafficSourcesCommand(output, context);
118+
}
119+
120+
// Start section: command_body_extra
121+
// End section: command_body_extra
122+
}

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ export interface CancelInstanceRefreshCommandOutput extends CancelInstanceRefres
3232
* <p>Cancels an instance refresh operation in progress. Cancellation does not roll back any
3333
* replacements that have already been completed, but it prevents new replacements from
3434
* being started. </p>
35-
* <p>This operation is part of the <a href="https://docs.aws.amazon.com/autoscaling/ec2/userguide/asg-instance-refresh.html">instance refresh
35+
* <p>This operation is part of the <a href="https://docs.aws.amazon.com/autoscaling/ec2/userguide/asg-instance-refresh.html">instance refresh
3636
* feature</a> in Amazon EC2 Auto Scaling, which helps you update instances in your Auto Scaling group
3737
* after you make configuration changes.</p>
3838
* @example

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

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -31,41 +31,41 @@ export interface CompleteLifecycleActionCommandOutput extends CompleteLifecycleA
3131
/**
3232
* <p>Completes the lifecycle action for the specified token or instance with the specified
3333
* result.</p>
34-
* <p>This step is a part of the procedure for adding a lifecycle hook to an Auto Scaling
34+
* <p>This step is a part of the procedure for adding a lifecycle hook to an Auto Scaling
3535
* group:</p>
36-
* <ol>
36+
* <ol>
3737
* <li>
38-
* <p>(Optional) Create a launch template or launch configuration with a user data
38+
* <p>(Optional) Create a launch template or launch configuration with a user data
3939
* script that runs while an instance is in a wait state due to a lifecycle
4040
* hook.</p>
4141
* </li>
4242
* <li>
43-
* <p>(Optional) Create a Lambda function and a rule that allows Amazon EventBridge to invoke
43+
* <p>(Optional) Create a Lambda function and a rule that allows Amazon EventBridge to invoke
4444
* your Lambda function when an instance is put into a wait state due to a
4545
* lifecycle hook.</p>
4646
* </li>
4747
* <li>
48-
* <p>(Optional) Create a notification target and an IAM role. The target can be
48+
* <p>(Optional) Create a notification target and an IAM role. The target can be
4949
* either an Amazon SQS queue or an Amazon SNS topic. The role allows Amazon EC2 Auto Scaling to publish
5050
* lifecycle notifications to the target.</p>
5151
* </li>
5252
* <li>
53-
* <p>Create the lifecycle hook. Specify whether the hook is used when the instances
53+
* <p>Create the lifecycle hook. Specify whether the hook is used when the instances
5454
* launch or terminate.</p>
5555
* </li>
5656
* <li>
57-
* <p>If you need more time, record the lifecycle action heartbeat to keep the
57+
* <p>If you need more time, record the lifecycle action heartbeat to keep the
5858
* instance in a wait state.</p>
5959
* </li>
6060
* <li>
61-
* <p>
62-
* <b>If you finish before the timeout period ends, send a
61+
* <p>
62+
* <b>If you finish before the timeout period ends, send a
6363
* callback by using the <a>CompleteLifecycleAction</a> API
6464
* call.</b>
65-
* </p>
65+
* </p>
6666
* </li>
6767
* </ol>
68-
* <p>For more information, see <a href="https://docs.aws.amazon.com/autoscaling/ec2/userguide/lifecycle-hooks.html">Amazon EC2 Auto Scaling lifecycle
68+
* <p>For more information, see <a href="https://docs.aws.amazon.com/autoscaling/ec2/userguide/lifecycle-hooks.html">Amazon EC2 Auto Scaling lifecycle
6969
* hooks</a> in the <i>Amazon EC2 Auto Scaling User Guide</i>.</p>
7070
* @example
7171
* Use a bare-bones client and the command you need to make an API call.

0 commit comments

Comments
 (0)