Skip to content

Commit 15509fd

Browse files
author
awstools
committed
feat(client-compute-optimizer): This release enables AWS Compute Optimizer to analyze and generate optimization recommendations for Amazon Aurora database instances. It also enables Compute Optimizer to identify idle Amazon EC2 instances, Amazon EBS volumes, Amazon ECS services running on Fargate, and Amazon RDS databases.
1 parent 2cc0b79 commit 15509fd

17 files changed

+2542
-148
lines changed

clients/client-compute-optimizer/README.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -261,6 +261,14 @@ ExportECSServiceRecommendations
261261

262262
[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/compute-optimizer/command/ExportECSServiceRecommendationsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-compute-optimizer/Interface/ExportECSServiceRecommendationsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-compute-optimizer/Interface/ExportECSServiceRecommendationsCommandOutput/)
263263

264+
</details>
265+
<details>
266+
<summary>
267+
ExportIdleRecommendations
268+
</summary>
269+
270+
[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/compute-optimizer/command/ExportIdleRecommendationsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-compute-optimizer/Interface/ExportIdleRecommendationsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-compute-optimizer/Interface/ExportIdleRecommendationsCommandOutput/)
271+
264272
</details>
265273
<details>
266274
<summary>
@@ -357,6 +365,14 @@ GetEnrollmentStatusesForOrganization
357365

358366
[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/compute-optimizer/command/GetEnrollmentStatusesForOrganizationCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-compute-optimizer/Interface/GetEnrollmentStatusesForOrganizationCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-compute-optimizer/Interface/GetEnrollmentStatusesForOrganizationCommandOutput/)
359367

368+
</details>
369+
<details>
370+
<summary>
371+
GetIdleRecommendations
372+
</summary>
373+
374+
[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/compute-optimizer/command/GetIdleRecommendationsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-compute-optimizer/Interface/GetIdleRecommendationsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-compute-optimizer/Interface/GetIdleRecommendationsCommandOutput/)
375+
360376
</details>
361377
<details>
362378
<summary>

