Skip to content

Commit b2df1e1

Browse files
author
awstools
committed
feat(client-accessanalyzer): Expand analyzer configuration capabilities for unused access analyzers. Unused access analyzer configurations now support the ability to exclude accounts and resource tags from analysis providing more granular control over the scope of analysis.
1 parent ba1bdcc commit b2df1e1

12 files changed

+524
-18
lines changed

clients/client-accessanalyzer/README.md

+8
Original file line numberDiff line numberDiff line change
@@ -481,6 +481,14 @@ UntagResource
481481

482482
[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/accessanalyzer/command/UntagResourceCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-accessanalyzer/Interface/UntagResourceCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-accessanalyzer/Interface/UntagResourceCommandOutput/)
483483

484+
</details>
485+
<details>
486+
<summary>
487+
UpdateAnalyzer
488+
</summary>
489+
490+
[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/accessanalyzer/command/UpdateAnalyzerCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-accessanalyzer/Interface/UpdateAnalyzerCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-accessanalyzer/Interface/UpdateAnalyzerCommandOutput/)
491+
484492
</details>
485493
<details>
486494
<summary>

clients/client-accessanalyzer/src/AccessAnalyzer.ts

+20
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,11 @@ import {
151151
UntagResourceCommandInput,
152152
UntagResourceCommandOutput,
153153
} from "./commands/UntagResourceCommand";
154+
import {
155+
UpdateAnalyzerCommand,
156+
UpdateAnalyzerCommandInput,
157+
UpdateAnalyzerCommandOutput,
158+
} from "./commands/UpdateAnalyzerCommand";
154159
import {
155160
UpdateArchiveRuleCommand,
156161
UpdateArchiveRuleCommandInput,
@@ -200,6 +205,7 @@ const commands = {
200205
StartResourceScanCommand,
201206
TagResourceCommand,
202207
UntagResourceCommand,
208+
UpdateAnalyzerCommand,
203209
UpdateArchiveRuleCommand,
204210
UpdateFindingsCommand,
205211
ValidatePolicyCommand,
@@ -698,6 +704,20 @@ export interface AccessAnalyzer {
698704
cb: (err: any, data?: UntagResourceCommandOutput) => void
699705
): void;
700706

707+
/**
708+
* @see {@link UpdateAnalyzerCommand}
709+
*/
710+
updateAnalyzer(
711+
args: UpdateAnalyzerCommandInput,
712+
options?: __HttpHandlerOptions
713+
): Promise<UpdateAnalyzerCommandOutput>;
714+
updateAnalyzer(args: UpdateAnalyzerCommandInput, cb: (err: any, data?: UpdateAnalyzerCommandOutput) => void): void;
715+
updateAnalyzer(
716+
args: UpdateAnalyzerCommandInput,
717+
options: __HttpHandlerOptions,
718+
cb: (err: any, data?: UpdateAnalyzerCommandOutput) => void
719+
): void;
720+
701721
/**
702722
* @see {@link UpdateArchiveRuleCommand}
703723
*/

clients/client-accessanalyzer/src/AccessAnalyzerClient.ts

+3
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,7 @@ import {
121121
import { StartResourceScanCommandInput, StartResourceScanCommandOutput } from "./commands/StartResourceScanCommand";
122122
import { TagResourceCommandInput, TagResourceCommandOutput } from "./commands/TagResourceCommand";
123123
import { UntagResourceCommandInput, UntagResourceCommandOutput } from "./commands/UntagResourceCommand";
124+
import { UpdateAnalyzerCommandInput, UpdateAnalyzerCommandOutput } from "./commands/UpdateAnalyzerCommand";
124125
import { UpdateArchiveRuleCommandInput, UpdateArchiveRuleCommandOutput } from "./commands/UpdateArchiveRuleCommand";
125126
import { UpdateFindingsCommandInput, UpdateFindingsCommandOutput } from "./commands/UpdateFindingsCommand";
126127
import { ValidatePolicyCommandInput, ValidatePolicyCommandOutput } from "./commands/ValidatePolicyCommand";
@@ -171,6 +172,7 @@ export type ServiceInputTypes =
171172
| StartResourceScanCommandInput
172173
| TagResourceCommandInput
173174
| UntagResourceCommandInput
175+
| UpdateAnalyzerCommandInput
174176
| UpdateArchiveRuleCommandInput
175177
| UpdateFindingsCommandInput
176178
| ValidatePolicyCommandInput;
@@ -211,6 +213,7 @@ export type ServiceOutputTypes =
211213
| StartResourceScanCommandOutput
212214
| TagResourceCommandOutput
213215
| UntagResourceCommandOutput
216+
| UpdateAnalyzerCommandOutput
214217
| UpdateArchiveRuleCommandOutput
215218
| UpdateFindingsCommandOutput
216219
| ValidatePolicyCommandOutput;

clients/client-accessanalyzer/src/commands/CreateAnalyzerCommand.ts

+14
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,20 @@ export interface CreateAnalyzerCommandOutput extends CreateAnalyzerResponse, __M
6464
* configuration: { // AnalyzerConfiguration Union: only one key present
6565
* unusedAccess: { // UnusedAccessConfiguration
6666
* unusedAccessAge: Number("int"),
67+
* analysisRule: { // AnalysisRule
68+
* exclusions: [ // AnalysisRuleCriteriaList
69+
* { // AnalysisRuleCriteria
70+
* accountIds: [ // AccountIdsList
71+
* "STRING_VALUE",
72+
* ],
73+
* resourceTags: [ // TagsList
74+
* {
75+
* "<keys>": "STRING_VALUE",
76+
* },
77+
* ],
78+
* },
79+
* ],
80+
* },
6781
* },
6882
* },
6983
* };

clients/client-accessanalyzer/src/commands/GetAnalyzerCommand.ts

+14
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,20 @@ export interface GetAnalyzerCommandOutput extends GetAnalyzerResponse, __Metadat
5858
* // configuration: { // AnalyzerConfiguration Union: only one key present
5959
* // unusedAccess: { // UnusedAccessConfiguration
6060
* // unusedAccessAge: Number("int"),
61+
* // analysisRule: { // AnalysisRule
62+
* // exclusions: [ // AnalysisRuleCriteriaList
63+
* // { // AnalysisRuleCriteria
64+
* // accountIds: [ // AccountIdsList
65+
* // "STRING_VALUE",
66+
* // ],
67+
* // resourceTags: [ // TagsList
68+
* // {
69+
* // "<keys>": "STRING_VALUE",
70+
* // },
71+
* // ],
72+
* // },
73+
* // ],
74+
* // },
6175
* // },
6276
* // },
6377
* // },

clients/client-accessanalyzer/src/commands/ListAnalyzedResourcesCommand.ts

+1-2
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,7 @@ export interface ListAnalyzedResourcesCommandOutput extends ListAnalyzedResource
2929

3030
/**
3131
* <p>Retrieves a list of resources of the specified type that have been analyzed by the
32-
* specified external access analyzer. This action is not supported for unused access
33-
* analyzers.</p>
32+
* specified analyzer.</p>
3433
* @example
3534
* Use a bare-bones client and the command you need to make an API call.
3635
* ```javascript

clients/client-accessanalyzer/src/commands/ListAnalyzersCommand.ts

+14
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,20 @@ export interface ListAnalyzersCommandOutput extends ListAnalyzersResponse, __Met
6161
* // configuration: { // AnalyzerConfiguration Union: only one key present
6262
* // unusedAccess: { // UnusedAccessConfiguration
6363
* // unusedAccessAge: Number("int"),
64+
* // analysisRule: { // AnalysisRule
65+
* // exclusions: [ // AnalysisRuleCriteriaList
66+
* // { // AnalysisRuleCriteria
67+
* // accountIds: [ // AccountIdsList
68+
* // "STRING_VALUE",
69+
* // ],
70+
* // resourceTags: [ // TagsList
71+
* // {
72+
* // "<keys>": "STRING_VALUE",
73+
* // },
74+
* // ],
75+
* // },
76+
* // ],
77+
* // },
6478
* // },
6579
* // },
6680
* // },
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,147 @@
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 { UpdateAnalyzerRequest, UpdateAnalyzerResponse } from "../models/models_0";
10+
import { de_UpdateAnalyzerCommand, se_UpdateAnalyzerCommand } 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 UpdateAnalyzerCommand}.
21+
*/
22+
export interface UpdateAnalyzerCommandInput extends UpdateAnalyzerRequest {}
23+
/**
24+
* @public
25+
*
26+
* The output of {@link UpdateAnalyzerCommand}.
27+
*/
28+
export interface UpdateAnalyzerCommandOutput extends UpdateAnalyzerResponse, __MetadataBearer {}
29+
30+
/**
31+
* <p>Modifies the configuration of an existing analyzer.</p>
32+
* @example
33+
* Use a bare-bones client and the command you need to make an API call.
34+
* ```javascript
35+
* import { AccessAnalyzerClient, UpdateAnalyzerCommand } from "@aws-sdk/client-accessanalyzer"; // ES Modules import
36+
* // const { AccessAnalyzerClient, UpdateAnalyzerCommand } = require("@aws-sdk/client-accessanalyzer"); // CommonJS import
37+
* const client = new AccessAnalyzerClient(config);
38+
* const input = { // UpdateAnalyzerRequest
39+
* analyzerName: "STRING_VALUE", // required
40+
* configuration: { // AnalyzerConfiguration Union: only one key present
41+
* unusedAccess: { // UnusedAccessConfiguration
42+
* unusedAccessAge: Number("int"),
43+
* analysisRule: { // AnalysisRule
44+
* exclusions: [ // AnalysisRuleCriteriaList
45+
* { // AnalysisRuleCriteria
46+
* accountIds: [ // AccountIdsList
47+
* "STRING_VALUE",
48+
* ],
49+
* resourceTags: [ // TagsList
50+
* { // TagsMap
51+
* "<keys>": "STRING_VALUE",
52+
* },
53+
* ],
54+
* },
55+
* ],
56+
* },
57+
* },
58+
* },
59+
* };
60+
* const command = new UpdateAnalyzerCommand(input);
61+
* const response = await client.send(command);
62+
* // { // UpdateAnalyzerResponse
63+
* // configuration: { // AnalyzerConfiguration Union: only one key present
64+
* // unusedAccess: { // UnusedAccessConfiguration
65+
* // unusedAccessAge: Number("int"),
66+
* // analysisRule: { // AnalysisRule
67+
* // exclusions: [ // AnalysisRuleCriteriaList
68+
* // { // AnalysisRuleCriteria
69+
* // accountIds: [ // AccountIdsList
70+
* // "STRING_VALUE",
71+
* // ],
72+
* // resourceTags: [ // TagsList
73+
* // { // TagsMap
74+
* // "<keys>": "STRING_VALUE",
75+
* // },
76+
* // ],
77+
* // },
78+
* // ],
79+
* // },
80+
* // },
81+
* // },
82+
* // };
83+
*
84+
* ```
85+
*
86+
* @param UpdateAnalyzerCommandInput - {@link UpdateAnalyzerCommandInput}
87+
* @returns {@link UpdateAnalyzerCommandOutput}
88+
* @see {@link UpdateAnalyzerCommandInput} for command's `input` shape.
89+
* @see {@link UpdateAnalyzerCommandOutput} for command's `response` shape.
90+
* @see {@link AccessAnalyzerClientResolvedConfig | config} for AccessAnalyzerClient's `config` shape.
91+
*
92+
* @throws {@link AccessDeniedException} (client fault)
93+
* <p>You do not have sufficient access to perform this action.</p>
94+
*
95+
* @throws {@link ConflictException} (client fault)
96+
* <p>A conflict exception error.</p>
97+
*
98+
* @throws {@link InternalServerException} (server fault)
99+
* <p>Internal server error.</p>
100+
*
101+
* @throws {@link ResourceNotFoundException} (client fault)
102+
* <p>The specified resource could not be found.</p>
103+
*
104+
* @throws {@link ThrottlingException} (client fault)
105+
* <p>Throttling limit exceeded error.</p>
106+
*
107+
* @throws {@link ValidationException} (client fault)
108+
* <p>Validation exception error.</p>
109+
*
110+
* @throws {@link AccessAnalyzerServiceException}
111+
* <p>Base exception class for all service exceptions from AccessAnalyzer service.</p>
112+
*
113+
* @public
114+
*/
115+
export class UpdateAnalyzerCommand extends $Command
116+
.classBuilder<
117+
UpdateAnalyzerCommandInput,
118+
UpdateAnalyzerCommandOutput,
119+
AccessAnalyzerClientResolvedConfig,
120+
ServiceInputTypes,
121+
ServiceOutputTypes
122+
>()
123+
.ep(commonParams)
124+
.m(function (this: any, Command: any, cs: any, config: AccessAnalyzerClientResolvedConfig, o: any) {
125+
return [
126+
getSerdePlugin(config, this.serialize, this.deserialize),
127+
getEndpointPlugin(config, Command.getEndpointParameterInstructions()),
128+
];
129+
})
130+
.s("AccessAnalyzer", "UpdateAnalyzer", {})
131+
.n("AccessAnalyzerClient", "UpdateAnalyzerCommand")
132+
.f(void 0, void 0)
133+
.ser(se_UpdateAnalyzerCommand)
134+
.de(de_UpdateAnalyzerCommand)
135+
.build() {
136+
/** @internal type navigation helper, not in runtime. */
137+
protected declare static __types: {
138+
api: {
139+
input: UpdateAnalyzerRequest;
140+
output: UpdateAnalyzerResponse;
141+
};
142+
sdk: {
143+
input: UpdateAnalyzerCommandInput;
144+
output: UpdateAnalyzerCommandOutput;
145+
};
146+
};
147+
}

clients/client-accessanalyzer/src/commands/index.ts

+1
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ export * from "./StartPolicyGenerationCommand";
3131
export * from "./StartResourceScanCommand";
3232
export * from "./TagResourceCommand";
3333
export * from "./UntagResourceCommand";
34+
export * from "./UpdateAnalyzerCommand";
3435
export * from "./UpdateArchiveRuleCommand";
3536
export * from "./UpdateFindingsCommand";
3637
export * from "./ValidatePolicyCommand";

0 commit comments

Comments
 (0)