Skip to content

Commit

Permalink
feat(client-compute-optimizer): This release expands AWS Compute Opti…
Browse files Browse the repository at this point in the history
…mizer rightsizing recommendation support for Amazon EC2 Auto Scaling groups to include those with scaling policies and multiple instance types.
  • Loading branch information
awstools committed Jan 9, 2025
1 parent 5927fcd commit b33aa6f
Show file tree
Hide file tree
Showing 4 changed files with 106 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ export interface ExportAutoScalingGroupRecommendationsCommandOutput
* },
* ],
* fieldsToExport: [ // ExportableAutoScalingGroupFields
* "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",
* "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",
* ],
* s3DestinationConfig: { // S3DestinationConfig
* bucket: "STRING_VALUE",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,12 @@ export interface GetAutoScalingGroupRecommendationsCommandOutput
* // minSize: Number("int"),
* // maxSize: Number("int"),
* // instanceType: "STRING_VALUE",
* // allocationStrategy: "Prioritized" || "LowestPrice",
* // estimatedInstanceHourReductionPercentage: Number("double"),
* // type: "SingleInstanceType" || "MixedInstanceTypes",
* // mixedInstanceTypes: [ // MixedInstanceTypes
* // "STRING_VALUE",
* // ],
* // },
* // currentInstanceGpuInfo: { // GpuInfo
* // gpus: [ // Gpus
Expand All @@ -109,6 +115,12 @@ export interface GetAutoScalingGroupRecommendationsCommandOutput
* // minSize: Number("int"),
* // maxSize: Number("int"),
* // instanceType: "STRING_VALUE",
* // allocationStrategy: "Prioritized" || "LowestPrice",
* // estimatedInstanceHourReductionPercentage: Number("double"),
* // type: "SingleInstanceType" || "MixedInstanceTypes",
* // mixedInstanceTypes: [
* // "STRING_VALUE",
* // ],
* // },
* // instanceGpuInfo: {
* // gpus: [
Expand Down
78 changes: 73 additions & 5 deletions clients/client-compute-optimizer/src/models/models_0.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,34 @@ export interface AccountEnrollmentStatus {
lastUpdatedTimestamp?: Date | undefined;
}

/**
* @public
* @enum
*/
export const AllocationStrategy = {
LOWEST_PRICE: "LowestPrice",
PRIORITIZED: "Prioritized",
} as const;

/**
* @public
*/
export type AllocationStrategy = (typeof AllocationStrategy)[keyof typeof AllocationStrategy];

/**
* @public
* @enum
*/
export const AsgType = {
MIXED_INSTANCE_TYPE: "MixedInstanceTypes",
SINGLE_INSTANCE_TYPE: "SingleInstanceType",
} as const;

/**
* @public
*/
export type AsgType = (typeof AsgType)[keyof typeof AsgType];

/**
* @public
* @enum
Expand All @@ -87,35 +115,67 @@ export const AutoScalingConfiguration = {
export type AutoScalingConfiguration = (typeof AutoScalingConfiguration)[keyof typeof AutoScalingConfiguration];

/**
* <p>Describes the configuration of an Auto Scaling group.</p>
* <p>Describes the configuration of an EC2 Auto Scaling group.</p>
* @public
*/
export interface AutoScalingGroupConfiguration {
/**
* <p>The desired capacity, or number of instances, for the Auto Scaling group.</p>
* <p>The desired capacity, or number of instances, for the EC2 Auto Scaling group.</p>
* @public
*/
desiredCapacity?: number | undefined;

/**
* <p>The minimum size, or minimum number of instances, for the Auto Scaling
* <p>The minimum size, or minimum number of instances, for the EC2 Auto Scaling
* group.</p>
* @public
*/
minSize?: number | undefined;

/**
* <p>The maximum size, or maximum number of instances, for the Auto Scaling
* <p>The maximum size, or maximum number of instances, for the EC2 Auto Scaling
* group.</p>
* @public
*/
maxSize?: number | undefined;

/**
* <p>The instance type for the Auto Scaling group.</p>
* <p>The instance type for the EC2 Auto Scaling group.</p>
* @public
*/
instanceType?: string | undefined;

/**
* <p>
* 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.
* </p>
* @public
*/
allocationStrategy?: AllocationStrategy | undefined;

/**
* <p>
* 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.
* </p>
* @public
*/
estimatedInstanceHourReductionPercentage?: number | undefined;

/**
* <p>
* Describes whether the EC2 Auto Scaling group has a single instance type or a mixed instance type configuration.
* </p>
* @public
*/
type?: AsgType | undefined;

/**
* <p>
* List the instance types within an EC2 Auto Scaling group that has mixed instance types.
* </p>
* @public
*/
mixedInstanceTypes?: string[] | undefined;
}

/**
Expand Down Expand Up @@ -1719,10 +1779,13 @@ export const ExportableAutoScalingGroupField = {
ACCOUNT_ID: "AccountId",
AUTO_SCALING_GROUP_ARN: "AutoScalingGroupArn",
AUTO_SCALING_GROUP_NAME: "AutoScalingGroupName",
CURRENT_CONFIGURATION_ALLOCATION_STRATEGY: "CurrentConfigurationAllocationStrategy",
CURRENT_CONFIGURATION_DESIRED_CAPACITY: "CurrentConfigurationDesiredCapacity",
CURRENT_CONFIGURATION_INSTANCE_TYPE: "CurrentConfigurationInstanceType",
CURRENT_CONFIGURATION_MAX_SIZE: "CurrentConfigurationMaxSize",
CURRENT_CONFIGURATION_MIN_SIZE: "CurrentConfigurationMinSize",
CURRENT_CONFIGURATION_MIXED_INSTANCE_TYPES: "CurrentConfigurationMixedInstanceTypes",
CURRENT_CONFIGURATION_TYPE: "CurrentConfigurationType",
CURRENT_INSTANCE_GPU_INFO: "CurrentInstanceGpuInfo",
CURRENT_MEMORY: "CurrentMemory",
CURRENT_NETWORK: "CurrentNetwork",
Expand All @@ -1746,10 +1809,15 @@ export const ExportableAutoScalingGroupField = {
INFERRED_WORKLOAD_TYPES: "InferredWorkloadTypes",
LAST_REFRESH_TIMESTAMP: "LastRefreshTimestamp",
LOOKBACK_PERIOD_IN_DAYS: "LookbackPeriodInDays",
RECOMMENDATION_OPTIONS_CONFIGURATION_ALLOCATION_STRATEGY: "RecommendationOptionsConfigurationAllocationStrategy",
RECOMMENDATION_OPTIONS_CONFIGURATION_DESIRED_CAPACITY: "RecommendationOptionsConfigurationDesiredCapacity",
RECOMMENDATION_OPTIONS_CONFIGURATION_ESTIMATED_INSTANCE_HOUR_REDUCTION_PERCENTAGE:
"RecommendationOptionsConfigurationEstimatedInstanceHourReductionPercentage",
RECOMMENDATION_OPTIONS_CONFIGURATION_INSTANCE_TYPE: "RecommendationOptionsConfigurationInstanceType",
RECOMMENDATION_OPTIONS_CONFIGURATION_MAX_SIZE: "RecommendationOptionsConfigurationMaxSize",
RECOMMENDATION_OPTIONS_CONFIGURATION_MIN_SIZE: "RecommendationOptionsConfigurationMinSize",
RECOMMENDATION_OPTIONS_CONFIGURATION_MIXED_INSTANCE_TYPES: "RecommendationOptionsConfigurationMixedInstanceTypes",
RECOMMENDATION_OPTIONS_CONFIGURATION_TYPE: "RecommendationOptionsConfigurationType",
RECOMMENDATION_OPTIONS_ESTIMATED_MONTHLY_SAVINGS_CURRENCY: "RecommendationOptionsEstimatedMonthlySavingsCurrency",
RECOMMENDATION_OPTIONS_ESTIMATED_MONTHLY_SAVINGS_CURRENCY_AFTER_DISCOUNTS:
"RecommendationOptionsEstimatedMonthlySavingsCurrencyAfterDiscounts",
Expand Down
23 changes: 20 additions & 3 deletions clients/client-compute-optimizer/src/protocols/Aws_json1_0.ts
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,7 @@ import { ComputeOptimizerServiceException as __BaseException } from "../models/C
import {
AccessDeniedException,
AccountEnrollmentStatus,
AutoScalingGroupConfiguration,
AutoScalingGroupEstimatedMonthlySavings,
AutoScalingGroupRecommendation,
AutoScalingGroupRecommendationOption,
Expand Down Expand Up @@ -1608,7 +1609,21 @@ const de_AccountEnrollmentStatuses = (output: any, context: __SerdeContext): Acc
return retVal;
};

// de_AutoScalingGroupConfiguration omitted.
/**
* deserializeAws_json1_0AutoScalingGroupConfiguration
*/
const de_AutoScalingGroupConfiguration = (output: any, context: __SerdeContext): AutoScalingGroupConfiguration => {
return take(output, {
allocationStrategy: __expectString,
desiredCapacity: __expectInt32,
estimatedInstanceHourReductionPercentage: __limitedParseDouble,
instanceType: __expectString,
maxSize: __expectInt32,
minSize: __expectInt32,
mixedInstanceTypes: _json,
type: __expectString,
}) as any;
};

/**
* deserializeAws_json1_0AutoScalingGroupEstimatedMonthlySavings
Expand All @@ -1631,7 +1646,7 @@ const de_AutoScalingGroupRecommendation = (output: any, context: __SerdeContext)
accountId: __expectString,
autoScalingGroupArn: __expectString,
autoScalingGroupName: __expectString,
currentConfiguration: _json,
currentConfiguration: (_: any) => de_AutoScalingGroupConfiguration(_, context),
currentInstanceGpuInfo: _json,
currentPerformanceRisk: __expectString,
effectiveRecommendationPreferences: _json,
Expand All @@ -1652,7 +1667,7 @@ const de_AutoScalingGroupRecommendationOption = (
context: __SerdeContext
): AutoScalingGroupRecommendationOption => {
return take(output, {
configuration: _json,
configuration: (_: any) => de_AutoScalingGroupConfiguration(_, context),
instanceGpuInfo: _json,
migrationEffort: __expectString,
performanceRisk: __limitedParseDouble,
Expand Down Expand Up @@ -2667,6 +2682,8 @@ const de_MetricValues = (output: any, context: __SerdeContext): number[] => {

// de_MissingAuthenticationToken omitted.

// de_MixedInstanceTypes omitted.

// de_OptInRequiredException omitted.

// de_PlatformDifferences omitted.
Expand Down

0 comments on commit b33aa6f

Please sign in to comment.