Skip to content

Commit e92a768

Browse files
author
awstools
committed
feat(client-application-auto-scaling): Application Auto Scaling customers can now use mathematical functions to customize the metric used with Target Tracking policies within the policy configuration itself, saving the cost and effort of publishing the customizations as a separate metric.
1 parent 8911e55 commit e92a768

File tree

8 files changed

+961
-403
lines changed

8 files changed

+961
-403
lines changed

clients/client-application-auto-scaling/README.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,8 @@ resources:</p>
5555
<p>Custom resources provided by your own applications or services</p>
5656
</li>
5757
</ul>
58+
<p>To learn more about Application Auto Scaling, see the <a href="https://docs.aws.amazon.com/autoscaling/application/userguide/what-is-application-auto-scaling.html">Application Auto Scaling User
59+
Guide</a>.</p>
5860
<p>
5961
<b>API Summary</b>
6062
</p>
@@ -78,9 +80,6 @@ triggered by a scaling policy, scale-in activities that are triggered by a scali
7880
and scheduled scaling.</p>
7981
</li>
8082
</ul>
81-
<p>To learn more about Application Auto Scaling, including information about granting IAM users required
82-
permissions for Application Auto Scaling actions, see the <a href="https://docs.aws.amazon.com/autoscaling/application/userguide/what-is-application-auto-scaling.html">Application Auto Scaling User
83-
Guide</a>.</p>
8483

8584
## Installing
8685

