Skip to content

Commit b676a24

Browse files
This release enables AWS Cost Optimization Hub to show cost optimization recommendations for Amazon Auto Scaling Groups, including those with single and mixed instance types.
1 parent 1253d04 commit b676a24

10 files changed

+444
-18
lines changed

generator/ServiceModels/cost-optimization-hub/cost-optimization-hub-2022-07-26.api.json

Lines changed: 30 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,8 @@
163163
"PurchaseSavingsPlans",
164164
"PurchaseReservedInstances",
165165
"MigrateToGraviton",
166-
"Delete"
166+
"Delete",
167+
"ScaleIn"
167168
]
168169
},
169170
"ActionTypeList":{
@@ -172,6 +173,13 @@
172173
"max":100,
173174
"min":1
174175
},
176+
"AllocationStrategy":{
177+
"type":"string",
178+
"enum":[
179+
"Prioritized",
180+
"LowestPrice"
181+
]
182+
},
175183
"BlockStoragePerformanceConfiguration":{
176184
"type":"structure",
177185
"members":{
@@ -244,9 +252,19 @@
244252
"Ec2AutoScalingGroupConfiguration":{
245253
"type":"structure",
246254
"members":{
247-
"instance":{"shape":"InstanceConfiguration"}
255+
"instance":{"shape":"InstanceConfiguration"},
256+
"mixedInstances":{"shape":"MixedInstanceConfigurationList"},
257+
"type":{"shape":"Ec2AutoScalingGroupType"},
258+
"allocationStrategy":{"shape":"AllocationStrategy"}
248259
}
249260
},
261+
"Ec2AutoScalingGroupType":{
262+
"type":"string",
263+
"enum":[
264+
"SingleInstanceType",
265+
"MixedInstanceTypes"
266+
]
267+
},
250268
"Ec2Instance":{
251269
"type":"structure",
252270
"members":{
@@ -551,6 +569,16 @@
551569
"None"
552570
]
553571
},
572+
"MixedInstanceConfiguration":{
573+
"type":"structure",
574+
"members":{
575+
"type":{"shape":"String"}
576+
}
577+
},
578+
"MixedInstanceConfigurationList":{
579+
"type":"list",
580+
"member":{"shape":"MixedInstanceConfiguration"}
581+
},
554582
"OpenSearchReservedInstances":{
555583
"type":"structure",
556584
"members":{

generator/ServiceModels/cost-optimization-hub/cost-optimization-hub-2022-07-26.docs.json

Lines changed: 30 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,12 @@
5555
"Filter$actionTypes": "<p>The type of action you can take by adopting the recommendation.</p>"
5656
}
5757
},
58+
"AllocationStrategy": {
59+
"base": null,
60+
"refs": {
61+
"Ec2AutoScalingGroupConfiguration$allocationStrategy": "<p>The strategy used for allocating instances, based on a predefined priority order or based on the lowest available price.</p>"
62+
}
63+
},
5864
"BlockStoragePerformanceConfiguration": {
5965
"base": "<p>Describes the Amazon Elastic Block Store performance configuration of the current and recommended resource configuration for a recommendation.</p>",
6066
"refs": {
@@ -166,11 +172,17 @@
166172
}
167173
},
168174
"Ec2AutoScalingGroupConfiguration": {
169-
"base": "<p>The EC2 auto scaling group configuration used for recommendations.</p>",
175+
"base": "<p>The EC2 Auto Scaling group configuration used for recommendations.</p>",
170176
"refs": {
171177
"Ec2AutoScalingGroup$configuration": "<p>The EC2 Auto Scaling group configuration used for recommendations.</p>"
172178
}
173179
},
180+
"Ec2AutoScalingGroupType": {
181+
"base": null,
182+
"refs": {
183+
"Ec2AutoScalingGroupConfiguration$type": "<p>The type of EC2 Auto Scaling group, showing whether it consists of a single instance type or mixed instance types.</p>"
184+
}
185+
},
174186
"Ec2Instance": {
175187
"base": "<p>Describes the EC2 instance configuration of the current and recommended resource configuration for a recommendation.</p>",
176188
"refs": {
@@ -285,9 +297,9 @@
285297
}
286298
},
287299
"InstanceConfiguration": {
288-
"base": "<p>The Instance configuration used for recommendations.</p>",
300+
"base": "<p>The instance configuration used for recommendations.</p>",
289301
"refs": {
290-
"Ec2AutoScalingGroupConfiguration$instance": "<p>Details about the instance.</p>",
302+
"Ec2AutoScalingGroupConfiguration$instance": "<p>Details about the instance for the EC2 Auto Scaling group with a single instance type.</p>",
291303
"Ec2InstanceConfiguration$instance": "<p>Details about the instance.</p>"
292304
}
293305
},
@@ -374,6 +386,18 @@
374386
"UpdatePreferencesResponse$memberAccountDiscountVisibility": "<p>Shows the status of the \"member account discount visibility\" preference.</p>"
375387
}
376388
},
389+
"MixedInstanceConfiguration": {
390+
"base": "<p>The configuration for the EC2 Auto Scaling group with mixed instance types.</p>",
391+
"refs": {
392+
"MixedInstanceConfigurationList$member": null
393+
}
394+
},
395+
"MixedInstanceConfigurationList": {
396+
"base": null,
397+
"refs": {
398+
"Ec2AutoScalingGroupConfiguration$mixedInstances": "<p>A list of instance types for an EC2 Auto Scaling group with mixed instance types.</p>"
399+
}
400+
},
377401
"OpenSearchReservedInstances": {
378402
"base": "<p>The OpenSearch reserved instances recommendation details.</p>",
379403
"refs": {
@@ -564,7 +588,7 @@
564588
"SageMakerSavingsPlans": {
565589
"base": "<p>The SageMaker Savings Plans recommendation details.</p>",
566590
"refs": {
567-
"ResourceDetails$sageMakerSavingsPlans": "<p>The SageMaker Savings Plans recommendation details.</p>"
591+
"ResourceDetails$sageMakerSavingsPlans": "<p>The SageMaker AI Savings Plans recommendation details.</p>"
568592
}
569593
},
570594
"SageMakerSavingsPlansConfiguration": {
@@ -660,7 +684,7 @@
660684
"GetRecommendationResponse$accountId": "<p>The account that the recommendation is for.</p>",
661685
"GetRecommendationResponse$currencyCode": "<p>The currency code used for the recommendation.</p>",
662686
"GetRecommendationResponse$region": "<p>The Amazon Web Services Region of the resource.</p>",
663-
"InstanceConfiguration$type": "<p>Details about the type.</p>",
687+
"InstanceConfiguration$type": "<p>The instance type of the configuration.</p>",
664688
"InternalServerException$message": null,
665689
"ListEnrollmentStatusesRequest$nextToken": "<p>The token to retrieve the next set of results.</p>",
666690
"ListEnrollmentStatusesResponse$nextToken": "<p>The token to retrieve the next set of results.</p>",
@@ -671,6 +695,7 @@
671695
"ListRecommendationSummariesResponse$nextToken": "<p>The token to retrieve the next set of results.</p>",
672696
"ListRecommendationsRequest$nextToken": "<p>The token to retrieve the next set of results.</p>",
673697
"ListRecommendationsResponse$nextToken": "<p>The token to retrieve the next set of results.</p>",
698+
"MixedInstanceConfiguration$type": "<p>The instance type of the configuration.</p>",
674699
"OpenSearchReservedInstancesConfiguration$accountScope": "<p>The account scope that you want your recommendations for.</p>",
675700
"OpenSearchReservedInstancesConfiguration$service": "<p>The service that you want your recommendations for.</p>",
676701
"OpenSearchReservedInstancesConfiguration$normalizedUnitsToPurchase": "<p>The number of normalized units that Amazon Web Services recommends that you purchase.</p>",

generator/ServiceModels/cost-optimization-hub/cost-optimization-hub-2022-07-26.normal.json

Lines changed: 47 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,8 @@
184184
"PurchaseSavingsPlans",
185185
"PurchaseReservedInstances",
186186
"MigrateToGraviton",
187-
"Delete"
187+
"Delete",
188+
"ScaleIn"
188189
]
189190
},
190191
"ActionTypeList":{
@@ -193,6 +194,13 @@
193194
"max":100,
194195
"min":1
195196
},
197+
"AllocationStrategy":{
198+
"type":"string",
199+
"enum":[
200+
"Prioritized",
201+
"LowestPrice"
202+
]
203+
},
196204
"BlockStoragePerformanceConfiguration":{
197205
"type":"structure",
198206
"members":{
@@ -335,10 +343,29 @@
335343
"members":{
336344
"instance":{
337345
"shape":"InstanceConfiguration",
338-
"documentation":"<p>Details about the instance.</p>"
346+
"documentation":"<p>Details about the instance for the EC2 Auto Scaling group with a single instance type.</p>"
347+
},
348+
"mixedInstances":{
349+
"shape":"MixedInstanceConfigurationList",
350+
"documentation":"<p>A list of instance types for an EC2 Auto Scaling group with mixed instance types.</p>"
351+
},
352+
"type":{
353+
"shape":"Ec2AutoScalingGroupType",
354+
"documentation":"<p>The type of EC2 Auto Scaling group, showing whether it consists of a single instance type or mixed instance types.</p>"
355+
},
356+
"allocationStrategy":{
357+
"shape":"AllocationStrategy",
358+
"documentation":"<p>The strategy used for allocating instances, based on a predefined priority order or based on the lowest available price.</p>"
339359
}
340360
},
341-
"documentation":"<p>The EC2 auto scaling group configuration used for recommendations.</p>"
361+
"documentation":"<p>The EC2 Auto Scaling group configuration used for recommendations.</p>"
362+
},
363+
"Ec2AutoScalingGroupType":{
364+
"type":"string",
365+
"enum":[
366+
"SingleInstanceType",
367+
"MixedInstanceTypes"
368+
]
342369
},
343370
"Ec2Instance":{
344371
"type":"structure",
@@ -809,10 +836,10 @@
809836
"members":{
810837
"type":{
811838
"shape":"String",
812-
"documentation":"<p>Details about the type.</p>"
839+
"documentation":"<p>The instance type of the configuration.</p>"
813840
}
814841
},
815-
"documentation":"<p>The Instance configuration used for recommendations.</p>"
842+
"documentation":"<p>The instance configuration used for recommendations.</p>"
816843
},
817844
"Integer":{
818845
"type":"integer",
@@ -1005,6 +1032,20 @@
10051032
"None"
10061033
]
10071034
},
1035+
"MixedInstanceConfiguration":{
1036+
"type":"structure",
1037+
"members":{
1038+
"type":{
1039+
"shape":"String",
1040+
"documentation":"<p>The instance type of the configuration.</p>"
1041+
}
1042+
},
1043+
"documentation":"<p>The configuration for the EC2 Auto Scaling group with mixed instance types.</p>"
1044+
},
1045+
"MixedInstanceConfigurationList":{
1046+
"type":"list",
1047+
"member":{"shape":"MixedInstanceConfiguration"}
1048+
},
10081049
"OpenSearchReservedInstances":{
10091050
"type":"structure",
10101051
"members":{
@@ -1542,7 +1583,7 @@
15421583
},
15431584
"sageMakerSavingsPlans":{
15441585
"shape":"SageMakerSavingsPlans",
1545-
"documentation":"<p>The SageMaker Savings Plans recommendation details.</p>"
1586+
"documentation":"<p>The SageMaker AI Savings Plans recommendation details.</p>"
15461587
},
15471588
"rdsDbInstance":{
15481589
"shape":"RdsDbInstance",

sdk/src/Services/CostOptimizationHub/Generated/Model/Ec2AutoScalingGroupConfiguration.cs

Lines changed: 61 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,16 +30,38 @@
3030
namespace Amazon.CostOptimizationHub.Model
3131
{
3232
/// <summary>
33-
/// The EC2 auto scaling group configuration used for recommendations.
33+
/// The EC2 Auto Scaling group configuration used for recommendations.
3434
/// </summary>
3535
public partial class Ec2AutoScalingGroupConfiguration
3636
{
37+
private AllocationStrategy _allocationStrategy;
3738
private InstanceConfiguration _instance;
39+
private List<MixedInstanceConfiguration> _mixedInstances = AWSConfigs.InitializeCollections ? new List<MixedInstanceConfiguration>() : null;
40+
private Ec2AutoScalingGroupType _type;
41+
42+
/// <summary>
43+
/// Gets and sets the property AllocationStrategy.
44+
/// <para>
45+
/// The strategy used for allocating instances, based on a predefined priority order or
46+
/// based on the lowest available price.
47+
/// </para>
48+
/// </summary>
49+
public AllocationStrategy AllocationStrategy
50+
{
51+
get { return this._allocationStrategy; }
52+
set { this._allocationStrategy = value; }
53+
}
54+
55+
// Check to see if AllocationStrategy property is set
56+
internal bool IsSetAllocationStrategy()
57+
{
58+
return this._allocationStrategy != null;
59+
}
3860

3961
/// <summary>
4062
/// Gets and sets the property Instance.
4163
/// <para>
42-
/// Details about the instance.
64+
/// Details about the instance for the EC2 Auto Scaling group with a single instance type.
4365
/// </para>
4466
/// </summary>
4567
public InstanceConfiguration Instance
@@ -54,5 +76,42 @@ internal bool IsSetInstance()
5476
return this._instance != null;
5577
}
5678

79+
/// <summary>
80+
/// Gets and sets the property MixedInstances.
81+
/// <para>
82+
/// A list of instance types for an EC2 Auto Scaling group with mixed instance types.
83+
/// </para>
84+
/// </summary>
85+
public List<MixedInstanceConfiguration> MixedInstances
86+
{
87+
get { return this._mixedInstances; }
88+
set { this._mixedInstances = value; }
89+
}
90+
91+
// Check to see if MixedInstances property is set
92+
internal bool IsSetMixedInstances()
93+
{
94+
return this._mixedInstances != null && (this._mixedInstances.Count > 0 || !AWSConfigs.InitializeCollections);
95+
}
96+
97+
/// <summary>
98+
/// Gets and sets the property Type.
99+
/// <para>
100+
/// The type of EC2 Auto Scaling group, showing whether it consists of a single instance
101+
/// type or mixed instance types.
102+
/// </para>
103+
/// </summary>
104+
public Ec2AutoScalingGroupType Type
105+
{
106+
get { return this._type; }
107+
set { this._type = value; }
108+
}
109+
110+
// Check to see if Type property is set
111+
internal bool IsSetType()
112+
{
113+
return this._type != null;
114+
}
115+
57116
}
58117
}

sdk/src/Services/CostOptimizationHub/Generated/Model/InstanceConfiguration.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
namespace Amazon.CostOptimizationHub.Model
3131
{
3232
/// <summary>
33-
/// The Instance configuration used for recommendations.
33+
/// The instance configuration used for recommendations.
3434
/// </summary>
3535
public partial class InstanceConfiguration
3636
{
@@ -39,7 +39,7 @@ public partial class InstanceConfiguration
3939
/// <summary>
4040
/// Gets and sets the property Type.
4141
/// <para>
42-
/// Details about the type.
42+
/// The instance type of the configuration.
4343
/// </para>
4444
/// </summary>
4545
public string Type

sdk/src/Services/CostOptimizationHub/Generated/Model/Internal/MarshallTransformations/Ec2AutoScalingGroupConfigurationUnmarshaller.cs

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,12 +66,30 @@ public Ec2AutoScalingGroupConfiguration Unmarshall(JsonUnmarshallerContext conte
6666
int targetDepth = context.CurrentDepth;
6767
while (context.ReadAtDepth(targetDepth))
6868
{
69+
if (context.TestExpression("allocationStrategy", targetDepth))
70+
{
71+
var unmarshaller = StringUnmarshaller.Instance;
72+
unmarshalledObject.AllocationStrategy = unmarshaller.Unmarshall(context);
73+
continue;
74+
}
6975
if (context.TestExpression("instance", targetDepth))
7076
{
7177
var unmarshaller = InstanceConfigurationUnmarshaller.Instance;
7278
unmarshalledObject.Instance = unmarshaller.Unmarshall(context);
7379
continue;
7480
}
81+
if (context.TestExpression("mixedInstances", targetDepth))
82+
{
83+
var unmarshaller = new ListUnmarshaller<MixedInstanceConfiguration, MixedInstanceConfigurationUnmarshaller>(MixedInstanceConfigurationUnmarshaller.Instance);
84+
unmarshalledObject.MixedInstances = unmarshaller.Unmarshall(context);
85+
continue;
86+
}
87+
if (context.TestExpression("type", targetDepth))
88+
{
89+
var unmarshaller = StringUnmarshaller.Instance;
90+
unmarshalledObject.Type = unmarshaller.Unmarshall(context);
91+
continue;
92+
}
7593
}
7694
return unmarshalledObject;
7795
}

0 commit comments

Comments
 (0)