Skip to content

Commit 18ecb88

Browse files
author
awstools
committed
feat(client-accessanalyzer): This release introduces the getFindingsStatistics 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.
1 parent 53f15ec commit 18ecb88

File tree

8 files changed

+748
-0
lines changed

8 files changed

+748
-0
lines changed

Diff for: clients/client-accessanalyzer/README.md

+8
Original file line numberDiff line numberDiff line change
@@ -361,6 +361,14 @@ GetFindingRecommendation
361361

362362
[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/)
363363

364+
</details>
365+
<details>
366+
<summary>
367+
GetFindingsStatistics
368+
</summary>
369+
370+
[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/)
371+
364372
</details>
365373
<details>
366374
<summary>

Diff for: clients/client-accessanalyzer/src/AccessAnalyzer.ts

+23
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,11 @@ import {
8080
GetFindingRecommendationCommandInput,
8181
GetFindingRecommendationCommandOutput,
8282
} from "./commands/GetFindingRecommendationCommand";
83+
import {
84+
GetFindingsStatisticsCommand,
85+
GetFindingsStatisticsCommandInput,
86+
GetFindingsStatisticsCommandOutput,
87+
} from "./commands/GetFindingsStatisticsCommand";
8388
import {
8489
GetFindingV2Command,
8590
GetFindingV2CommandInput,
@@ -190,6 +195,7 @@ const commands = {
190195
GetArchiveRuleCommand,
191196
GetFindingCommand,
192197
GetFindingRecommendationCommand,
198+
GetFindingsStatisticsCommand,
193199
GetFindingV2Command,
194200
GetGeneratedPolicyCommand,
195201
ListAccessPreviewFindingsCommand,
@@ -480,6 +486,23 @@ export interface AccessAnalyzer {
480486
cb: (err: any, data?: GetFindingRecommendationCommandOutput) => void
481487
): void;
482488

489+
/**
490+
* @see {@link GetFindingsStatisticsCommand}
491+
*/
492+
getFindingsStatistics(
493+
args: GetFindingsStatisticsCommandInput,
494+
options?: __HttpHandlerOptions
495+
): Promise<GetFindingsStatisticsCommandOutput>;
496+
getFindingsStatistics(
497+
args: GetFindingsStatisticsCommandInput,
498+
cb: (err: any, data?: GetFindingsStatisticsCommandOutput) => void
499+
): void;
500+
getFindingsStatistics(
501+
args: GetFindingsStatisticsCommandInput,
502+
options: __HttpHandlerOptions,
503+
cb: (err: any, data?: GetFindingsStatisticsCommandOutput) => void
504+
): void;
505+
483506
/**
484507
* @see {@link GetFindingV2Command}
485508
*/

Diff for: clients/client-accessanalyzer/src/AccessAnalyzerClient.ts

+6
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,10 @@ import {
9191
GetFindingRecommendationCommandInput,
9292
GetFindingRecommendationCommandOutput,
9393
} from "./commands/GetFindingRecommendationCommand";
94+
import {
95+
GetFindingsStatisticsCommandInput,
96+
GetFindingsStatisticsCommandOutput,
97+
} from "./commands/GetFindingsStatisticsCommand";
9498
import { GetFindingV2CommandInput, GetFindingV2CommandOutput } from "./commands/GetFindingV2Command";
9599
import { GetGeneratedPolicyCommandInput, GetGeneratedPolicyCommandOutput } from "./commands/GetGeneratedPolicyCommand";
96100
import {
@@ -158,6 +162,7 @@ export type ServiceInputTypes =
158162
| GetFindingCommandInput
159163
| GetFindingRecommendationCommandInput
160164
| GetFindingV2CommandInput
165+
| GetFindingsStatisticsCommandInput
161166
| GetGeneratedPolicyCommandInput
162167
| ListAccessPreviewFindingsCommandInput
163168
| ListAccessPreviewsCommandInput
@@ -199,6 +204,7 @@ export type ServiceOutputTypes =
199204
| GetFindingCommandOutput
200205
| GetFindingRecommendationCommandOutput
201206
| GetFindingV2CommandOutput
207+
| GetFindingsStatisticsCommandOutput
202208
| GetGeneratedPolicyCommandOutput
203209
| ListAccessPreviewFindingsCommandOutput
204210
| ListAccessPreviewsCommandOutput
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,143 @@
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 { AccessAnalyzerClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../AccessAnalyzerClient";
8+
import { commonParams } from "../endpoint/EndpointParameters";
9+
import { GetFindingsStatisticsRequest, GetFindingsStatisticsResponse } from "../models/models_0";
10+
import { de_GetFindingsStatisticsCommand, se_GetFindingsStatisticsCommand } from "../protocols/Aws_restJson1";
11+
12+
/**
13+
* @public
14+
*/
15+
export type { __MetadataBearer };
16+
export { $Command };
17+
/**
18+
* @public
19+
*
20+
* The input for {@link GetFindingsStatisticsCommand}.
21+
*/
22+
export interface GetFindingsStatisticsCommandInput extends GetFindingsStatisticsRequest {}
23+
/**
24+
* @public
25+
*
26+
* The output of {@link GetFindingsStatisticsCommand}.
27+
*/
28+
export interface GetFindingsStatisticsCommandOutput extends GetFindingsStatisticsResponse, __MetadataBearer {}
29+
30+
/**
31+
* <p>Retrieves a list of aggregated finding statistics for an external access or unused
32+
* access analyzer.</p>
33+
* @example
34+
* Use a bare-bones client and the command you need to make an API call.
35+
* ```javascript
36+
* import { AccessAnalyzerClient, GetFindingsStatisticsCommand } from "@aws-sdk/client-accessanalyzer"; // ES Modules import
37+
* // const { AccessAnalyzerClient, GetFindingsStatisticsCommand } = require("@aws-sdk/client-accessanalyzer"); // CommonJS import
38+
* const client = new AccessAnalyzerClient(config);
39+
* const input = { // GetFindingsStatisticsRequest
40+
* analyzerArn: "STRING_VALUE", // required
41+
* };
42+
* const command = new GetFindingsStatisticsCommand(input);
43+
* const response = await client.send(command);
44+
* // { // GetFindingsStatisticsResponse
45+
* // findingsStatistics: [ // FindingsStatisticsList
46+
* // { // FindingsStatistics Union: only one key present
47+
* // externalAccessFindingsStatistics: { // ExternalAccessFindingsStatistics
48+
* // resourceTypeStatistics: { // ResourceTypeStatisticsMap
49+
* // "<keys>": { // ResourceTypeDetails
50+
* // totalActivePublic: Number("int"),
51+
* // totalActiveCrossAccount: Number("int"),
52+
* // },
53+
* // },
54+
* // totalActiveFindings: Number("int"),
55+
* // totalArchivedFindings: Number("int"),
56+
* // totalResolvedFindings: Number("int"),
57+
* // },
58+
* // unusedAccessFindingsStatistics: { // UnusedAccessFindingsStatistics
59+
* // unusedAccessTypeStatistics: [ // UnusedAccessTypeStatisticsList
60+
* // { // UnusedAccessTypeStatistics
61+
* // unusedAccessType: "STRING_VALUE",
62+
* // total: Number("int"),
63+
* // },
64+
* // ],
65+
* // topAccounts: [ // AccountAggregations
66+
* // { // FindingAggregationAccountDetails
67+
* // account: "STRING_VALUE",
68+
* // numberOfActiveFindings: Number("int"),
69+
* // details: { // FindingAggregationAccountDetailsMap
70+
* // "<keys>": Number("int"),
71+
* // },
72+
* // },
73+
* // ],
74+
* // totalActiveFindings: Number("int"),
75+
* // totalArchivedFindings: Number("int"),
76+
* // totalResolvedFindings: Number("int"),
77+
* // },
78+
* // },
79+
* // ],
80+
* // lastUpdatedAt: new Date("TIMESTAMP"),
81+
* // };
82+
*
83+
* ```
84+
*
85+
* @param GetFindingsStatisticsCommandInput - {@link GetFindingsStatisticsCommandInput}
86+
* @returns {@link GetFindingsStatisticsCommandOutput}
87+
* @see {@link GetFindingsStatisticsCommandInput} for command's `input` shape.
88+
* @see {@link GetFindingsStatisticsCommandOutput} for command's `response` shape.
89+
* @see {@link AccessAnalyzerClientResolvedConfig | config} for AccessAnalyzerClient's `config` shape.
90+
*
91+
* @throws {@link AccessDeniedException} (client fault)
92+
* <p>You do not have sufficient access to perform this action.</p>
93+
*
94+
* @throws {@link InternalServerException} (server fault)
95+
* <p>Internal server error.</p>
96+
*
97+
* @throws {@link ResourceNotFoundException} (client fault)
98+
* <p>The specified resource could not be found.</p>
99+
*
100+
* @throws {@link ThrottlingException} (client fault)
101+
* <p>Throttling limit exceeded error.</p>
102+
*
103+
* @throws {@link ValidationException} (client fault)
104+
* <p>Validation exception error.</p>
105+
*
106+
* @throws {@link AccessAnalyzerServiceException}
107+
* <p>Base exception class for all service exceptions from AccessAnalyzer service.</p>
108+
*
109+
* @public
110+
*/
111+
export class GetFindingsStatisticsCommand extends $Command
112+
.classBuilder<
113+
GetFindingsStatisticsCommandInput,
114+
GetFindingsStatisticsCommandOutput,
115+
AccessAnalyzerClientResolvedConfig,
116+
ServiceInputTypes,
117+
ServiceOutputTypes
118+
>()
119+
.ep(commonParams)
120+
.m(function (this: any, Command: any, cs: any, config: AccessAnalyzerClientResolvedConfig, o: any) {
121+
return [
122+
getSerdePlugin(config, this.serialize, this.deserialize),
123+
getEndpointPlugin(config, Command.getEndpointParameterInstructions()),
124+
];
125+
})
126+
.s("AccessAnalyzer", "GetFindingsStatistics", {})
127+
.n("AccessAnalyzerClient", "GetFindingsStatisticsCommand")
128+
.f(void 0, void 0)
129+
.ser(se_GetFindingsStatisticsCommand)
130+
.de(de_GetFindingsStatisticsCommand)
131+
.build() {
132+
/** @internal type navigation helper, not in runtime. */
133+
protected declare static __types: {
134+
api: {
135+
input: GetFindingsStatisticsRequest;
136+
output: GetFindingsStatisticsResponse;
137+
};
138+
sdk: {
139+
input: GetFindingsStatisticsCommandInput;
140+
output: GetFindingsStatisticsCommandOutput;
141+
};
142+
};
143+
}

Diff for: clients/client-accessanalyzer/src/commands/index.ts

+1
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ export * from "./GetArchiveRuleCommand";
1717
export * from "./GetFindingCommand";
1818
export * from "./GetFindingRecommendationCommand";
1919
export * from "./GetFindingV2Command";
20+
export * from "./GetFindingsStatisticsCommand";
2021
export * from "./GetGeneratedPolicyCommand";
2122
export * from "./ListAccessPreviewFindingsCommand";
2223
export * from "./ListAccessPreviewsCommand";

0 commit comments

Comments
 (0)