clients/client-compute-optimizer/src/ComputeOptimizer.ts

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,11 @@ import {
3232
ExportECSServiceRecommendationsCommandInput,
3333
ExportECSServiceRecommendationsCommandOutput,
3434
} from "./commands/ExportECSServiceRecommendationsCommand";
35+
import {
36+
ExportIdleRecommendationsCommand,
37+
ExportIdleRecommendationsCommandInput,
38+
ExportIdleRecommendationsCommandOutput,
39+
} from "./commands/ExportIdleRecommendationsCommand";
3540
import {
3641
ExportLambdaFunctionRecommendationsCommand,
3742
ExportLambdaFunctionRecommendationsCommandInput,
@@ -92,6 +97,11 @@ import {
9297
GetEnrollmentStatusesForOrganizationCommandInput,
9398
GetEnrollmentStatusesForOrganizationCommandOutput,
9499
} from "./commands/GetEnrollmentStatusesForOrganizationCommand";
100+
import {
101+
GetIdleRecommendationsCommand,
102+
GetIdleRecommendationsCommandInput,
103+
GetIdleRecommendationsCommandOutput,
104+
} from "./commands/GetIdleRecommendationsCommand";
95105
import {
96106
GetLambdaFunctionRecommendationsCommand,
97107
GetLambdaFunctionRecommendationsCommandInput,
@@ -141,6 +151,7 @@ const commands = {
141151
ExportEBSVolumeRecommendationsCommand,
142152
ExportEC2InstanceRecommendationsCommand,
143153
ExportECSServiceRecommendationsCommand,
154+
ExportIdleRecommendationsCommand,
144155
ExportLambdaFunctionRecommendationsCommand,
145156
ExportLicenseRecommendationsCommand,
146157
ExportRDSDatabaseRecommendationsCommand,
@@ -153,6 +164,7 @@ const commands = {
153164
GetEffectiveRecommendationPreferencesCommand,
154165
GetEnrollmentStatusCommand,
155166
GetEnrollmentStatusesForOrganizationCommand,
167+
GetIdleRecommendationsCommand,
156168
GetLambdaFunctionRecommendationsCommand,
157169
GetLicenseRecommendationsCommand,
158170
GetRDSDatabaseRecommendationProjectedMetricsCommand,
@@ -267,6 +279,23 @@ export interface ComputeOptimizer {
267279
cb: (err: any, data?: ExportECSServiceRecommendationsCommandOutput) => void
268280
): void;
269281

282+
/**
283+
* @see {@link ExportIdleRecommendationsCommand}
284+
*/
285+
exportIdleRecommendations(
286+
args: ExportIdleRecommendationsCommandInput,
287+
options?: __HttpHandlerOptions
288+
): Promise<ExportIdleRecommendationsCommandOutput>;
289+
exportIdleRecommendations(
290+
args: ExportIdleRecommendationsCommandInput,
291+
cb: (err: any, data?: ExportIdleRecommendationsCommandOutput) => void
292+
): void;
293+
exportIdleRecommendations(
294+
args: ExportIdleRecommendationsCommandInput,
295+
options: __HttpHandlerOptions,
296+
cb: (err: any, data?: ExportIdleRecommendationsCommandOutput) => void
297+
): void;
298+
270299
/**
271300
* @see {@link ExportLambdaFunctionRecommendationsCommand}
272301
*/
@@ -477,6 +506,24 @@ export interface ComputeOptimizer {
477506
cb: (err: any, data?: GetEnrollmentStatusesForOrganizationCommandOutput) => void
478507
): void;
479508

509+
/**
510+
* @see {@link GetIdleRecommendationsCommand}
511+
*/
512+
getIdleRecommendations(): Promise<GetIdleRecommendationsCommandOutput>;
513+
getIdleRecommendations(
514+
args: GetIdleRecommendationsCommandInput,
515+
options?: __HttpHandlerOptions
516+
): Promise<GetIdleRecommendationsCommandOutput>;
517+
getIdleRecommendations(
518+
args: GetIdleRecommendationsCommandInput,
519+
cb: (err: any, data?: GetIdleRecommendationsCommandOutput) => void
520+
): void;
521+
getIdleRecommendations(
522+
args: GetIdleRecommendationsCommandInput,
523+
options: __HttpHandlerOptions,
524+
cb: (err: any, data?: GetIdleRecommendationsCommandOutput) => void
525+
): void;
526+
480527
/**
481528
* @see {@link GetLambdaFunctionRecommendationsCommand}
482529
*/

clients/client-compute-optimizer/src/ComputeOptimizerClient.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,10 @@ import {
7777
ExportECSServiceRecommendationsCommandInput,
7878
ExportECSServiceRecommendationsCommandOutput,
7979
} from "./commands/ExportECSServiceRecommendationsCommand";
80+
import {
81+
ExportIdleRecommendationsCommandInput,
82+
ExportIdleRecommendationsCommandOutput,
83+
} from "./commands/ExportIdleRecommendationsCommand";
8084
import {
8185
ExportLambdaFunctionRecommendationsCommandInput,
8286
ExportLambdaFunctionRecommendationsCommandOutput,
@@ -125,6 +129,10 @@ import {
125129
GetEnrollmentStatusesForOrganizationCommandInput,
126130
GetEnrollmentStatusesForOrganizationCommandOutput,
127131
} from "./commands/GetEnrollmentStatusesForOrganizationCommand";
132+
import {
133+
GetIdleRecommendationsCommandInput,
134+
GetIdleRecommendationsCommandOutput,
135+
} from "./commands/GetIdleRecommendationsCommand";
128136
import {
129137
GetLambdaFunctionRecommendationsCommandInput,
130138
GetLambdaFunctionRecommendationsCommandOutput,
@@ -178,6 +186,7 @@ export type ServiceInputTypes =
178186
| ExportEBSVolumeRecommendationsCommandInput
179187
| ExportEC2InstanceRecommendationsCommandInput
180188
| ExportECSServiceRecommendationsCommandInput
189+
| ExportIdleRecommendationsCommandInput
181190
| ExportLambdaFunctionRecommendationsCommandInput
182191
| ExportLicenseRecommendationsCommandInput
183192
| ExportRDSDatabaseRecommendationsCommandInput
@@ -190,6 +199,7 @@ export type ServiceInputTypes =
190199
| GetEffectiveRecommendationPreferencesCommandInput
191200
| GetEnrollmentStatusCommandInput
192201
| GetEnrollmentStatusesForOrganizationCommandInput
202+
| GetIdleRecommendationsCommandInput
193203
| GetLambdaFunctionRecommendationsCommandInput
194204
| GetLicenseRecommendationsCommandInput
195205
| GetRDSDatabaseRecommendationProjectedMetricsCommandInput
@@ -209,6 +219,7 @@ export type ServiceOutputTypes =
209219
| ExportEBSVolumeRecommendationsCommandOutput
210220
| ExportEC2InstanceRecommendationsCommandOutput
211221
| ExportECSServiceRecommendationsCommandOutput
222+
| ExportIdleRecommendationsCommandOutput
212223
| ExportLambdaFunctionRecommendationsCommandOutput
213224
| ExportLicenseRecommendationsCommandOutput
214225
| ExportRDSDatabaseRecommendationsCommandOutput
@@ -221,6 +232,7 @@ export type ServiceOutputTypes =
221232
| GetEffectiveRecommendationPreferencesCommandOutput
222233
| GetEnrollmentStatusCommandOutput
223234
| GetEnrollmentStatusesForOrganizationCommandOutput
235+
| GetIdleRecommendationsCommandOutput
224236
| GetLambdaFunctionRecommendationsCommandOutput
225237
| GetLicenseRecommendationsCommandOutput
226238
| GetRDSDatabaseRecommendationProjectedMetricsCommandOutput

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ export interface DeleteRecommendationPreferencesCommandOutput
4444
* // const { ComputeOptimizerClient, DeleteRecommendationPreferencesCommand } = require("@aws-sdk/client-compute-optimizer"); // CommonJS import
4545
* const client = new ComputeOptimizerClient(config);
4646
* const input = { // DeleteRecommendationPreferencesRequest
47-
* resourceType: "Ec2Instance" || "AutoScalingGroup" || "EbsVolume" || "LambdaFunction" || "NotApplicable" || "EcsService" || "License" || "RdsDBInstance", // required
47+
* resourceType: "Ec2Instance" || "AutoScalingGroup" || "EbsVolume" || "LambdaFunction" || "NotApplicable" || "EcsService" || "License" || "RdsDBInstance" || "Idle", // required
4848
* scope: { // Scope
4949
* name: "Organization" || "AccountId" || "ResourceArn",
5050
* value: "STRING_VALUE",

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ export interface DescribeRecommendationExportJobsCommandOutput
7171
* // metadataKey: "STRING_VALUE",
7272
* // },
7373
* // },
74-
* // resourceType: "Ec2Instance" || "AutoScalingGroup" || "EbsVolume" || "LambdaFunction" || "NotApplicable" || "EcsService" || "License" || "RdsDBInstance",
74+
* // resourceType: "Ec2Instance" || "AutoScalingGroup" || "EbsVolume" || "LambdaFunction" || "NotApplicable" || "EcsService" || "License" || "RdsDBInstance" || "Idle",
7575
* // status: "Queued" || "InProgress" || "Complete" || "Failed",
7676
* // creationTimestamp: new Date("TIMESTAMP"),
7777
* // lastUpdatedTimestamp: new Date("TIMESTAMP"),
Lines changed: 148 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,148 @@
1+
// smithy-typescript generated code
2+
import { getEndpointPlugin } from "@smithy/middleware-endpoint";
3+
import { getSerdePlugin } from "@smithy/middleware-serde";
4+
import { Command as $Command } from "@smithy/smithy-client";
5+
import { MetadataBearer as __MetadataBearer } from "@smithy/types";
6+
7+
import { ComputeOptimizerClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../ComputeOptimizerClient";
8+
import { commonParams } from "../endpoint/EndpointParameters";
9+
import { ExportIdleRecommendationsRequest, ExportIdleRecommendationsResponse } from "../models/models_0";
10+
import { de_ExportIdleRecommendationsCommand, se_ExportIdleRecommendationsCommand } from "../protocols/Aws_json1_0";
11+
12+
/**
13+
* @public
14+
*/
15+
export type { __MetadataBearer };
16+
export { $Command };
17+
/**
18+
* @public
19+
*
20+
* The input for {@link ExportIdleRecommendationsCommand}.
21+
*/
22+
export interface ExportIdleRecommendationsCommandInput extends ExportIdleRecommendationsRequest {}
23+
/**
24+
* @public
25+
*
26+
* The output of {@link ExportIdleRecommendationsCommand}.
27+
*/
28+
export interface ExportIdleRecommendationsCommandOutput extends ExportIdleRecommendationsResponse, __MetadataBearer {}
29+
30+
/**
31+
* <p>
32+
* Export optimization recommendations for your idle resources.
33+
* </p>
34+
* <p>Recommendations are exported in a comma-separated values (CSV) file, and its metadata
35+
* in a JavaScript Object Notation (JSON) file, to an existing Amazon Simple Storage Service (Amazon S3) bucket that you specify. For more information, see <a href="https://docs.aws.amazon.com/compute-optimizer/latest/ug/exporting-recommendations.html">Exporting
36+
* Recommendations</a> in the <i>Compute Optimizer User
37+
* Guide</i>.</p>
38+
* <p>You can have only one idle resource export job in progress per Amazon Web Services Region.</p>
39+
* @example
40+
* Use a bare-bones client and the command you need to make an API call.
41+
* ```javascript
42+
* import { ComputeOptimizerClient, ExportIdleRecommendationsCommand } from "@aws-sdk/client-compute-optimizer"; // ES Modules import
43+
* // const { ComputeOptimizerClient, ExportIdleRecommendationsCommand } = require("@aws-sdk/client-compute-optimizer"); // CommonJS import
44+
* const client = new ComputeOptimizerClient(config);
45+
* const input = { // ExportIdleRecommendationsRequest
46+
* accountIds: [ // AccountIds
47+
* "STRING_VALUE",
48+
* ],
49+
* filters: [ // IdleRecommendationFilters
50+
* { // IdleRecommendationFilter
51+
* name: "Finding" || "ResourceType",
52+
* values: [ // FilterValues
53+
* "STRING_VALUE",
54+
* ],
55+
* },
56+
* ],
57+
* fieldsToExport: [ // ExportableIdleFields
58+
* "AccountId" || "ResourceArn" || "ResourceId" || "ResourceType" || "LastRefreshTimestamp" || "LookbackPeriodInDays" || "SavingsOpportunity" || "SavingsOpportunityAfterDiscount" || "UtilizationMetricsCpuMaximum" || "UtilizationMetricsMemoryMaximum" || "UtilizationMetricsNetworkOutBytesPerSecondMaximum" || "UtilizationMetricsNetworkInBytesPerSecondMaximum" || "UtilizationMetricsDatabaseConnectionsMaximum" || "UtilizationMetricsEBSVolumeReadIOPSMaximum" || "UtilizationMetricsEBSVolumeWriteIOPSMaximum" || "UtilizationMetricsVolumeReadOpsPerSecondMaximum" || "UtilizationMetricsVolumeWriteOpsPerSecondMaximum" || "Finding" || "FindingDescription" || "Tags",
59+
* ],
60+
* s3DestinationConfig: { // S3DestinationConfig
61+
* bucket: "STRING_VALUE",
62+
* keyPrefix: "STRING_VALUE",
63+
* },
64+
* fileFormat: "Csv",
65+
* includeMemberAccounts: true || false,
66+
* };
67+
* const command = new ExportIdleRecommendationsCommand(input);
68+
* const response = await client.send(command);
69+
* // { // ExportIdleRecommendationsResponse
70+
* // jobId: "STRING_VALUE",
71+
* // s3Destination: { // S3Destination
72+
* // bucket: "STRING_VALUE",
73+
* // key: "STRING_VALUE",
74+
* // metadataKey: "STRING_VALUE",
75+
* // },
76+
* // };
77+
*
78+
* ```
79+
*
80+
* @param ExportIdleRecommendationsCommandInput - {@link ExportIdleRecommendationsCommandInput}
81+
* @returns {@link ExportIdleRecommendationsCommandOutput}
82+
* @see {@link ExportIdleRecommendationsCommandInput} for command's `input` shape.
83+
* @see {@link ExportIdleRecommendationsCommandOutput} for command's `response` shape.
84+
* @see {@link ComputeOptimizerClientResolvedConfig | config} for ComputeOptimizerClient's `config` shape.
85+
*
86+
* @throws {@link AccessDeniedException} (client fault)
87+
* <p>You do not have sufficient access to perform this action.</p>
88+
*
89+
* @throws {@link InternalServerException} (server fault)
90+
* <p>An internal error has occurred. Try your call again.</p>
91+
*
92+
* @throws {@link InvalidParameterValueException} (client fault)
93+
* <p>The value supplied for the input parameter is out of range or not valid.</p>
94+
*
95+
* @throws {@link LimitExceededException} (client fault)
96+
* <p>The request exceeds a limit of the service.</p>
97+
*
98+
* @throws {@link MissingAuthenticationToken} (client fault)
99+
* <p>The request must contain either a valid (registered) Amazon Web Services access key ID
100+
* or X.509 certificate.</p>
101+
*
102+
* @throws {@link OptInRequiredException} (client fault)
103+
* <p>The account is not opted in to Compute Optimizer.</p>
104+
*
105+
* @throws {@link ServiceUnavailableException} (server fault)
106+
* <p>The request has failed due to a temporary failure of the server.</p>
107+
*
108+
* @throws {@link ThrottlingException} (client fault)
109+
* <p>The request was denied due to request throttling.</p>
110+
*
111+
* @throws {@link ComputeOptimizerServiceException}
112+
* <p>Base exception class for all service exceptions from ComputeOptimizer service.</p>
113+
*
114+
* @public
115+
*/
116+
export class ExportIdleRecommendationsCommand extends $Command
117+
.classBuilder<
118+
ExportIdleRecommendationsCommandInput,
119+
ExportIdleRecommendationsCommandOutput,
120+
ComputeOptimizerClientResolvedConfig,
121+
ServiceInputTypes,
122+
ServiceOutputTypes
123+
>()
124+
.ep(commonParams)
125+
.m(function (this: any, Command: any, cs: any, config: ComputeOptimizerClientResolvedConfig, o: any) {
126+
return [
127+
getSerdePlugin(config, this.serialize, this.deserialize),
128+
getEndpointPlugin(config, Command.getEndpointParameterInstructions()),
129+
];
130+
})
131+
.s("ComputeOptimizerService", "ExportIdleRecommendations", {})
132+
.n("ComputeOptimizerClient", "ExportIdleRecommendationsCommand")
133+
.f(void 0, void 0)
134+
.ser(se_ExportIdleRecommendationsCommand)
135+
.de(de_ExportIdleRecommendationsCommand)
136+
.build() {
137+
/** @internal type navigation helper, not in runtime. */
138+
protected declare static __types: {
139+
api: {
140+
input: ExportIdleRecommendationsRequest;
141+
output: ExportIdleRecommendationsResponse;
142+
};
143+
sdk: {
144+
input: ExportIdleRecommendationsCommandInput;
145+
output: ExportIdleRecommendationsCommandOutput;
146+
};
147+
};
148+
}

0 commit comments

Comments
 (0)