Skip to content

Commit 08e6500

Browse files
author
awstools
committed
feat(client-cost-optimization-hub): This release enables AWS Cost Optimization Hub to show cost optimization recommendations for NAT Gateway.
1 parent 550987c commit 08e6500

File tree

7 files changed

+207
-5
lines changed

7 files changed

+207
-5
lines changed

clients/client-cost-optimization-hub/src/commands/GetRecommendationCommand.ts

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,8 @@ export interface GetRecommendationCommandOutput extends GetRecommendationRespons
5555
* // costCalculationLookbackPeriodInDays: Number("int"),
5656
* // estimatedSavingsPercentage: Number("double"),
5757
* // estimatedSavingsOverCostCalculationLookbackPeriod: Number("double"),
58-
* // currentResourceType: "Ec2Instance" || "LambdaFunction" || "EbsVolume" || "EcsService" || "Ec2AutoScalingGroup" || "Ec2InstanceSavingsPlans" || "ComputeSavingsPlans" || "SageMakerSavingsPlans" || "Ec2ReservedInstances" || "RdsReservedInstances" || "OpenSearchReservedInstances" || "RedshiftReservedInstances" || "ElastiCacheReservedInstances" || "RdsDbInstanceStorage" || "RdsDbInstance" || "AuroraDbClusterStorage" || "DynamoDbReservedCapacity" || "MemoryDbReservedInstances",
59-
* // recommendedResourceType: "Ec2Instance" || "LambdaFunction" || "EbsVolume" || "EcsService" || "Ec2AutoScalingGroup" || "Ec2InstanceSavingsPlans" || "ComputeSavingsPlans" || "SageMakerSavingsPlans" || "Ec2ReservedInstances" || "RdsReservedInstances" || "OpenSearchReservedInstances" || "RedshiftReservedInstances" || "ElastiCacheReservedInstances" || "RdsDbInstanceStorage" || "RdsDbInstance" || "AuroraDbClusterStorage" || "DynamoDbReservedCapacity" || "MemoryDbReservedInstances",
58+
* // currentResourceType: "Ec2Instance" || "LambdaFunction" || "EbsVolume" || "EcsService" || "Ec2AutoScalingGroup" || "Ec2InstanceSavingsPlans" || "ComputeSavingsPlans" || "SageMakerSavingsPlans" || "Ec2ReservedInstances" || "RdsReservedInstances" || "OpenSearchReservedInstances" || "RedshiftReservedInstances" || "ElastiCacheReservedInstances" || "RdsDbInstanceStorage" || "RdsDbInstance" || "AuroraDbClusterStorage" || "DynamoDbReservedCapacity" || "MemoryDbReservedInstances" || "NatGateway",
59+
* // recommendedResourceType: "Ec2Instance" || "LambdaFunction" || "EbsVolume" || "EcsService" || "Ec2AutoScalingGroup" || "Ec2InstanceSavingsPlans" || "ComputeSavingsPlans" || "SageMakerSavingsPlans" || "Ec2ReservedInstances" || "RdsReservedInstances" || "OpenSearchReservedInstances" || "RedshiftReservedInstances" || "ElastiCacheReservedInstances" || "RdsDbInstanceStorage" || "RdsDbInstance" || "AuroraDbClusterStorage" || "DynamoDbReservedCapacity" || "MemoryDbReservedInstances" || "NatGateway",
6060
* // region: "STRING_VALUE",
6161
* // source: "ComputeOptimizer" || "CostExplorer",
6262
* // lastRefreshTimestamp: new Date("TIMESTAMP"),
@@ -462,6 +462,14 @@ export interface GetRecommendationCommandOutput extends GetRecommendationRespons
462462
* // },
463463
* // costCalculation: "<ReservedInstancesCostCalculation>",
464464
* // },
465+
* // natGateway: { // NatGateway
466+
* // configuration: { // NatGatewayConfiguration
467+
* // activeConnectionCount: Number("long"),
468+
* // packetsInFromSource: Number("long"),
469+
* // packetsInFromDestination: Number("long"),
470+
* // },
471+
* // costCalculation: "<ResourceCostCalculation>",
472+
* // },
465473
* // },
466474
* // recommendedResourceDetails: {// Union: only one key present
467475
* // lambdaFunction: {
@@ -717,6 +725,14 @@ export interface GetRecommendationCommandOutput extends GetRecommendationRespons
717725
* // },
718726
* // costCalculation: "<ReservedInstancesCostCalculation>",
719727
* // },
728+
* // natGateway: {
729+
* // configuration: {
730+
* // activeConnectionCount: Number("long"),
731+
* // packetsInFromSource: Number("long"),
732+
* // packetsInFromDestination: Number("long"),
733+
* // },
734+
* // costCalculation: "<ResourceCostCalculation>",
735+
* // },
720736
* // },
721737
* // tags: [ // TagList
722738
* // { // Tag

