Skip to content

Commit

Permalink
feat(client-accessanalyzer): This release introduces the getFindingsS…
Browse files Browse the repository at this point in the history
…tatistics API, enabling users to retrieve aggregated finding statistics for IAM Access Analyzer's external access and unused access analysis features. Updated service API and documentation.
  • Loading branch information
awstools committed Feb 13, 2025
1 parent 53f15ec commit 18ecb88
Show file tree
Hide file tree
Showing 8 changed files with 748 additions and 0 deletions.
8 changes: 8 additions & 0 deletions clients/client-accessanalyzer/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -361,6 +361,14 @@ GetFindingRecommendation

[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/accessanalyzer/command/GetFindingRecommendationCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-accessanalyzer/Interface/GetFindingRecommendationCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-accessanalyzer/Interface/GetFindingRecommendationCommandOutput/)

</details>
<details>
<summary>
GetFindingsStatistics
</summary>

[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/accessanalyzer/command/GetFindingsStatisticsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-accessanalyzer/Interface/GetFindingsStatisticsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-accessanalyzer/Interface/GetFindingsStatisticsCommandOutput/)

</details>
<details>
<summary>
Expand Down
23 changes: 23 additions & 0 deletions clients/client-accessanalyzer/src/AccessAnalyzer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,11 @@ import {
GetFindingRecommendationCommandInput,
GetFindingRecommendationCommandOutput,
} from "./commands/GetFindingRecommendationCommand";
import {
GetFindingsStatisticsCommand,
GetFindingsStatisticsCommandInput,
GetFindingsStatisticsCommandOutput,
} from "./commands/GetFindingsStatisticsCommand";
import {
GetFindingV2Command,
GetFindingV2CommandInput,
Expand Down Expand Up @@ -190,6 +195,7 @@ const commands = {
GetArchiveRuleCommand,
GetFindingCommand,
GetFindingRecommendationCommand,
GetFindingsStatisticsCommand,
GetFindingV2Command,
GetGeneratedPolicyCommand,
ListAccessPreviewFindingsCommand,
Expand Down Expand Up @@ -480,6 +486,23 @@ export interface AccessAnalyzer {
cb: (err: any, data?: GetFindingRecommendationCommandOutput) => void
): void;

/**
* @see {@link GetFindingsStatisticsCommand}
*/
getFindingsStatistics(
args: GetFindingsStatisticsCommandInput,
options?: __HttpHandlerOptions
): Promise<GetFindingsStatisticsCommandOutput>;
getFindingsStatistics(
args: GetFindingsStatisticsCommandInput,
cb: (err: any, data?: GetFindingsStatisticsCommandOutput) => void
): void;
getFindingsStatistics(
args: GetFindingsStatisticsCommandInput,
options: __HttpHandlerOptions,
cb: (err: any, data?: GetFindingsStatisticsCommandOutput) => void
): void;

/**
* @see {@link GetFindingV2Command}
*/
Expand Down
6 changes: 6 additions & 0 deletions clients/client-accessanalyzer/src/AccessAnalyzerClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,10 @@ import {
GetFindingRecommendationCommandInput,
GetFindingRecommendationCommandOutput,
} from "./commands/GetFindingRecommendationCommand";
import {
GetFindingsStatisticsCommandInput,
GetFindingsStatisticsCommandOutput,
} from "./commands/GetFindingsStatisticsCommand";
import { GetFindingV2CommandInput, GetFindingV2CommandOutput } from "./commands/GetFindingV2Command";
import { GetGeneratedPolicyCommandInput, GetGeneratedPolicyCommandOutput } from "./commands/GetGeneratedPolicyCommand";
import {
Expand Down Expand Up @@ -158,6 +162,7 @@ export type ServiceInputTypes =
| GetFindingCommandInput
| GetFindingRecommendationCommandInput
| GetFindingV2CommandInput
| GetFindingsStatisticsCommandInput
| GetGeneratedPolicyCommandInput
| ListAccessPreviewFindingsCommandInput
| ListAccessPreviewsCommandInput
Expand Down Expand Up @@ -199,6 +204,7 @@ export type ServiceOutputTypes =
| GetFindingCommandOutput
| GetFindingRecommendationCommandOutput
| GetFindingV2CommandOutput
| GetFindingsStatisticsCommandOutput
| GetGeneratedPolicyCommandOutput
| ListAccessPreviewFindingsCommandOutput
| ListAccessPreviewsCommandOutput
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,143 @@
// smithy-typescript generated code
import { getEndpointPlugin } from "@smithy/middleware-endpoint";
import { getSerdePlugin } from "@smithy/middleware-serde";
import { Command as $Command } from "@smithy/smithy-client";
import { MetadataBearer as __MetadataBearer } from "@smithy/types";

import { AccessAnalyzerClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../AccessAnalyzerClient";
import { commonParams } from "../endpoint/EndpointParameters";
import { GetFindingsStatisticsRequest, GetFindingsStatisticsResponse } from "../models/models_0";
import { de_GetFindingsStatisticsCommand, se_GetFindingsStatisticsCommand } from "../protocols/Aws_restJson1";

/**
* @public
*/
export type { __MetadataBearer };
export { $Command };
/**
* @public
*
* The input for {@link GetFindingsStatisticsCommand}.
*/
export interface GetFindingsStatisticsCommandInput extends GetFindingsStatisticsRequest {}
/**
* @public
*
* The output of {@link GetFindingsStatisticsCommand}.
*/
export interface GetFindingsStatisticsCommandOutput extends GetFindingsStatisticsResponse, __MetadataBearer {}

/**
* <p>Retrieves a list of aggregated finding statistics for an external access or unused
* access analyzer.</p>
* @example
* Use a bare-bones client and the command you need to make an API call.
* ```javascript
* import { AccessAnalyzerClient, GetFindingsStatisticsCommand } from "@aws-sdk/client-accessanalyzer"; // ES Modules import
* // const { AccessAnalyzerClient, GetFindingsStatisticsCommand } = require("@aws-sdk/client-accessanalyzer"); // CommonJS import
* const client = new AccessAnalyzerClient(config);
* const input = { // GetFindingsStatisticsRequest
* analyzerArn: "STRING_VALUE", // required
* };
* const command = new GetFindingsStatisticsCommand(input);
* const response = await client.send(command);
* // { // GetFindingsStatisticsResponse
* // findingsStatistics: [ // FindingsStatisticsList
* // { // FindingsStatistics Union: only one key present
* // externalAccessFindingsStatistics: { // ExternalAccessFindingsStatistics
* // resourceTypeStatistics: { // ResourceTypeStatisticsMap
* // "<keys>": { // ResourceTypeDetails
* // totalActivePublic: Number("int"),
* // totalActiveCrossAccount: Number("int"),
* // },
* // },
* // totalActiveFindings: Number("int"),
* // totalArchivedFindings: Number("int"),
* // totalResolvedFindings: Number("int"),
* // },
* // unusedAccessFindingsStatistics: { // UnusedAccessFindingsStatistics
* // unusedAccessTypeStatistics: [ // UnusedAccessTypeStatisticsList
* // { // UnusedAccessTypeStatistics
* // unusedAccessType: "STRING_VALUE",
* // total: Number("int"),
* // },
* // ],
* // topAccounts: [ // AccountAggregations
* // { // FindingAggregationAccountDetails
* // account: "STRING_VALUE",
* // numberOfActiveFindings: Number("int"),
* // details: { // FindingAggregationAccountDetailsMap
* // "<keys>": Number("int"),
* // },
* // },
* // ],
* // totalActiveFindings: Number("int"),
* // totalArchivedFindings: Number("int"),
* // totalResolvedFindings: Number("int"),
* // },
* // },
* // ],
* // lastUpdatedAt: new Date("TIMESTAMP"),
* // };
*
* ```
*
* @param GetFindingsStatisticsCommandInput - {@link GetFindingsStatisticsCommandInput}
* @returns {@link GetFindingsStatisticsCommandOutput}
* @see {@link GetFindingsStatisticsCommandInput} for command's `input` shape.
* @see {@link GetFindingsStatisticsCommandOutput} for command's `response` shape.
* @see {@link AccessAnalyzerClientResolvedConfig | config} for AccessAnalyzerClient's `config` shape.
*
* @throws {@link AccessDeniedException} (client fault)
* <p>You do not have sufficient access to perform this action.</p>
*
* @throws {@link InternalServerException} (server fault)
* <p>Internal server error.</p>
*
* @throws {@link ResourceNotFoundException} (client fault)
* <p>The specified resource could not be found.</p>
*
* @throws {@link ThrottlingException} (client fault)
* <p>Throttling limit exceeded error.</p>
*
* @throws {@link ValidationException} (client fault)
* <p>Validation exception error.</p>
*
* @throws {@link AccessAnalyzerServiceException}
* <p>Base exception class for all service exceptions from AccessAnalyzer service.</p>
*
* @public
*/
export class GetFindingsStatisticsCommand extends $Command
.classBuilder<
GetFindingsStatisticsCommandInput,
GetFindingsStatisticsCommandOutput,
AccessAnalyzerClientResolvedConfig,
ServiceInputTypes,
ServiceOutputTypes
>()
.ep(commonParams)
.m(function (this: any, Command: any, cs: any, config: AccessAnalyzerClientResolvedConfig, o: any) {
return [
getSerdePlugin(config, this.serialize, this.deserialize),
getEndpointPlugin(config, Command.getEndpointParameterInstructions()),
];
})
.s("AccessAnalyzer", "GetFindingsStatistics", {})
.n("AccessAnalyzerClient", "GetFindingsStatisticsCommand")
.f(void 0, void 0)
.ser(se_GetFindingsStatisticsCommand)
.de(de_GetFindingsStatisticsCommand)
.build() {
/** @internal type navigation helper, not in runtime. */
protected declare static __types: {
api: {
input: GetFindingsStatisticsRequest;
output: GetFindingsStatisticsResponse;
};
sdk: {
input: GetFindingsStatisticsCommandInput;
output: GetFindingsStatisticsCommandOutput;
};
};
}
1 change: 1 addition & 0 deletions clients/client-accessanalyzer/src/commands/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ export * from "./GetArchiveRuleCommand";
export * from "./GetFindingCommand";
export * from "./GetFindingRecommendationCommand";
export * from "./GetFindingV2Command";
export * from "./GetFindingsStatisticsCommand";
export * from "./GetGeneratedPolicyCommand";
export * from "./ListAccessPreviewFindingsCommand";
export * from "./ListAccessPreviewsCommand";
Expand Down
Loading

0 comments on commit 18ecb88

Please sign in to comment.