Skip to content

Commit 26d5f85

Browse files
author
awstools
committed
feat(client-auto-scaling): Now, Amazon EC2 Auto Scaling customers can enable target tracking policies to take quicker scaling decisions, enhancing their application performance and EC2 utilization. To get started, specify target tracking to monitor a metric that is available on Amazon CloudWatch at seconds-level interval.
1 parent a83926c commit 26d5f85

File tree

5 files changed

+90
-12
lines changed

5 files changed

+90
-12
lines changed

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

+3
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,7 @@ export interface DescribePoliciesCommandOutput extends PoliciesType, __MetadataB
9191
* // ],
9292
* // Statistic: "Average" || "Minimum" || "Maximum" || "SampleCount" || "Sum",
9393
* // Unit: "STRING_VALUE",
94+
* // Period: Number("int"),
9495
* // Metrics: [ // TargetTrackingMetricDataQueries
9596
* // { // TargetTrackingMetricDataQuery
9697
* // Id: "STRING_VALUE", // required
@@ -108,8 +109,10 @@ export interface DescribePoliciesCommandOutput extends PoliciesType, __MetadataB
108109
* // },
109110
* // Stat: "STRING_VALUE", // required
110111
* // Unit: "STRING_VALUE",
112+
* // Period: Number("int"),
111113
* // },
112114
* // Label: "STRING_VALUE",
115+
* // Period: Number("int"),
113116
* // ReturnData: true || false,
114117
* // },
115118
* // ],

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

+3
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,7 @@ export interface PutScalingPolicyCommandOutput extends PolicyARNType, __Metadata
7979
* ],
8080
* Statistic: "Average" || "Minimum" || "Maximum" || "SampleCount" || "Sum",
8181
* Unit: "STRING_VALUE",
82+
* Period: Number("int"),
8283
* Metrics: [ // TargetTrackingMetricDataQueries
8384
* { // TargetTrackingMetricDataQuery
8485
* Id: "STRING_VALUE", // required
@@ -96,8 +97,10 @@ export interface PutScalingPolicyCommandOutput extends PolicyARNType, __Metadata
9697
* },
9798
* Stat: "STRING_VALUE", // required
9899
* Unit: "STRING_VALUE",
100+
* Period: Number("int"),
99101
* },
100102
* Label: "STRING_VALUE",
103+
* Period: Number("int"),
101104
* ReturnData: true || false,
102105
* },
103106
* ],

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

+27
Original file line numberDiff line numberDiff line change
@@ -6010,6 +6010,15 @@ export interface TargetTrackingMetricStat {
60106010
* @public
60116011
*/
60126012
Unit?: string | undefined;
6013+
6014+
/**
6015+
* <p>
6016+
* The period of the metric in seconds. The default value is 60. Accepted values are 10, 30, and 60. For high resolution metric, set the value to less than 60. For more information, see
6017+
* <a href="https://docs.aws.amazon.com/autoscaling/ec2/userguide/policy-creating-high-resolution-metrics.html">Create a target tracking policy using high-resolution metrics for faster response</a>.
6018+
* </p>
6019+
* @public
6020+
*/
6021+
Period?: number | undefined;
60136022
}
60146023

60156024
/**
@@ -6057,6 +6066,15 @@ export interface TargetTrackingMetricDataQuery {
60576066
*/
60586067
Label?: string | undefined;
60596068

6069+
/**
6070+
* <p>
6071+
* The period of the metric in seconds. The default value is 60. Accepted values are 10, 30, and 60. For high resolution metric, set the value to less than 60. For more information, see
6072+
* <a href="https://docs.aws.amazon.com/autoscaling/ec2/userguide/policy-creating-high-resolution-metrics.html">Create a target tracking policy using high-resolution metrics for faster response</a>.
6073+
* </p>
6074+
* @public
6075+
*/
6076+
Period?: number | undefined;
6077+
60606078
/**
60616079
* <p>Indicates whether to return the timestamps and raw data values of this metric. </p>
60626080
* <p>If you use any math expressions, specify <code>true</code> for this value for only the
@@ -6153,6 +6171,15 @@ export interface CustomizedMetricSpecification {
61536171
*/
61546172
Unit?: string | undefined;
61556173