clients/client-application-auto-scaling/src/ApplicationAutoScaling.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,8 @@ import {
100100
* <p>Custom resources provided by your own applications or services</p>
101101
* </li>
102102
* </ul>
103+
* <p>To learn more about Application Auto Scaling, see the <a href="https://docs.aws.amazon.com/autoscaling/application/userguide/what-is-application-auto-scaling.html">Application Auto Scaling User
104+
* Guide</a>.</p>
103105
* <p>
104106
* <b>API Summary</b>
105107
* </p>
@@ -123,9 +125,6 @@ import {
123125
* and scheduled scaling.</p>
124126
* </li>
125127
* </ul>
126-
* <p>To learn more about Application Auto Scaling, including information about granting IAM users required
127-
* permissions for Application Auto Scaling actions, see the <a href="https://docs.aws.amazon.com/autoscaling/application/userguide/what-is-application-auto-scaling.html">Application Auto Scaling User
128-
* Guide</a>.</p>
129128
*/
130129
export class ApplicationAutoScaling extends ApplicationAutoScalingClient {
131130
/**

clients/client-application-auto-scaling/src/ApplicationAutoScalingClient.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -311,6 +311,8 @@ export interface ApplicationAutoScalingClientResolvedConfig extends ApplicationA
311311
* <p>Custom resources provided by your own applications or services</p>
312312
* </li>
313313
* </ul>
314+
* <p>To learn more about Application Auto Scaling, see the <a href="https://docs.aws.amazon.com/autoscaling/application/userguide/what-is-application-auto-scaling.html">Application Auto Scaling User
315+
* Guide</a>.</p>
314316
* <p>
315317
* <b>API Summary</b>
316318
* </p>
@@ -334,9 +336,6 @@ export interface ApplicationAutoScalingClientResolvedConfig extends ApplicationA
334336
* and scheduled scaling.</p>
335337
* </li>
336338
* </ul>
337-
* <p>To learn more about Application Auto Scaling, including information about granting IAM users required
338-
* permissions for Application Auto Scaling actions, see the <a href="https://docs.aws.amazon.com/autoscaling/application/userguide/what-is-application-auto-scaling.html">Application Auto Scaling User
339-
* Guide</a>.</p>
340339
*/
341340
export class ApplicationAutoScalingClient extends __Client<
342341
__HttpHandlerOptions,

clients/client-application-auto-scaling/src/endpoint/EndpointParameters.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ export const resolveClientEndpointParameters = <T>(
2424
};
2525

2626
export interface EndpointParameters extends __EndpointParameters {
27-
Region: string;
27+
Region?: string;
2828
UseDualStack?: boolean;
2929
UseFIPS?: boolean;
3030
Endpoint?: string;

clients/client-application-auto-scaling/src/endpoint/ruleset.ts

Lines changed: 22 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -6,26 +6,27 @@ import { RuleSetObject } from "@aws-sdk/util-endpoints";
66
or see "smithy.rules#endpointRuleSet"
77
in codegen/sdk-codegen/aws-models/application-auto-scaling.json */
88

9-
const s="fn",
10-
t="argv",
11-
u="ref";
12-
const a=true,
13-
b=false,
14-
c="String",
15-
d="PartitionResult",
16-
e="tree",
17-
f="error",
18-
g="endpoint",
19-
h="getAttr",
20-
i={"required":true,"default":false,"type":"Boolean"},
21-
j={[u]:"Endpoint"},
22-
k={[s]:"booleanEquals",[t]:[{[u]:"UseFIPS"},true]},
23-
l={[s]:"booleanEquals",[t]:[{[u]:"UseDualStack"},true]},
24-
m={},
25-
n={[s]:"booleanEquals",[t]:[true,{[s]:h,[t]:[{[u]:d},"supportsFIPS"]}]},
26-
o={[u]:d},
27-
p={[s]:"booleanEquals",[t]:[true,{[s]:h,[t]:[o,"supportsDualStack"]}]},
9+
const s="required",
10+
t="fn",
11+
u="argv",
12+
v="ref";
13+
const a="isSet",
14+
b="tree",
15+
c="error",
16+
d="endpoint",
17+
e="PartitionResult",
18+
f="getAttr",
19+
g={[s]:false,"type":"String"},
20+
h={[s]:true,"default":false,"type":"Boolean"},
21+
i={[v]:"Endpoint"},
22+
j={[t]:"booleanEquals",[u]:[{[v]:"UseFIPS"},true]},
23+
k={[t]:"booleanEquals",[u]:[{[v]:"UseDualStack"},true]},
24+
l={},
25+
m={[t]:"booleanEquals",[u]:[true,{[t]:f,[u]:[{[v]:e},"supportsFIPS"]}]},
26+
n={[v]:e},
27+
o={[t]:"booleanEquals",[u]:[true,{[t]:f,[u]:[n,"supportsDualStack"]}]},
28+
p=[j],
2829
q=[k],
29-
r=[l];
30-
const _data={version:"1.0",parameters:{Region:{required:a,type:c},UseDualStack:i,UseFIPS:i,Endpoint:{required:b,type:c}},rules:[{conditions:[{[s]:"aws.partition",[t]:[{[u]:"Region"}],assign:d}],type:e,rules:[{conditions:[{[s]:"isSet",[t]:[j]}],type:e,rules:[{conditions:q,error:"Invalid Configuration: FIPS and custom endpoint are not supported",type:f},{type:e,rules:[{conditions:r,error:"Invalid Configuration: Dualstack and custom endpoint are not supported",type:f},{endpoint:{url:j,properties:m,headers:m},type:g}]}]},{conditions:[k,l],type:e,rules:[{conditions:[n,p],type:e,rules:[{type:e,rules:[{endpoint:{url:"https://application-autoscaling-fips.{Region}.{PartitionResult#dualStackDnsSuffix}",properties:m,headers:m},type:g}]}]},{error:"FIPS and DualStack are enabled, but this partition does not support one or both",type:f}]},{conditions:q,type:e,rules:[{conditions:[n],type:e,rules:[{type:e,rules:[{conditions:[{[s]:"stringEquals",[t]:["aws-us-gov",{[s]:h,[t]:[o,"name"]}]}],endpoint:{url:"https://application-autoscaling.{Region}.amazonaws.com",properties:m,headers:m},type:g},{endpoint:{url:"https://application-autoscaling-fips.{Region}.{PartitionResult#dnsSuffix}",properties:m,headers:m},type:g}]}]},{error:"FIPS is enabled but this partition does not support FIPS",type:f}]},{conditions:r,type:e,rules:[{conditions:[p],type:e,rules:[{type:e,rules:[{endpoint:{url:"https://application-autoscaling.{Region}.{PartitionResult#dualStackDnsSuffix}",properties:m,headers:m},type:g}]}]},{error:"DualStack is enabled but this partition does not support DualStack",type:f}]},{type:e,rules:[{endpoint:{url:"https://application-autoscaling.{Region}.{PartitionResult#dnsSuffix}",properties:m,headers:m},type:g}]}]}]};
30+
r=[{[v]:"Region"}];
31+
const _data={version:"1.0",parameters:{Region:g,UseDualStack:h,UseFIPS:h,Endpoint:g},rules:[{conditions:[{[t]:a,[u]:[i]}],type:b,rules:[{conditions:p,error:"Invalid Configuration: FIPS and custom endpoint are not supported",type:c},{type:b,rules:[{conditions:q,error:"Invalid Configuration: Dualstack and custom endpoint are not supported",type:c},{endpoint:{url:i,properties:l,headers:l},type:d}]}]},{type:b,rules:[{conditions:[{[t]:a,[u]:r}],type:b,rules:[{conditions:[{[t]:"aws.partition",[u]:r,assign:e}],type:b,rules:[{conditions:[j,k],type:b,rules:[{conditions:[m,o],type:b,rules:[{type:b,rules:[{endpoint:{url:"https://application-autoscaling-fips.{Region}.{PartitionResult#dualStackDnsSuffix}",properties:l,headers:l},type:d}]}]},{error:"FIPS and DualStack are enabled, but this partition does not support one or both",type:c}]},{conditions:p,type:b,rules:[{conditions:[m],type:b,rules:[{type:b,rules:[{conditions:[{[t]:"stringEquals",[u]:["aws-us-gov",{[t]:f,[u]:[n,"name"]}]}],endpoint:{url:"https://application-autoscaling.{Region}.amazonaws.com",properties:l,headers:l},type:d},{endpoint:{url:"https://application-autoscaling-fips.{Region}.{PartitionResult#dnsSuffix}",properties:l,headers:l},type:d}]}]},{error:"FIPS is enabled but this partition does not support FIPS",type:c}]},{conditions:q,type:b,rules:[{conditions:[o],type:b,rules:[{type:b,rules:[{endpoint:{url:"https://application-autoscaling.{Region}.{PartitionResult#dualStackDnsSuffix}",properties:l,headers:l},type:d}]}]},{error:"DualStack is enabled but this partition does not support DualStack",type:c}]},{type:b,rules:[{endpoint:{url:"https://application-autoscaling.{Region}.{PartitionResult#dnsSuffix}",properties:l,headers:l},type:d}]}]}]},{error:"Invalid Configuration: Missing Region",type:c}]}]};
3132
export const ruleSet: RuleSetObject = _data;

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

Lines changed: 167 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1065,8 +1065,8 @@ export interface ScalableTarget {
10651065
CreationTime: Date | undefined;
10661066

10671067
/**
1068-
* <p>Specifies whether the scaling activities for a scalable target are in a suspended state.
1069-
* </p>
1068+
* <p>Specifies whether the scaling activities for a scalable target are in a suspended
1069+
* state.</p>
10701070
*/
10711071
SuspendedState?: SuspendedState;
10721072
}
@@ -1960,6 +1960,134 @@ export interface MetricDimension {
19601960
Value: string | undefined;
19611961
}
19621962

1963+
/**
1964+
* <p>Describes the dimension of a metric.</p>
1965+
*/
1966+
export interface TargetTrackingMetricDimension {
1967+
/**
1968+
* <p>The name of the dimension.</p>
1969+
*/
1970+
Name: string | undefined;
1971+
1972+
/**
1973+
* <p>The value of the dimension.</p>
1974+
*/
1975+
Value: string | undefined;
1976+
}
1977+
1978+
/**
1979+
* <p>Represents a specific metric.</p>
1980+
* <p>Metric is a property of the <a>TargetTrackingMetricStat</a> object.</p>
1981+
*/
1982+
export interface TargetTrackingMetric {
1983+
/**
1984+
* <p>The dimensions for the metric. For the list of available dimensions, see the Amazon Web Services
1985+
* documentation available from the table in <a href="https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/aws-services-cloudwatch-metrics.html">Amazon Web Services
1986+
* services that publish CloudWatch metrics </a> in the <i>Amazon CloudWatch User
1987+
* Guide</i>. </p>
1988+
* <p>Conditional: If you published your metric with dimensions, you must specify the same
1989+
* dimensions in your scaling policy.</p>
1990+
*/
1991+
Dimensions?: TargetTrackingMetricDimension[];
1992+
1993+
/**
1994+
* <p>The name of the metric.</p>
1995+
*/
1996+
MetricName?: string;
1997+
1998+
/**
1999+
* <p>The namespace of the metric. For more information, see the table in <a href="https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/aws-services-cloudwatch-metrics.html">Amazon Web Services
2000+
* services that publish CloudWatch metrics </a> in the <i>Amazon CloudWatch User
2001+
* Guide</i>.</p>
2002+
*/
2003+
Namespace?: string;
2004+
}
2005+
2006+
/**
2007+
* <p>This structure defines the CloudWatch metric to return, along with the statistic, period, and
2008+
* unit.</p>
2009+
* <p>For more information about the CloudWatch terminology below, see <a href="https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/cloudwatch_concepts.html">Amazon CloudWatch
2010+
* concepts</a> in the <i>Amazon CloudWatch User Guide</i>.</p>
2011+
*/
2012+
export interface TargetTrackingMetricStat {
2013+
/**
2014+
* <p>The CloudWatch metric to return, including the metric name, namespace, and dimensions. To get
2015+
* the exact metric name, namespace, and dimensions, inspect the <a href="https://docs.aws.amazon.com/AmazonCloudWatch/latest/APIReference/API_Metric.html">Metric</a> object that is
2016+
* returned by a call to <a href="https://docs.aws.amazon.com/AmazonCloudWatch/latest/APIReference/API_ListMetrics.html">ListMetrics</a>.</p>
2017+
*/
2018+
Metric: TargetTrackingMetric | undefined;
2019+
2020+
/**
2021+
* <p>The statistic to return. It can include any CloudWatch statistic or extended statistic. For a
2022+
* list of valid values, see the table in <a href="https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/cloudwatch_concepts.html#Statistic">Statistics</a> in the <i>Amazon CloudWatch User Guide</i>.</p>
2023+
* <p>The most commonly used metrics for scaling is <code>Average</code>
2024+
* </p>
2025+
*/
2026+
Stat: string | undefined;
2027+
2028+
/**
2029+
* <p>The unit to use for the returned data points. For a complete list of the units that CloudWatch
2030+
* supports, see the <a href="https://docs.aws.amazon.com/AmazonCloudWatch/latest/APIReference/API_MetricDatum.html">MetricDatum</a> data
2031+
* type in the <i>Amazon CloudWatch API Reference</i>.</p>
2032+
*/
2033+
Unit?: string;
2034+
}
2035+
2036+
/**
2037+
* <p>The metric data to return. Also defines whether this call is returning data for one
2038+
* metric only, or whether it is performing a math expression on the values of returned metric
2039+
* statistics to create a new time series. A time series is a series of data points, each of
2040+
* which is associated with a timestamp.</p>
2041+
* <p>For more information and examples, see <a href="https://docs.aws.amazon.com/autoscaling/application/userguide/application-auto-scaling-target-tracking-metric-math.html">Create a target tracking scaling policy for Application Auto Scaling using metric math</a> in the
2042+
* <i>Application Auto Scaling User Guide</i>.</p>
2043+
*/
2044+
export interface TargetTrackingMetricDataQuery {
2045+
/**
2046+
* <p>The math expression to perform on the returned data, if this object is performing a math
2047+
* expression. This expression can use the <code>Id</code> of the other metrics to refer to
2048+
* those metrics, and can also use the <code>Id</code> of other expressions to use the result
2049+
* of those expressions. </p>
2050+
* <p>Conditional: Within each <code>TargetTrackingMetricDataQuery</code> object, you must
2051+
* specify either <code>Expression</code> or <code>MetricStat</code>, but not both.</p>
2052+
*/
2053+
Expression?: string;
2054+
2055+
/**
2056+
* <p>A short name that identifies the object's results in the response. This name must be
2057+
* unique among all <code>MetricDataQuery</code> objects specified for a single scaling
2058+
* policy. If you are performing math expressions on this set of data, this name represents
2059+
* that data and can serve as a variable in the mathematical expression. The valid characters
2060+
* are letters, numbers, and underscores. The first character must be a lowercase letter.
2061+
* </p>
2062+
*/
2063+
Id: string | undefined;
2064+
2065+
/**
2066+
* <p>A human-readable label for this metric or expression. This is especially useful if this
2067+
* is a math expression, so that you know what the value represents.</p>
2068+
*/
2069+
Label?: string;
2070+
2071+
/**
2072+
* <p>Information about the metric data to return.</p>
2073+
* <p>Conditional: Within each <code>MetricDataQuery</code> object, you must specify either
2074+
* <code>Expression</code> or <code>MetricStat</code>, but not both.</p>
2075+
*/
2076+
MetricStat?: TargetTrackingMetricStat;
2077+
2078+
/**
2079+
* <p>Indicates whether to return the timestamps and raw data values of this metric. </p>
2080+
* <p>If you use any math expressions, specify <code>true</code> for this value for only the
2081+
* final math expression that the metric specification is based on. You must specify
2082+
* <code>false</code> for <code>ReturnData</code> for all the other metrics and expressions
2083+
* used in the metric specification.</p>
2084+
* <p>If you are only retrieving metrics and not performing any math expressions, do not
2085+
* specify anything for <code>ReturnData</code>. This sets it to its default
2086+
* (<code>true</code>).</p>
2087+
*/
2088+
ReturnData?: boolean;
2089+
}
2090+
19632091
export enum MetricStatistic {
19642092
Average = "Average",
19652093
Maximum = "Maximum",
@@ -1989,10 +2117,6 @@ export enum MetricStatistic {
19892117
* increase when capacity decreases. </p>
19902118
* </li>
19912119
* </ul>
1992-
* <p>For an example of how creating new metrics can be useful, see <a href="https://docs.aws.amazon.com/autoscaling/ec2/userguide/as-using-sqs-queue.html">Scaling
1993-
* based on Amazon SQS</a> in the <i>Amazon EC2 Auto Scaling User Guide</i>. This topic
1994-
* mentions Auto Scaling groups, but the same scenario for Amazon SQS can apply to the target tracking
1995-
* scaling policies that you create for a Spot Fleet by using the Application Auto Scaling API.</p>
19962120
* <p>For more information about the CloudWatch terminology below, see <a href="https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/cloudwatch_concepts.html">Amazon CloudWatch
19972121
* concepts</a> in the <i>Amazon CloudWatch User Guide</i>. </p>
19982122
*/
@@ -2001,12 +2125,12 @@ export interface CustomizedMetricSpecification {
20012125
* <p>The name of the metric. To get the exact metric name, namespace, and dimensions, inspect
20022126
* the <a href="https://docs.aws.amazon.com/AmazonCloudWatch/latest/APIReference/API_Metric.html">Metric</a> object that is returned by a call to <a href="https://docs.aws.amazon.com/AmazonCloudWatch/latest/APIReference/API_ListMetrics.html">ListMetrics</a>.</p>
20032127
*/
2004-
MetricName: string | undefined;
2128+
MetricName?: string;
20052129

20062130
/**
20072131
* <p>The namespace of the metric.</p>
20082132
*/
2009-
Namespace: string | undefined;
2133+
Namespace?: string;
20102134

20112135
/**
20122136
* <p>The dimensions of the metric. </p>
@@ -2018,14 +2142,20 @@ export interface CustomizedMetricSpecification {
20182142
/**
20192143
* <p>The statistic of the metric.</p>
20202144
*/
2021-
Statistic: MetricStatistic | string | undefined;
2145+
Statistic?: MetricStatistic | string;
20222146

20232147
/**
20242148
* <p>The unit of the metric. For a complete list of the units that CloudWatch supports, see the
20252149
* <a href="https://docs.aws.amazon.com/AmazonCloudWatch/latest/APIReference/API_MetricDatum.html">MetricDatum</a> data
20262150
* type in the <i>Amazon CloudWatch API Reference</i>.</p>
20272151
*/
20282152
Unit?: string;
2153+
2154+
/**
2155+
* <p>The metrics to include in the target tracking scaling policy, as a metric data query.
2156+
* This can include both raw metric and metric math expressions.</p>
2157+
*/
2158+
Metrics?: TargetTrackingMetricDataQuery[];
20292159
}
20302160

20312161
export enum MetricType {
@@ -3806,6 +3936,34 @@ export const MetricDimensionFilterSensitiveLog = (obj: MetricDimension): any =>
38063936
...obj,
38073937
});
38083938

3939+
/**
3940+
* @internal
3941+
*/
3942+
export const TargetTrackingMetricDimensionFilterSensitiveLog = (obj: TargetTrackingMetricDimension): any => ({
3943+
...obj,
3944+
});
3945+
3946+
/**
3947+
* @internal
3948+
*/
3949+
export const TargetTrackingMetricFilterSensitiveLog = (obj: TargetTrackingMetric): any => ({
3950+
...obj,
3951+
});
3952+
3953+
/**
3954+
* @internal
3955+
*/
3956+
export const TargetTrackingMetricStatFilterSensitiveLog = (obj: TargetTrackingMetricStat): any => ({
3957+
...obj,
3958+
});
3959+
3960+
/**
3961+
* @internal
3962+
*/
3963+
export const TargetTrackingMetricDataQueryFilterSensitiveLog = (obj: TargetTrackingMetricDataQuery): any => ({
3964+
...obj,
3965+
});
3966+
38093967
/**
38103968
* @internal
38113969
*/

0 commit comments

Comments
 (0)