Skip to content

Commit b33aa6f

Browse files
author
awstools
committed
feat(client-compute-optimizer): This release expands AWS Compute Optimizer rightsizing recommendation support for Amazon EC2 Auto Scaling groups to include those with scaling policies and multiple instance types.
1 parent 5927fcd commit b33aa6f

File tree

4 files changed

+106
-9
lines changed

4 files changed

+106
-9
lines changed

clients/client-compute-optimizer/src/commands/ExportAutoScalingGroupRecommendationsCommand.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ export interface ExportAutoScalingGroupRecommendationsCommandOutput
6262
* },
6363
* ],
6464
* fieldsToExport: [ // ExportableAutoScalingGroupFields
65-
* "AccountId" || "AutoScalingGroupArn" || "AutoScalingGroupName" || "Finding" || "UtilizationMetricsCpuMaximum" || "UtilizationMetricsMemoryMaximum" || "UtilizationMetricsEbsReadOpsPerSecondMaximum" || "UtilizationMetricsEbsWriteOpsPerSecondMaximum" || "UtilizationMetricsEbsReadBytesPerSecondMaximum" || "UtilizationMetricsEbsWriteBytesPerSecondMaximum" || "UtilizationMetricsDiskReadOpsPerSecondMaximum" || "UtilizationMetricsDiskWriteOpsPerSecondMaximum" || "UtilizationMetricsDiskReadBytesPerSecondMaximum" || "UtilizationMetricsDiskWriteBytesPerSecondMaximum" || "UtilizationMetricsNetworkInBytesPerSecondMaximum" || "UtilizationMetricsNetworkOutBytesPerSecondMaximum" || "UtilizationMetricsNetworkPacketsInPerSecondMaximum" || "UtilizationMetricsNetworkPacketsOutPerSecondMaximum" || "LookbackPeriodInDays" || "CurrentConfigurationInstanceType" || "CurrentConfigurationDesiredCapacity" || "CurrentConfigurationMinSize" || "CurrentConfigurationMaxSize" || "CurrentOnDemandPrice" || "CurrentStandardOneYearNoUpfrontReservedPrice" || "CurrentStandardThreeYearNoUpfrontReservedPrice" || "CurrentVCpus" || "CurrentMemory" || "CurrentStorage" || "CurrentNetwork" || "RecommendationOptionsConfigurationInstanceType" || "RecommendationOptionsConfigurationDesiredCapacity" || "RecommendationOptionsConfigurationMinSize" || "RecommendationOptionsConfigurationMaxSize" || "RecommendationOptionsProjectedUtilizationMetricsCpuMaximum" || "RecommendationOptionsProjectedUtilizationMetricsMemoryMaximum" || "RecommendationOptionsPerformanceRisk" || "RecommendationOptionsOnDemandPrice" || "RecommendationOptionsStandardOneYearNoUpfrontReservedPrice" || "RecommendationOptionsStandardThreeYearNoUpfrontReservedPrice" || "RecommendationOptionsVcpus" || "RecommendationOptionsMemory" || "RecommendationOptionsStorage" || "RecommendationOptionsNetwork" || "LastRefreshTimestamp" || "CurrentPerformanceRisk" || "RecommendationOptionsSavingsOpportunityPercentage" || "RecommendationOptionsEstimatedMonthlySavingsCurrency" || "RecommendationOptionsEstimatedMonthlySavingsValue" || "EffectiveRecommendationPreferencesCpuVendorArchitectures" || "EffectiveRecommendationPreferencesEnhancedInfrastructureMetrics" || "EffectiveRecommendationPreferencesInferredWorkloadTypes" || "EffectiveRecommendationPreferencesPreferredResources" || "EffectiveRecommendationPreferencesLookBackPeriod" || "InferredWorkloadTypes" || "RecommendationOptionsMigrationEffort" || "CurrentInstanceGpuInfo" || "RecommendationOptionsInstanceGpuInfo" || "UtilizationMetricsGpuPercentageMaximum" || "UtilizationMetricsGpuMemoryPercentageMaximum" || "RecommendationOptionsProjectedUtilizationMetricsGpuPercentageMaximum" || "RecommendationOptionsProjectedUtilizationMetricsGpuMemoryPercentageMaximum" || "EffectiveRecommendationPreferencesSavingsEstimationMode" || "RecommendationOptionsSavingsOpportunityAfterDiscountsPercentage" || "RecommendationOptionsEstimatedMonthlySavingsCurrencyAfterDiscounts" || "RecommendationOptionsEstimatedMonthlySavingsValueAfterDiscounts",
65+
* "AccountId" || "AutoScalingGroupArn" || "AutoScalingGroupName" || "Finding" || "UtilizationMetricsCpuMaximum" || "UtilizationMetricsMemoryMaximum" || "UtilizationMetricsEbsReadOpsPerSecondMaximum" || "UtilizationMetricsEbsWriteOpsPerSecondMaximum" || "UtilizationMetricsEbsReadBytesPerSecondMaximum" || "UtilizationMetricsEbsWriteBytesPerSecondMaximum" || "UtilizationMetricsDiskReadOpsPerSecondMaximum" || "UtilizationMetricsDiskWriteOpsPerSecondMaximum" || "UtilizationMetricsDiskReadBytesPerSecondMaximum" || "UtilizationMetricsDiskWriteBytesPerSecondMaximum" || "UtilizationMetricsNetworkInBytesPerSecondMaximum" || "UtilizationMetricsNetworkOutBytesPerSecondMaximum" || "UtilizationMetricsNetworkPacketsInPerSecondMaximum" || "UtilizationMetricsNetworkPacketsOutPerSecondMaximum" || "LookbackPeriodInDays" || "CurrentConfigurationInstanceType" || "CurrentConfigurationDesiredCapacity" || "CurrentConfigurationMinSize" || "CurrentConfigurationMaxSize" || "CurrentConfigurationAllocationStrategy" || "CurrentConfigurationMixedInstanceTypes" || "CurrentConfigurationType" || "CurrentOnDemandPrice" || "CurrentStandardOneYearNoUpfrontReservedPrice" || "CurrentStandardThreeYearNoUpfrontReservedPrice" || "CurrentVCpus" || "CurrentMemory" || "CurrentStorage" || "CurrentNetwork" || "RecommendationOptionsConfigurationInstanceType" || "RecommendationOptionsConfigurationDesiredCapacity" || "RecommendationOptionsConfigurationMinSize" || "RecommendationOptionsConfigurationMaxSize" || "RecommendationOptionsConfigurationEstimatedInstanceHourReductionPercentage" || "RecommendationOptionsConfigurationAllocationStrategy" || "RecommendationOptionsConfigurationMixedInstanceTypes" || "RecommendationOptionsConfigurationType" || "RecommendationOptionsProjectedUtilizationMetricsCpuMaximum" || "RecommendationOptionsProjectedUtilizationMetricsMemoryMaximum" || "RecommendationOptionsPerformanceRisk" || "RecommendationOptionsOnDemandPrice" || "RecommendationOptionsStandardOneYearNoUpfrontReservedPrice" || "RecommendationOptionsStandardThreeYearNoUpfrontReservedPrice" || "RecommendationOptionsVcpus" || "RecommendationOptionsMemory" || "RecommendationOptionsStorage" || "RecommendationOptionsNetwork" || "LastRefreshTimestamp" || "CurrentPerformanceRisk" || "RecommendationOptionsSavingsOpportunityPercentage" || "RecommendationOptionsEstimatedMonthlySavingsCurrency" || "RecommendationOptionsEstimatedMonthlySavingsValue" || "EffectiveRecommendationPreferencesCpuVendorArchitectures" || "EffectiveRecommendationPreferencesEnhancedInfrastructureMetrics" || "EffectiveRecommendationPreferencesInferredWorkloadTypes" || "EffectiveRecommendationPreferencesPreferredResources" || "EffectiveRecommendationPreferencesLookBackPeriod" || "InferredWorkloadTypes" || "RecommendationOptionsMigrationEffort" || "CurrentInstanceGpuInfo" || "RecommendationOptionsInstanceGpuInfo" || "UtilizationMetricsGpuPercentageMaximum" || "UtilizationMetricsGpuMemoryPercentageMaximum" || "RecommendationOptionsProjectedUtilizationMetricsGpuPercentageMaximum" || "RecommendationOptionsProjectedUtilizationMetricsGpuMemoryPercentageMaximum" || "EffectiveRecommendationPreferencesSavingsEstimationMode" || "RecommendationOptionsSavingsOpportunityAfterDiscountsPercentage" || "RecommendationOptionsEstimatedMonthlySavingsCurrencyAfterDiscounts" || "RecommendationOptionsEstimatedMonthlySavingsValueAfterDiscounts",
6666
* ],
6767
* s3DestinationConfig: { // S3DestinationConfig
6868
* bucket: "STRING_VALUE",

clients/client-compute-optimizer/src/commands/GetAutoScalingGroupRecommendationsCommand.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,12 @@ export interface GetAutoScalingGroupRecommendationsCommandOutput
9393
* // minSize: Number("int"),
9494
* // maxSize: Number("int"),
9595
* // instanceType: "STRING_VALUE",
96+
* // allocationStrategy: "Prioritized" || "LowestPrice",
97+
* // estimatedInstanceHourReductionPercentage: Number("double"),
98+
* // type: "SingleInstanceType" || "MixedInstanceTypes",
99+
* // mixedInstanceTypes: [ // MixedInstanceTypes
100+
* // "STRING_VALUE",
101+
* // ],
96102
* // },
97103
* // currentInstanceGpuInfo: { // GpuInfo
98104
* // gpus: [ // Gpus
@@ -109,6 +115,12 @@ export interface GetAutoScalingGroupRecommendationsCommandOutput
109115
* // minSize: Number("int"),
110116
* // maxSize: Number("int"),
111117
* // instanceType: "STRING_VALUE",
118+
* // allocationStrategy: "Prioritized" || "LowestPrice",
119+
* // estimatedInstanceHourReductionPercentage: Number("double"),
120+
* // type: "SingleInstanceType" || "MixedInstanceTypes",
121+
* // mixedInstanceTypes: [
122+
* // "STRING_VALUE",
123+
* // ],
112124
* // },
113125
* // instanceGpuInfo: {
114126
* // gpus: [

clients/client-compute-optimizer/src/models/models_0.ts

Lines changed: 73 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,34 @@ export interface AccountEnrollmentStatus {
7272
lastUpdatedTimestamp?: Date | undefined;
7373
}
7474

75+
/**
76+
* @public
77+
* @enum
78+
*/
79+
export const AllocationStrategy = {
80+
LOWEST_PRICE: "LowestPrice",
81+
PRIORITIZED: "Prioritized",
82+
} as const;
83+
84+
/**
85+
* @public
86+
*/
87+
export type AllocationStrategy = (typeof AllocationStrategy)[keyof typeof AllocationStrategy];
88+
89+
/**
90+
* @public
91+
* @enum
92+
*/
93+
export const AsgType = {
94+
MIXED_INSTANCE_TYPE: "MixedInstanceTypes",
95+
SINGLE_INSTANCE_TYPE: "SingleInstanceType",
96+
} as const;
97+
98+
/**
99+
* @public
100+
*/
101+
export type AsgType = (typeof AsgType)[keyof typeof AsgType];
102+
75103
/**
76104
* @public
77105
* @enum
@@ -87,35 +115,67 @@ export const AutoScalingConfiguration = {
87115
export type AutoScalingConfiguration = (typeof AutoScalingConfiguration)[keyof typeof AutoScalingConfiguration];
88116

89117
/**
90-
* <p>Describes the configuration of an Auto Scaling group.</p>
118+
* <p>Describes the configuration of an EC2 Auto Scaling group.</p>
91119
* @public
92120
*/
93121
export interface AutoScalingGroupConfiguration {
94122
/**
95-
* <p>The desired capacity, or number of instances, for the Auto Scaling group.</p>
123+
* <p>The desired capacity, or number of instances, for the EC2 Auto Scaling group.</p>
96124
* @public
97125
*/
98126
desiredCapacity?: number | undefined;
99127

100128
/**
101-
* <p>The minimum size, or minimum number of instances, for the Auto Scaling
129+
* <p>The minimum size, or minimum number of instances, for the EC2 Auto Scaling
102130
* group.</p>
103131
* @public
104132
*/
105133
minSize?: number | undefined;
106134

107135
/**
108-
* <p>The maximum size, or maximum number of instances, for the Auto Scaling
136+
* <p>The maximum size, or maximum number of instances, for the EC2 Auto Scaling
109137
* group.</p>
110138
* @public
111139
*/
112140
maxSize?: number | undefined;
113141

114142
/**
115-
* <p>The instance type for the Auto Scaling group.</p>
143+
* <p>The instance type for the EC2 Auto Scaling group.</p>
116144
* @public
117145
*/
118146
instanceType?: string | undefined;
147+
148+
/**
149+
* <p>
150+
* Describes the allocation strategy that the EC2 Auto Scaling group uses. This field is only available for EC2 Auto Scaling groups with mixed instance types.
151+
* </p>
152+
* @public
153+
*/
154+
allocationStrategy?: AllocationStrategy | undefined;
155+
156+
/**
157+
* <p>
158+
* Describes the projected percentage reduction in instance hours after adopting the recommended configuration. This field is only available for EC2 Auto Scaling groups with scaling policies.
159+
* </p>
160+
* @public
161+
*/
162+
estimatedInstanceHourReductionPercentage?: number | undefined;
163+
164+
/**
165+
* <p>
166+
* Describes whether the EC2 Auto Scaling group has a single instance type or a mixed instance type configuration.
167+
* </p>
168+
* @public
169+
*/
170+
type?: AsgType | undefined;
171+
172+
/**
173+
* <p>
174+
* List the instance types within an EC2 Auto Scaling group that has mixed instance types.
175+
* </p>
176+
* @public
177+
*/
178+
mixedInstanceTypes?: string[] | undefined;
119179
}
120180

121181
/**
@@ -1719,10 +1779,13 @@ export const ExportableAutoScalingGroupField = {
17191779
ACCOUNT_ID: "AccountId",
17201780
AUTO_SCALING_GROUP_ARN: "AutoScalingGroupArn",
17211781
AUTO_SCALING_GROUP_NAME: "AutoScalingGroupName",
1782+
CURRENT_CONFIGURATION_ALLOCATION_STRATEGY: "CurrentConfigurationAllocationStrategy",
17221783
CURRENT_CONFIGURATION_DESIRED_CAPACITY: "CurrentConfigurationDesiredCapacity",
17231784
CURRENT_CONFIGURATION_INSTANCE_TYPE: "CurrentConfigurationInstanceType",
17241785
CURRENT_CONFIGURATION_MAX_SIZE: "CurrentConfigurationMaxSize",
17251786
CURRENT_CONFIGURATION_MIN_SIZE: "CurrentConfigurationMinSize",
1787+
CURRENT_CONFIGURATION_MIXED_INSTANCE_TYPES: "CurrentConfigurationMixedInstanceTypes",
1788+
CURRENT_CONFIGURATION_TYPE: "CurrentConfigurationType",
17261789
CURRENT_INSTANCE_GPU_INFO: "CurrentInstanceGpuInfo",
17271790
CURRENT_MEMORY: "CurrentMemory",
17281791
CURRENT_NETWORK: "CurrentNetwork",
@@ -1746,10 +1809,15 @@ export const ExportableAutoScalingGroupField = {
17461809
INFERRED_WORKLOAD_TYPES: "InferredWorkloadTypes",
17471810
LAST_REFRESH_TIMESTAMP: "LastRefreshTimestamp",
17481811
LOOKBACK_PERIOD_IN_DAYS: "LookbackPeriodInDays",
1812+
RECOMMENDATION_OPTIONS_CONFIGURATION_ALLOCATION_STRATEGY: "RecommendationOptionsConfigurationAllocationStrategy",
17491813
RECOMMENDATION_OPTIONS_CONFIGURATION_DESIRED_CAPACITY: "RecommendationOptionsConfigurationDesiredCapacity",
1814+
RECOMMENDATION_OPTIONS_CONFIGURATION_ESTIMATED_INSTANCE_HOUR_REDUCTION_PERCENTAGE:
1815+
"RecommendationOptionsConfigurationEstimatedInstanceHourReductionPercentage",
17501816
RECOMMENDATION_OPTIONS_CONFIGURATION_INSTANCE_TYPE: "RecommendationOptionsConfigurationInstanceType",
17511817
RECOMMENDATION_OPTIONS_CONFIGURATION_MAX_SIZE: "RecommendationOptionsConfigurationMaxSize",
17521818
RECOMMENDATION_OPTIONS_CONFIGURATION_MIN_SIZE: "RecommendationOptionsConfigurationMinSize",
1819+
RECOMMENDATION_OPTIONS_CONFIGURATION_MIXED_INSTANCE_TYPES: "RecommendationOptionsConfigurationMixedInstanceTypes",
1820+
RECOMMENDATION_OPTIONS_CONFIGURATION_TYPE: "RecommendationOptionsConfigurationType",
17531821
RECOMMENDATION_OPTIONS_ESTIMATED_MONTHLY_SAVINGS_CURRENCY: "RecommendationOptionsEstimatedMonthlySavingsCurrency",
17541822
RECOMMENDATION_OPTIONS_ESTIMATED_MONTHLY_SAVINGS_CURRENCY_AFTER_DISCOUNTS:
17551823
"RecommendationOptionsEstimatedMonthlySavingsCurrencyAfterDiscounts",

clients/client-compute-optimizer/src/protocols/Aws_json1_0.ts

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,7 @@ import { ComputeOptimizerServiceException as __BaseException } from "../models/C
139139
import {
140140
AccessDeniedException,
141141
AccountEnrollmentStatus,
142+
AutoScalingGroupConfiguration,
142143
AutoScalingGroupEstimatedMonthlySavings,
143144
AutoScalingGroupRecommendation,
144145
AutoScalingGroupRecommendationOption,
@@ -1608,7 +1609,21 @@ const de_AccountEnrollmentStatuses = (output: any, context: __SerdeContext): Acc
16081609
return retVal;
16091610
};
16101611

1611-
// de_AutoScalingGroupConfiguration omitted.
1612+
/**
1613+
* deserializeAws_json1_0AutoScalingGroupConfiguration
1614+
*/
1615+
const de_AutoScalingGroupConfiguration = (output: any, context: __SerdeContext): AutoScalingGroupConfiguration => {
1616+
return take(output, {
1617+
allocationStrategy: __expectString,
1618+
desiredCapacity: __expectInt32,
1619+
estimatedInstanceHourReductionPercentage: __limitedParseDouble,
1620+
instanceType: __expectString,
1621+
maxSize: __expectInt32,
1622+
minSize: __expectInt32,
1623+
mixedInstanceTypes: _json,
1624+
type: __expectString,
1625+
}) as any;
1626+
};
16121627

16131628
/**
16141629
* deserializeAws_json1_0AutoScalingGroupEstimatedMonthlySavings
@@ -1631,7 +1646,7 @@ const de_AutoScalingGroupRecommendation = (output: any, context: __SerdeContext)
16311646
accountId: __expectString,
16321647
autoScalingGroupArn: __expectString,
16331648
autoScalingGroupName: __expectString,
1634-
currentConfiguration: _json,
1649+
currentConfiguration: (_: any) => de_AutoScalingGroupConfiguration(_, context),
16351650
currentInstanceGpuInfo: _json,
16361651
currentPerformanceRisk: __expectString,
16371652
effectiveRecommendationPreferences: _json,
@@ -1652,7 +1667,7 @@ const de_AutoScalingGroupRecommendationOption = (
16521667
context: __SerdeContext
16531668
): AutoScalingGroupRecommendationOption => {
16541669
return take(output, {
1655-
configuration: _json,
1670+
configuration: (_: any) => de_AutoScalingGroupConfiguration(_, context),
16561671
instanceGpuInfo: _json,
16571672
migrationEffort: __expectString,
16581673
performanceRisk: __limitedParseDouble,
@@ -2667,6 +2682,8 @@ const de_MetricValues = (output: any, context: __SerdeContext): number[] => {
26672682

26682683
// de_MissingAuthenticationToken omitted.
26692684

2685+
// de_MixedInstanceTypes omitted.
2686+
26702687
// de_OptInRequiredException omitted.
26712688

26722689
// de_PlatformDifferences omitted.

0 commit comments

Comments
 (0)