clients/client-cost-optimization-hub/src/commands/ListRecommendationSummariesCommand.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ export interface ListRecommendationSummariesCommandOutput
5656
* "STRING_VALUE",
5757
* ],
5858
* resourceTypes: [ // ResourceTypeList
59-
* "Ec2Instance" || "LambdaFunction" || "EbsVolume" || "EcsService" || "Ec2AutoScalingGroup" || "Ec2InstanceSavingsPlans" || "ComputeSavingsPlans" || "SageMakerSavingsPlans" || "Ec2ReservedInstances" || "RdsReservedInstances" || "OpenSearchReservedInstances" || "RedshiftReservedInstances" || "ElastiCacheReservedInstances" || "RdsDbInstanceStorage" || "RdsDbInstance" || "AuroraDbClusterStorage" || "DynamoDbReservedCapacity" || "MemoryDbReservedInstances",
59+
* "Ec2Instance" || "LambdaFunction" || "EbsVolume" || "EcsService" || "Ec2AutoScalingGroup" || "Ec2InstanceSavingsPlans" || "ComputeSavingsPlans" || "SageMakerSavingsPlans" || "Ec2ReservedInstances" || "RdsReservedInstances" || "OpenSearchReservedInstances" || "RedshiftReservedInstances" || "ElastiCacheReservedInstances" || "RdsDbInstanceStorage" || "RdsDbInstance" || "AuroraDbClusterStorage" || "DynamoDbReservedCapacity" || "MemoryDbReservedInstances" || "NatGateway",
6060
* ],
6161
* actionTypes: [ // ActionTypeList
6262
* "Rightsize" || "Stop" || "Upgrade" || "PurchaseSavingsPlans" || "PurchaseReservedInstances" || "MigrateToGraviton" || "Delete" || "ScaleIn",

clients/client-cost-optimization-hub/src/commands/ListRecommendationsCommand.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ export interface ListRecommendationsCommandOutput extends ListRecommendationsRes
5454
* "STRING_VALUE",
5555
* ],
5656
* resourceTypes: [ // ResourceTypeList
57-
* "Ec2Instance" || "LambdaFunction" || "EbsVolume" || "EcsService" || "Ec2AutoScalingGroup" || "Ec2InstanceSavingsPlans" || "ComputeSavingsPlans" || "SageMakerSavingsPlans" || "Ec2ReservedInstances" || "RdsReservedInstances" || "OpenSearchReservedInstances" || "RedshiftReservedInstances" || "ElastiCacheReservedInstances" || "RdsDbInstanceStorage" || "RdsDbInstance" || "AuroraDbClusterStorage" || "DynamoDbReservedCapacity" || "MemoryDbReservedInstances",
57+
* "Ec2Instance" || "LambdaFunction" || "EbsVolume" || "EcsService" || "Ec2AutoScalingGroup" || "Ec2InstanceSavingsPlans" || "ComputeSavingsPlans" || "SageMakerSavingsPlans" || "Ec2ReservedInstances" || "RdsReservedInstances" || "OpenSearchReservedInstances" || "RedshiftReservedInstances" || "ElastiCacheReservedInstances" || "RdsDbInstanceStorage" || "RdsDbInstance" || "AuroraDbClusterStorage" || "DynamoDbReservedCapacity" || "MemoryDbReservedInstances" || "NatGateway",
5858
* ],
5959
* actionTypes: [ // ActionTypeList
6060
* "Rightsize" || "Stop" || "Upgrade" || "PurchaseSavingsPlans" || "PurchaseReservedInstances" || "MigrateToGraviton" || "Delete" || "ScaleIn",

clients/client-cost-optimization-hub/src/models/enums.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,7 @@ export const ResourceType = {
141141
ELASTI_CACHE_RESERVED_INSTANCES: "ElastiCacheReservedInstances",
142142
LAMBDA_FUNCTION: "LambdaFunction",
143143
MEMORY_DB_RESERVED_INSTANCES: "MemoryDbReservedInstances",
144+
NAT_GATEWAY: "NatGateway",
144145
OPEN_SEARCH_RESERVED_INSTANCES: "OpenSearchReservedInstances",
145146
RDS_DB_INSTANCE: "RdsDbInstance",
146147
RDS_DB_INSTANCE_STORAGE: "RdsDbInstanceStorage",

clients/client-cost-optimization-hub/src/models/models_0.ts

Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1123,6 +1123,48 @@ export interface MemoryDbReservedInstances {
11231123
costCalculation?: ReservedInstancesCostCalculation | undefined;
11241124
}
11251125

1126+
/**
1127+
* <p>The NAT Gateway configuration used for recommendations.</p>
1128+
* @public
1129+
*/
1130+
export interface NatGatewayConfiguration {
1131+
/**
1132+
* <p>The number of active connections through the NAT Gateway.</p>
1133+
* @public
1134+
*/
1135+
activeConnectionCount?: number | undefined;
1136+
1137+
/**
1138+
* <p>The number of packets received from the source through the NAT Gateway.</p>
1139+
* @public
1140+
*/
1141+
packetsInFromSource?: number | undefined;
1142+
1143+
/**
1144+
* <p>The number of packets received from the destination through the NAT Gateway.</p>
1145+
* @public
1146+
*/
1147+
packetsInFromDestination?: number | undefined;
1148+
}
1149+
1150+
/**
1151+
* <p>The NAT Gateway recommendation details.</p>
1152+
* @public
1153+
*/
1154+
export interface NatGateway {
1155+
/**
1156+
* <p>The NAT Gateway configuration used for recommendations.</p>
1157+
* @public
1158+
*/
1159+
configuration?: NatGatewayConfiguration | undefined;
1160+
1161+
/**
1162+
* <p>Cost impact of the resource recommendation.</p>
1163+
* @public
1164+
*/
1165+
costCalculation?: ResourceCostCalculation | undefined;
1166+
}
1167+
11261168
/**
11271169
* <p>The OpenSearch reserved instances configuration used for recommendations.</p>
11281170
* @public
@@ -1602,6 +1644,7 @@ export type ResourceDetails =
16021644
| ResourceDetails.ElastiCacheReservedInstancesMember
16031645
| ResourceDetails.LambdaFunctionMember
16041646
| ResourceDetails.MemoryDbReservedInstancesMember
1647+
| ResourceDetails.NatGatewayMember
16051648
| ResourceDetails.OpenSearchReservedInstancesMember
16061649
| ResourceDetails.RdsDbInstanceMember
16071650
| ResourceDetails.RdsDbInstanceStorageMember
@@ -1637,6 +1680,7 @@ export namespace ResourceDetails {
16371680
auroraDbClusterStorage?: never;
16381681
dynamoDbReservedCapacity?: never;
16391682
memoryDbReservedInstances?: never;
1683+
natGateway?: never;
16401684
$unknown?: never;
16411685
}
16421686

@@ -1663,6 +1707,7 @@ export namespace ResourceDetails {
16631707
auroraDbClusterStorage?: never;
16641708
dynamoDbReservedCapacity?: never;
16651709
memoryDbReservedInstances?: never;
1710+
natGateway?: never;
16661711
$unknown?: never;
16671712
}
16681713

@@ -1689,6 +1734,7 @@ export namespace ResourceDetails {
16891734
auroraDbClusterStorage?: never;
16901735
dynamoDbReservedCapacity?: never;
16911736
memoryDbReservedInstances?: never;
1737+
natGateway?: never;
16921738
$unknown?: never;
16931739
}
16941740

@@ -1715,6 +1761,7 @@ export namespace ResourceDetails {
17151761
auroraDbClusterStorage?: never;
17161762
dynamoDbReservedCapacity?: never;
17171763
memoryDbReservedInstances?: never;
1764+
natGateway?: never;
17181765
$unknown?: never;
17191766
}
17201767

@@ -1741,6 +1788,7 @@ export namespace ResourceDetails {
17411788
auroraDbClusterStorage?: never;
17421789
dynamoDbReservedCapacity?: never;
17431790
memoryDbReservedInstances?: never;
1791+
natGateway?: never;
17441792
$unknown?: never;
17451793
}
17461794

@@ -1767,6 +1815,7 @@ export namespace ResourceDetails {
17671815
auroraDbClusterStorage?: never;
17681816
dynamoDbReservedCapacity?: never;
17691817
memoryDbReservedInstances?: never;
1818+
natGateway?: never;
17701819
$unknown?: never;
17711820
}
17721821

@@ -1793,6 +1842,7 @@ export namespace ResourceDetails {
17931842
auroraDbClusterStorage?: never;
17941843
dynamoDbReservedCapacity?: never;
17951844
memoryDbReservedInstances?: never;
1845+
natGateway?: never;
17961846
$unknown?: never;
17971847
}
17981848

@@ -1819,6 +1869,7 @@ export namespace ResourceDetails {
18191869
auroraDbClusterStorage?: never;
18201870
dynamoDbReservedCapacity?: never;
18211871
memoryDbReservedInstances?: never;
1872+
natGateway?: never;
18221873
$unknown?: never;
18231874
}
18241875

@@ -1845,6 +1896,7 @@ export namespace ResourceDetails {
18451896
auroraDbClusterStorage?: never;
18461897
dynamoDbReservedCapacity?: never;
18471898
memoryDbReservedInstances?: never;
1899+
natGateway?: never;
18481900
$unknown?: never;
18491901
}
18501902

@@ -1871,6 +1923,7 @@ export namespace ResourceDetails {
18711923
auroraDbClusterStorage?: never;
18721924
dynamoDbReservedCapacity?: never;
18731925
memoryDbReservedInstances?: never;
1926+
natGateway?: never;
18741927
$unknown?: never;
18751928
}
18761929

@@ -1897,6 +1950,7 @@ export namespace ResourceDetails {
18971950
auroraDbClusterStorage?: never;
18981951
dynamoDbReservedCapacity?: never;
18991952
memoryDbReservedInstances?: never;
1953+
natGateway?: never;
19001954
$unknown?: never;
19011955
}
19021956

@@ -1923,6 +1977,7 @@ export namespace ResourceDetails {
19231977
auroraDbClusterStorage?: never;
19241978
dynamoDbReservedCapacity?: never;
19251979
memoryDbReservedInstances?: never;
1980+
natGateway?: never;
19261981
$unknown?: never;
19271982
}
19281983

@@ -1949,6 +2004,7 @@ export namespace ResourceDetails {
19492004
auroraDbClusterStorage?: never;
19502005
dynamoDbReservedCapacity?: never;
19512006
memoryDbReservedInstances?: never;
2007+
natGateway?: never;
19522008
$unknown?: never;
19532009
}
19542010

@@ -1975,6 +2031,7 @@ export namespace ResourceDetails {
19752031
auroraDbClusterStorage?: never;
19762032
dynamoDbReservedCapacity?: never;
19772033
memoryDbReservedInstances?: never;
2034+
natGateway?: never;
19782035
$unknown?: never;
19792036
}
19802037

@@ -2001,6 +2058,7 @@ export namespace ResourceDetails {
20012058
auroraDbClusterStorage?: never;
20022059
dynamoDbReservedCapacity?: never;
20032060
memoryDbReservedInstances?: never;
2061+
natGateway?: never;
20042062
$unknown?: never;
20052063
}
20062064

@@ -2027,6 +2085,7 @@ export namespace ResourceDetails {
20272085
auroraDbClusterStorage: AuroraDbClusterStorage;
20282086
dynamoDbReservedCapacity?: never;
20292087
memoryDbReservedInstances?: never;
2088+
natGateway?: never;
20302089
$unknown?: never;
20312090
}
20322091

@@ -2053,6 +2112,7 @@ export namespace ResourceDetails {
20532112
auroraDbClusterStorage?: never;
20542113
dynamoDbReservedCapacity: DynamoDbReservedCapacity;
20552114
memoryDbReservedInstances?: never;
2115+
natGateway?: never;
20562116
$unknown?: never;
20572117
}
20582118

@@ -2079,6 +2139,34 @@ export namespace ResourceDetails {
20792139
auroraDbClusterStorage?: never;
20802140
dynamoDbReservedCapacity?: never;
20812141
memoryDbReservedInstances: MemoryDbReservedInstances;
2142+
natGateway?: never;
2143+
$unknown?: never;
2144+
}
2145+
2146+
/**
2147+
* <p>The NAT Gateway recommendation details.</p>
2148+
* @public
2149+
*/
2150+
export interface NatGatewayMember {
2151+
lambdaFunction?: never;
2152+
ecsService?: never;
2153+
ec2Instance?: never;
2154+
ebsVolume?: never;
2155+
ec2AutoScalingGroup?: never;
2156+
ec2ReservedInstances?: never;
2157+
rdsReservedInstances?: never;
2158+
elastiCacheReservedInstances?: never;
2159+
openSearchReservedInstances?: never;
2160+
redshiftReservedInstances?: never;
2161+
ec2InstanceSavingsPlans?: never;
2162+
computeSavingsPlans?: never;
2163+
sageMakerSavingsPlans?: never;
2164+
rdsDbInstance?: never;
2165+
rdsDbInstanceStorage?: never;
2166+
auroraDbClusterStorage?: never;
2167+
dynamoDbReservedCapacity?: never;
2168+
memoryDbReservedInstances?: never;
2169+
natGateway: NatGateway;
20822170
$unknown?: never;
20832171
}
20842172

@@ -2104,6 +2192,7 @@ export namespace ResourceDetails {
21042192
auroraDbClusterStorage?: never;
21052193
dynamoDbReservedCapacity?: never;
21062194
memoryDbReservedInstances?: never;
2195+
natGateway?: never;
21072196
$unknown: [string, any];
21082197
}
21092198

@@ -2130,6 +2219,7 @@ export namespace ResourceDetails {
21302219
auroraDbClusterStorage: (value: AuroraDbClusterStorage) => T;
21312220
dynamoDbReservedCapacity: (value: DynamoDbReservedCapacity) => T;
21322221
memoryDbReservedInstances: (value: MemoryDbReservedInstances) => T;
2222+
natGateway: (value: NatGateway) => T;
21332223
_: (name: string, value: any) => T;
21342224
}
21352225
}

clients/client-cost-optimization-hub/src/schemas/schemas_0.ts

Lines changed: 37 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,8 @@ const _MDRI = "MemoryDbReservedInstances";
5656
const _MDRIC = "MemoryDbReservedInstancesConfiguration";
5757
const _MIC = "MixedInstanceConfiguration";
5858
const _MICL = "MixedInstanceConfigurationList";
59+
const _NG = "NatGateway";
60+
const _NGC = "NatGatewayConfiguration";
5961
const _OB = "OrderBy";
6062
const _OSRI = "OpenSearchReservedInstances";
6163
const _OSRIC = "OpenSearchReservedInstancesConfiguration";
@@ -100,6 +102,7 @@ const _VE = "ValidationException";
100102
const _VED = "ValidationExceptionDetail";
101103
const _VEDa = "ValidationExceptionDetails";
102104
const _a = "architecture";
105+
const _aCC = "activeConnectionCount";
103106
const _aDCS = "auroraDbClusterStorage";
104107
const _aI = "accountId";
105108
const _aIc = "accountIds";
@@ -184,6 +187,7 @@ const _mREC = "monthlyReservationEligibleCost";
184187
const _mSIMB = "memorySizeInMB";
185188
const _mSPEC = "monthlySavingsPlansEligibleCost";
186189
const _me = "metrics";
190+
const _nG = "natGateway";
187191
const _nOCUTP = "numberOfCapacityUnitsToPurchase";
188192
const _nOITP = "numberOfInstancesToPurchase";
189193
const _nT = "nextToken";
@@ -197,6 +201,8 @@ const _op = "operation";
197201
const _p = "platform";
198202
const _pC = "preferredCommitment";
199203
const _pCr = "productCode";
204+
const _pIFD = "packetsInFromDestination";
205+
const _pIFS = "packetsInFromSource";
200206
const _pO = "paymentOption";
201207
const _pe = "performance";
202208
const _pr = "pricing";
@@ -617,6 +623,15 @@ export var MemoryDbReservedInstancesConfiguration: StaticStructureSchema = [
617623
];
618624
export var MetricsByTime: StaticStructureSchema = [3, n0, _MBT, 0, [_sc, _sa, _sp, _ti], [1, 1, 1, 0]];
619625
export var MixedInstanceConfiguration: StaticStructureSchema = [3, n0, _MIC, 0, [_ty], [0]];
626+
export var NatGateway: StaticStructureSchema = [
627+
3,
628+
n0,
629+
_NG,
630+
0,
631+
[_co, _cC],
632+
[() => NatGatewayConfiguration, () => ResourceCostCalculation],
633+
];
634+
export var NatGatewayConfiguration: StaticStructureSchema = [3, n0, _NGC, 0, [_aCC, _pIFS, _pIFD], [1, 1, 1]];
620635
export var OpenSearchReservedInstances: StaticStructureSchema = [
621636
3,
622637
n0,
@@ -887,7 +902,27 @@ export var ResourceDetails: StaticStructureSchema = [
887902
n0,
888903
_RD,
889904
0,
890-
[_lF, _eS, _eI, _eV, _eASG, _eRI, _rRI, _eCRI, _oSRI, _rRIe, _eISP, _cSP, _sMSP, _rDI, _rDIS, _aDCS, _dDRC, _mDRI],
905+
[
906+
_lF,
907+
_eS,
908+
_eI,
909+
_eV,
910+
_eASG,
911+
_eRI,
912+
_rRI,
913+
_eCRI,
914+
_oSRI,
915+
_rRIe,
916+
_eISP,
917+
_cSP,
918+
_sMSP,
919+
_rDI,
920+
_rDIS,
921+
_aDCS,
922+
_dDRC,
923+
_mDRI,
924+
_nG,
925+
],
891926
[
892927
() => LambdaFunction,
893928
() => EcsService,
@@ -907,6 +942,7 @@ export var ResourceDetails: StaticStructureSchema = [
907942
() => AuroraDbClusterStorage,
908943
() => DynamoDbReservedCapacity,
909944
() => MemoryDbReservedInstances,
945+
() => NatGateway,
910946
],
911947
];
912948
export var GetPreferences: StaticOperationSchema = [

0 commit comments

Comments
 (0)