6174+
/**
6175+
* <p>
6176+
* The period of the metric in seconds. The default value is 60. Accepted values are 10, 30, and 60. For high resolution metric, set the value to less than 60. For more information, see
6177+
* <a href="https://docs.aws.amazon.com/autoscaling/ec2/userguide/policy-creating-high-resolution-metrics.html">Create a target tracking policy using high-resolution metrics for faster response</a>.
6178+
* </p>
6179+
* @public
6180+
*/
6181+
Period?: number | undefined;
6182+
61566183
/**
61576184
* <p>The metrics to include in the target tracking scaling policy, as a metric data query.
61586185
* This can include both raw metric and metric math expressions.</p>

clients/client-auto-scaling/src/protocols/Aws_query.ts

+31-12
Original file line numberDiff line numberDiff line change
@@ -3913,6 +3913,9 @@ const se_CustomizedMetricSpecification = (input: CustomizedMetricSpecification,
39133913
if (input[_U] != null) {
39143914
entries[_U] = input[_U];
39153915
}
3916+
if (input[_P] != null) {
3917+
entries[_P] = input[_P];
3918+
}
39163919
if (input[_Me] != null) {
39173920
const memberEntries = se_TargetTrackingMetricDataQueries(input[_Me], context);
39183921
if (input[_Me]?.length === 0) {
@@ -6199,8 +6202,8 @@ const se_StartInstanceRefreshType = (input: StartInstanceRefreshType, context: _
61996202
entries[loc] = value;
62006203
});
62016204
}
6202-
if (input[_P] != null) {
6203-
const memberEntries = se_RefreshPreferences(input[_P], context);
6205+
if (input[_Pr] != null) {
6206+
const memberEntries = se_RefreshPreferences(input[_Pr], context);
62046207
Object.entries(memberEntries).forEach(([key, value]) => {
62056208
const loc = `Preferences.${key}`;
62066209
entries[loc] = value;
@@ -6371,6 +6374,9 @@ const se_TargetTrackingMetricDataQuery = (input: TargetTrackingMetricDataQuery,
63716374
if (input[_L] != null) {
63726375
entries[_L] = input[_L];
63736376
}
6377+
if (input[_P] != null) {
6378+
entries[_P] = input[_P];
6379+
}
63746380
if (input[_RD] != null) {
63756381
entries[_RD] = input[_RD];
63766382
}
@@ -6395,6 +6401,9 @@ const se_TargetTrackingMetricStat = (input: TargetTrackingMetricStat, context: _
63956401
if (input[_U] != null) {
63966402
entries[_U] = input[_U];
63976403
}
6404+
if (input[_P] != null) {
6405+
entries[_P] = input[_P];
6406+
}
63986407
return entries;
63996408
};
64006409

@@ -6766,8 +6775,8 @@ const de_Activity = (output: any, context: __SerdeContext): Activity => {
67666775
if (output[_SMt] != null) {
67676776
contents[_SMt] = __expectString(output[_SMt]);
67686777
}
6769-
if (output[_Pr] != null) {
6770-
contents[_Pr] = __strictParseInt32(output[_Pr]) as number;
6778+
if (output[_Pro] != null) {
6779+
contents[_Pro] = __strictParseInt32(output[_Pro]) as number;
67716780
}
67726781
if (output[_Det] != null) {
67736782
contents[_Det] = __expectString(output[_Det]);
@@ -7450,6 +7459,9 @@ const de_CustomizedMetricSpecification = (output: any, context: __SerdeContext):
74507459
if (output[_U] != null) {
74517460
contents[_U] = __expectString(output[_U]);
74527461
}
7462+
if (output[_P] != null) {
7463+
contents[_P] = __strictParseInt32(output[_P]) as number;
7464+
}
74537465
if (output.Metrics === "") {
74547466
contents[_Me] = [];
74557467
} else if (output[_Me] != null && output[_Me][_me] != null) {
@@ -8015,8 +8027,8 @@ const de_InstanceRefresh = (output: any, context: __SerdeContext): InstanceRefre
80158027
if (output[_PD] != null) {
80168028
contents[_PD] = de_InstanceRefreshProgressDetails(output[_PD], context);
80178029
}
8018-
if (output[_P] != null) {
8019-
contents[_P] = de_RefreshPreferences(output[_P], context);
8030+
if (output[_Pr] != null) {
8031+
contents[_Pr] = de_RefreshPreferences(output[_Pr], context);
80208032
}
80218033
if (output[_DCes] != null) {
80228034
contents[_DCes] = de_DesiredConfiguration(output[_DCes], context);
@@ -9109,9 +9121,9 @@ const de_Processes = (output: any, context: __SerdeContext): ProcessType[] => {
91099121
const de_ProcessesType = (output: any, context: __SerdeContext): ProcessesType => {
91109122
const contents: any = {};
91119123
if (output.Processes === "") {
9112-
contents[_Pro] = [];
9113-
} else if (output[_Pro] != null && output[_Pro][_me] != null) {
9114-
contents[_Pro] = de_Processes(__getArrayIfSingleItem(output[_Pro][_me]), context);
9124+
contents[_Proc] = [];
9125+
} else if (output[_Proc] != null && output[_Proc][_me] != null) {
9126+
contents[_Proc] = de_Processes(__getArrayIfSingleItem(output[_Proc][_me]), context);
91159127
}
91169128
return contents;
91179129
};
@@ -9606,6 +9618,9 @@ const de_TargetTrackingMetricDataQuery = (output: any, context: __SerdeContext):
96069618
if (output[_L] != null) {
96079619
contents[_L] = __expectString(output[_L]);
96089620
}
9621+
if (output[_P] != null) {
9622+
contents[_P] = __strictParseInt32(output[_P]) as number;
9623+
}
96099624
if (output[_RD] != null) {
96109625
contents[_RD] = __parseBoolean(output[_RD]);
96119626
}
@@ -9626,6 +9641,9 @@ const de_TargetTrackingMetricStat = (output: any, context: __SerdeContext): Targ
96269641
if (output[_U] != null) {
96279642
contents[_U] = __expectString(output[_U]);
96289643
}
9644+
if (output[_P] != null) {
9645+
contents[_P] = __strictParseInt32(output[_P]) as number;
9646+
}
96299647
return contents;
96309648
};
96319649

@@ -10041,7 +10059,7 @@ const _ODAS = "OnDemandAllocationStrategy";
1004110059
const _ODBC = "OnDemandBaseCapacity";
1004210060
const _ODMPPOLP = "OnDemandMaxPricePercentageOverLowestPrice";
1004310061
const _ODPABC = "OnDemandPercentageAboveBaseCapacity";
10044-
const _P = "Preferences";
10062+
const _P = "Period";
1004510063
const _PAL = "PropagateAtLaunch";
1004610064
const _PARN = "PolicyARN";
1004710065
const _PC = "PredictedCapacity";
@@ -10069,8 +10087,9 @@ const _PT = "PlacementTenancy";
1006910087
const _PTo = "PolicyTypes";
1007010088
const _PTol = "PolicyType";
1007110089
const _PWP = "PutWarmPool";
10072-
const _Pr = "Progress";
10073-
const _Pro = "Processes";
10090+
const _Pr = "Preferences";
10091+
const _Pro = "Progress";
10092+
const _Proc = "Processes";
1007410093
const _R = "References";
1007510094
const _RARN = "RoleARN";
1007610095
const _RD = "ReturnData";

codegen/sdk-codegen/aws-models/auto-scaling.json

+26
Original file line numberDiff line numberDiff line change
@@ -3563,6 +3563,12 @@
35633563
"smithy.api#documentation": "<p>The unit of the metric. For a complete list of the units that CloudWatch supports, see the\n <a href=\"https://docs.aws.amazon.com/AmazonCloudWatch/latest/APIReference/API_MetricDatum.html\">MetricDatum</a>\n data type in the <i>Amazon CloudWatch API Reference</i>.</p>"
35643564
}
35653565
},
3566+
"Period": {
3567+
"target": "com.amazonaws.autoscaling#MetricGranularityInSeconds",
3568+
"traits": {
3569+
"smithy.api#documentation": "<p>\n The period of the metric in seconds. The default value is 60. Accepted values are 10, 30, and 60. For high resolution metric, set the value to less than 60. For more information, see\n <a href=\"https://docs.aws.amazon.com/autoscaling/ec2/userguide/policy-creating-high-resolution-metrics.html\">Create a target tracking policy using high-resolution metrics for faster response</a>.\n </p>"
3570+
}
3571+
},
35663572
"Metrics": {
35673573
"target": "com.amazonaws.autoscaling#TargetTrackingMetricDataQueries",
35683574
"traits": {
@@ -8112,6 +8118,14 @@
81128118
"target": "com.amazonaws.autoscaling#MetricDimension"
81138119
}
81148120
},
8121+
"com.amazonaws.autoscaling#MetricGranularityInSeconds": {
8122+
"type": "integer",
8123+
"traits": {
8124+
"smithy.api#range": {
8125+
"min": 1
8126+
}
8127+
}
8128+
},
81158129
"com.amazonaws.autoscaling#MetricGranularityType": {
81168130
"type": "structure",
81178131
"members": {
@@ -10808,6 +10822,12 @@
1080810822
"smithy.api#documentation": "<p>A human-readable label for this metric or expression. This is especially useful if\n this is a math expression, so that you know what the value represents.</p>"
1080910823
}
1081010824
},
10825+
"Period": {
10826+
"target": "com.amazonaws.autoscaling#MetricGranularityInSeconds",
10827+
"traits": {
10828+
"smithy.api#documentation": "<p>\n The period of the metric in seconds. The default value is 60. Accepted values are 10, 30, and 60. For high resolution metric, set the value to less than 60. For more information, see\n <a href=\"https://docs.aws.amazon.com/autoscaling/ec2/userguide/policy-creating-high-resolution-metrics.html\">Create a target tracking policy using high-resolution metrics for faster response</a>.\n </p>"
10829+
}
10830+
},
1081110831
"ReturnData": {
1081210832
"target": "com.amazonaws.autoscaling#ReturnData",
1081310833
"traits": {
@@ -10843,6 +10863,12 @@
1084310863
"traits": {
1084410864
"smithy.api#documentation": "<p>The unit to use for the returned data points. For a complete list of the units that\n CloudWatch supports, see the <a href=\"https://docs.aws.amazon.com/AmazonCloudWatch/latest/APIReference/API_MetricDatum.html\">MetricDatum</a>\n data type in the <i>Amazon CloudWatch API Reference</i>.</p>"
1084510865
}
10866+
},
10867+
"Period": {
10868+
"target": "com.amazonaws.autoscaling#MetricGranularityInSeconds",
10869+
"traits": {
10870+
"smithy.api#documentation": "<p>\n The period of the metric in seconds. The default value is 60. Accepted values are 10, 30, and 60. For high resolution metric, set the value to less than 60. For more information, see\n <a href=\"https://docs.aws.amazon.com/autoscaling/ec2/userguide/policy-creating-high-resolution-metrics.html\">Create a target tracking policy using high-resolution metrics for faster response</a>.\n </p>"
10871+
}
1084610872
}
1084710873
},
1084810874
"traits": {

0 commit comments

Comments
 (0)