Skip to content

Commit 8b83e9a

Browse files
author
awstools
committed
feat(client-resiliencehub): Drift Detection capability added when applications policy has moved from a meet to breach state. Customers will be able to exclude operational recommendations and receive credit in their resilience score. Customers can now add ARH permissions to an existing or new role.
1 parent e96bea8 commit 8b83e9a

25 files changed

+3202
-729
lines changed

clients/client-resiliencehub/README.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -214,6 +214,14 @@ AddDraftAppVersionResourceMappings
214214

215215
[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-resiliencehub/classes/adddraftappversionresourcemappingscommand.html) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-resiliencehub/interfaces/adddraftappversionresourcemappingscommandinput.html) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-resiliencehub/interfaces/adddraftappversionresourcemappingscommandoutput.html)
216216

217+
</details>
218+
<details>
219+
<summary>
220+
BatchUpdateRecommendationStatus
221+
</summary>
222+
223+
[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-resiliencehub/classes/batchupdaterecommendationstatuscommand.html) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-resiliencehub/interfaces/batchupdaterecommendationstatuscommandinput.html) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-resiliencehub/interfaces/batchupdaterecommendationstatuscommandoutput.html)
224+
217225
</details>
218226
<details>
219227
<summary>
@@ -398,6 +406,14 @@ ListAlarmRecommendations
398406

399407
[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-resiliencehub/classes/listalarmrecommendationscommand.html) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-resiliencehub/interfaces/listalarmrecommendationscommandinput.html) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-resiliencehub/interfaces/listalarmrecommendationscommandoutput.html)
400408

409+
</details>
410+
<details>
411+
<summary>
412+
ListAppAssessmentComplianceDrifts
413+
</summary>
414+
415+
[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-resiliencehub/classes/listappassessmentcompliancedriftscommand.html) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-resiliencehub/interfaces/listappassessmentcompliancedriftscommandinput.html) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-resiliencehub/interfaces/listappassessmentcompliancedriftscommandoutput.html)
416+
401417
</details>
402418
<details>
403419
<summary>

clients/client-resiliencehub/src/Resiliencehub.ts

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,11 @@ import {
77
AddDraftAppVersionResourceMappingsCommandInput,
88
AddDraftAppVersionResourceMappingsCommandOutput,
99
} from "./commands/AddDraftAppVersionResourceMappingsCommand";
10+
import {
11+
BatchUpdateRecommendationStatusCommand,
12+
BatchUpdateRecommendationStatusCommandInput,
13+
BatchUpdateRecommendationStatusCommandOutput,
14+
} from "./commands/BatchUpdateRecommendationStatusCommand";
1015
import { CreateAppCommand, CreateAppCommandInput, CreateAppCommandOutput } from "./commands/CreateAppCommand";
1116
import {
1217
CreateAppVersionAppComponentCommand,
@@ -110,6 +115,11 @@ import {
110115
ListAlarmRecommendationsCommandInput,
111116
ListAlarmRecommendationsCommandOutput,
112117
} from "./commands/ListAlarmRecommendationsCommand";
118+
import {
119+
ListAppAssessmentComplianceDriftsCommand,
120+
ListAppAssessmentComplianceDriftsCommandInput,
121+
ListAppAssessmentComplianceDriftsCommandOutput,
122+
} from "./commands/ListAppAssessmentComplianceDriftsCommand";
113123
import {
114124
ListAppAssessmentsCommand,
115125
ListAppAssessmentsCommandInput,
@@ -242,6 +252,7 @@ import { ResiliencehubClient, ResiliencehubClientConfig } from "./ResiliencehubC
242252

243253
const commands = {
244254
AddDraftAppVersionResourceMappingsCommand,
255+
BatchUpdateRecommendationStatusCommand,
245256
CreateAppCommand,
246257
CreateAppVersionAppComponentCommand,
247258
CreateAppVersionResourceCommand,
@@ -265,6 +276,7 @@ const commands = {
265276
DescribeResiliencyPolicyCommand,
266277
ImportResourcesToDraftAppVersionCommand,
267278
ListAlarmRecommendationsCommand,
279+
ListAppAssessmentComplianceDriftsCommand,
268280
ListAppAssessmentsCommand,
269281
ListAppComponentCompliancesCommand,
270282
ListAppComponentRecommendationsCommand,
@@ -313,6 +325,23 @@ export interface Resiliencehub {
313325
cb: (err: any, data?: AddDraftAppVersionResourceMappingsCommandOutput) => void
314326
): void;
315327

328+
/**
329+
* @see {@link BatchUpdateRecommendationStatusCommand}
330+
*/
331+
batchUpdateRecommendationStatus(
332+
args: BatchUpdateRecommendationStatusCommandInput,
333+
options?: __HttpHandlerOptions
334+
): Promise<BatchUpdateRecommendationStatusCommandOutput>;
335+
batchUpdateRecommendationStatus(
336+
args: BatchUpdateRecommendationStatusCommandInput,
337+
cb: (err: any, data?: BatchUpdateRecommendationStatusCommandOutput) => void
338+
): void;
339+
batchUpdateRecommendationStatus(
340+
args: BatchUpdateRecommendationStatusCommandInput,
341+
options: __HttpHandlerOptions,
342+
cb: (err: any, data?: BatchUpdateRecommendationStatusCommandOutput) => void
343+
): void;
344+
316345
/**
317346
* @see {@link CreateAppCommand}
318347
*/
@@ -686,6 +715,23 @@ export interface Resiliencehub {
686715
cb: (err: any, data?: ListAlarmRecommendationsCommandOutput) => void
687716
): void;
688717

718+
/**
719+
* @see {@link ListAppAssessmentComplianceDriftsCommand}
720+
*/
721+
listAppAssessmentComplianceDrifts(
722+
args: ListAppAssessmentComplianceDriftsCommandInput,
723+
options?: __HttpHandlerOptions
724+
): Promise<ListAppAssessmentComplianceDriftsCommandOutput>;
725+
listAppAssessmentComplianceDrifts(
726+
args: ListAppAssessmentComplianceDriftsCommandInput,
727+
cb: (err: any, data?: ListAppAssessmentComplianceDriftsCommandOutput) => void
728+
): void;
729+
listAppAssessmentComplianceDrifts(
730+
args: ListAppAssessmentComplianceDriftsCommandInput,
731+
options: __HttpHandlerOptions,
732+
cb: (err: any, data?: ListAppAssessmentComplianceDriftsCommandOutput) => void
733+
): void;
734+
689735
/**
690736
* @see {@link ListAppAssessmentsCommand}
691737
*/

clients/client-resiliencehub/src/ResiliencehubClient.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,10 @@ import {
5353
AddDraftAppVersionResourceMappingsCommandInput,
5454
AddDraftAppVersionResourceMappingsCommandOutput,
5555
} from "./commands/AddDraftAppVersionResourceMappingsCommand";
56+
import {
57+
BatchUpdateRecommendationStatusCommandInput,
58+
BatchUpdateRecommendationStatusCommandOutput,
59+
} from "./commands/BatchUpdateRecommendationStatusCommand";
5660
import { CreateAppCommandInput, CreateAppCommandOutput } from "./commands/CreateAppCommand";
5761
import {
5862
CreateAppVersionAppComponentCommandInput,
@@ -133,6 +137,10 @@ import {
133137
ListAlarmRecommendationsCommandInput,
134138
ListAlarmRecommendationsCommandOutput,
135139
} from "./commands/ListAlarmRecommendationsCommand";
140+
import {
141+
ListAppAssessmentComplianceDriftsCommandInput,
142+
ListAppAssessmentComplianceDriftsCommandOutput,
143+
} from "./commands/ListAppAssessmentComplianceDriftsCommand";
136144
import { ListAppAssessmentsCommandInput, ListAppAssessmentsCommandOutput } from "./commands/ListAppAssessmentsCommand";
137145
import {
138146
ListAppComponentCompliancesCommandInput,
@@ -233,6 +241,7 @@ export { __Client };
233241
*/
234242
export type ServiceInputTypes =
235243
| AddDraftAppVersionResourceMappingsCommandInput
244+
| BatchUpdateRecommendationStatusCommandInput
236245
| CreateAppCommandInput
237246
| CreateAppVersionAppComponentCommandInput
238247
| CreateAppVersionResourceCommandInput
@@ -256,6 +265,7 @@ export type ServiceInputTypes =
256265
| DescribeResiliencyPolicyCommandInput
257266
| ImportResourcesToDraftAppVersionCommandInput
258267
| ListAlarmRecommendationsCommandInput
268+
| ListAppAssessmentComplianceDriftsCommandInput
259269
| ListAppAssessmentsCommandInput
260270
| ListAppComponentCompliancesCommandInput
261271
| ListAppComponentRecommendationsCommandInput
@@ -290,6 +300,7 @@ export type ServiceInputTypes =
290300
*/
291301
export type ServiceOutputTypes =
292302
| AddDraftAppVersionResourceMappingsCommandOutput
303+
| BatchUpdateRecommendationStatusCommandOutput
293304
| CreateAppCommandOutput
294305
| CreateAppVersionAppComponentCommandOutput
295306
| CreateAppVersionResourceCommandOutput
@@ -313,6 +324,7 @@ export type ServiceOutputTypes =
313324
| DescribeResiliencyPolicyCommandOutput
314325
| ImportResourcesToDraftAppVersionCommandOutput
315326
| ListAlarmRecommendationsCommandOutput
327+
| ListAppAssessmentComplianceDriftsCommandOutput
316328
| ListAppAssessmentsCommandOutput
317329
| ListAppComponentCompliancesCommandOutput
318330
| ListAppComponentRecommendationsCommandOutput

clients/client-resiliencehub/src/commands/AddDraftAppVersionResourceMappingsCommand.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,8 @@ export interface AddDraftAppVersionResourceMappingsCommandOutput
4444

4545
/**
4646
* @public
47-
* <p>Adds the resource mapping for the draft application version. You can also update an existing resource mapping to a new physical resource.</p>
47+
* <p>Adds the resource mapping for the draft application version. You can also update an
48+
* existing resource mapping to a new physical resource.</p>
4849
* @example
4950
* Use a bare-bones client and the command you need to make an API call.
5051
* ```javascript
Lines changed: 203 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,203 @@
1+
// smithy-typescript generated code
2+
import { EndpointParameterInstructions, getEndpointPlugin } from "@smithy/middleware-endpoint";
3+
import { getSerdePlugin } from "@smithy/middleware-serde";
4+
import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http";
5+
import { Command as $Command } from "@smithy/smithy-client";
6+
import {
7+
FinalizeHandlerArguments,
8+
Handler,
9+
HandlerExecutionContext,
10+
HttpHandlerOptions as __HttpHandlerOptions,
11+
MetadataBearer as __MetadataBearer,
12+
MiddlewareStack,
13+
SerdeContext as __SerdeContext,
14+
} from "@smithy/types";
15+
16+
import { BatchUpdateRecommendationStatusRequest, BatchUpdateRecommendationStatusResponse } from "../models/models_0";
17+
import {
18+
de_BatchUpdateRecommendationStatusCommand,
19+
se_BatchUpdateRecommendationStatusCommand,
20+
} from "../protocols/Aws_restJson1";
21+
import { ResiliencehubClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../ResiliencehubClient";
22+
23+
/**
24+
* @public
25+
*/
26+
export { __MetadataBearer, $Command };
27+
/**
28+
* @public
29+
*
30+
* The input for {@link BatchUpdateRecommendationStatusCommand}.
31+
*/
32+
export interface BatchUpdateRecommendationStatusCommandInput extends BatchUpdateRecommendationStatusRequest {}
33+
/**
34+
* @public
35+
*
36+
* The output of {@link BatchUpdateRecommendationStatusCommand}.
37+
*/
38+
export interface BatchUpdateRecommendationStatusCommandOutput
39+
extends BatchUpdateRecommendationStatusResponse,
40+
__MetadataBearer {}
41+
42+
/**
43+
* @public
44+
* <p>Enables you to include or exclude one or more operational recommendations.</p>
45+
* @example
46+
* Use a bare-bones client and the command you need to make an API call.
47+
* ```javascript
48+
* import { ResiliencehubClient, BatchUpdateRecommendationStatusCommand } from "@aws-sdk/client-resiliencehub"; // ES Modules import
49+
* // const { ResiliencehubClient, BatchUpdateRecommendationStatusCommand } = require("@aws-sdk/client-resiliencehub"); // CommonJS import
50+
* const client = new ResiliencehubClient(config);
51+
* const input = { // BatchUpdateRecommendationStatusRequest
52+
* appArn: "STRING_VALUE", // required
53+
* requestEntries: [ // UpdateRecommendationStatusRequestEntries // required
54+
* { // UpdateRecommendationStatusRequestEntry
55+
* entryId: "STRING_VALUE", // required
56+
* referenceId: "STRING_VALUE", // required
57+
* item: { // UpdateRecommendationStatusItem
58+
* resourceId: "STRING_VALUE",
59+
* targetAccountId: "STRING_VALUE",
60+
* targetRegion: "STRING_VALUE",
61+
* },
62+
* excluded: true || false, // required
63+
* excludeReason: "STRING_VALUE",
64+
* },
65+
* ],
66+
* };
67+
* const command = new BatchUpdateRecommendationStatusCommand(input);
68+
* const response = await client.send(command);
69+
* // { // BatchUpdateRecommendationStatusResponse
70+
* // appArn: "STRING_VALUE", // required
71+
* // successfulEntries: [ // BatchUpdateRecommendationStatusSuccessfulEntries // required
72+
* // { // BatchUpdateRecommendationStatusSuccessfulEntry
73+
* // entryId: "STRING_VALUE", // required
74+
* // referenceId: "STRING_VALUE", // required
75+
* // item: { // UpdateRecommendationStatusItem
76+
* // resourceId: "STRING_VALUE",
77+
* // targetAccountId: "STRING_VALUE",
78+
* // targetRegion: "STRING_VALUE",
79+
* // },
80+
* // excluded: true || false, // required
81+
* // excludeReason: "STRING_VALUE",
82+
* // },
83+
* // ],
84+
* // failedEntries: [ // BatchUpdateRecommendationStatusFailedEntries // required
85+
* // { // BatchUpdateRecommendationStatusFailedEntry
86+
* // entryId: "STRING_VALUE", // required
87+
* // errorMessage: "STRING_VALUE", // required
88+
* // },
89+
* // ],
90+
* // };
91+
*
92+
* ```
93+
*
94+
* @param BatchUpdateRecommendationStatusCommandInput - {@link BatchUpdateRecommendationStatusCommandInput}
95+
* @returns {@link BatchUpdateRecommendationStatusCommandOutput}
96+
* @see {@link BatchUpdateRecommendationStatusCommandInput} for command's `input` shape.
97+
* @see {@link BatchUpdateRecommendationStatusCommandOutput} for command's `response` shape.
98+
* @see {@link ResiliencehubClientResolvedConfig | config} for ResiliencehubClient's `config` shape.
99+
*
100+
* @throws {@link AccessDeniedException} (client fault)
101+
* <p>You don't have permissions to perform the requested operation. The user or role that is
102+
* making the request must have at least one IAM permissions policy attached that grants the
103+
* required permissions.</p>
104+
*
105+
* @throws {@link InternalServerException} (server fault)
106+
* <p>This exception occurs when there is an internal failure in the Resilience Hub
107+
* service.</p>
108+
*
109+
* @throws {@link ResourceNotFoundException} (client fault)
110+
* <p>This exception occurs when the specified resource could not be found.</p>
111+
*
112+
* @throws {@link ThrottlingException} (client fault)
113+
* <p>This exception occurs when you have exceeded the limit on the number of requests per second.</p>
114+
*
115+
* @throws {@link ValidationException} (client fault)
116+
* <p>This exception occurs when a request is not valid.</p>
117+
*
118+
* @throws {@link ResiliencehubServiceException}
119+
* <p>Base exception class for all service exceptions from Resiliencehub service.</p>
120+
*
121+
*/
122+
export class BatchUpdateRecommendationStatusCommand extends $Command<
123+
BatchUpdateRecommendationStatusCommandInput,
124+
BatchUpdateRecommendationStatusCommandOutput,
125+
ResiliencehubClientResolvedConfig
126+
> {
127+
// Start section: command_properties
128+
// End section: command_properties
129+
130+
public static getEndpointParameterInstructions(): EndpointParameterInstructions {
131+
return {
132+
UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" },
133+
Endpoint: { type: "builtInParams", name: "endpoint" },
134+
Region: { type: "builtInParams", name: "region" },
135+
UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" },
136+
};
137+
}
138+
139+
/**
140+
* @public
141+
*/
142+
constructor(readonly input: BatchUpdateRecommendationStatusCommandInput) {
143+
// Start section: command_constructor
144+
super();
145+
// End section: command_constructor
146+
}
147+
148+
/**
149+
* @internal
150+
*/
151+
resolveMiddleware(
152+
clientStack: MiddlewareStack<ServiceInputTypes, ServiceOutputTypes>,
153+
configuration: ResiliencehubClientResolvedConfig,
154+
options?: __HttpHandlerOptions
155+
): Handler<BatchUpdateRecommendationStatusCommandInput, BatchUpdateRecommendationStatusCommandOutput> {
156+
this.middlewareStack.use(getSerdePlugin(configuration, this.serialize, this.deserialize));
157+
this.middlewareStack.use(
158+
getEndpointPlugin(configuration, BatchUpdateRecommendationStatusCommand.getEndpointParameterInstructions())
159+
);
160+
161+
const stack = clientStack.concat(this.middlewareStack);
162+
163+
const { logger } = configuration;
164+
const clientName = "ResiliencehubClient";
165+
const commandName = "BatchUpdateRecommendationStatusCommand";
166+
const handlerExecutionContext: HandlerExecutionContext = {
167+
logger,
168+
clientName,
169+
commandName,
170+
inputFilterSensitiveLog: (_: any) => _,
171+
outputFilterSensitiveLog: (_: any) => _,
172+
};
173+
const { requestHandler } = configuration;
174+
return stack.resolve(
175+
(request: FinalizeHandlerArguments<any>) =>
176+
requestHandler.handle(request.request as __HttpRequest, options || {}),
177+
handlerExecutionContext
178+
);
179+
}
180+
181+
/**
182+
* @internal
183+
*/
184+
private serialize(
185+
input: BatchUpdateRecommendationStatusCommandInput,
186+
context: __SerdeContext
187+
): Promise<__HttpRequest> {
188+
return se_BatchUpdateRecommendationStatusCommand(input, context);
189+
}
190+
191+
/**
192+
* @internal
193+
*/
194+
private deserialize(
195+
output: __HttpResponse,
196+
context: __SerdeContext
197+
): Promise<BatchUpdateRecommendationStatusCommandOutput> {
198+
return de_BatchUpdateRecommendationStatusCommand(output, context);
199+
}
200+
201+
// Start section: command_body_extra
202+
// End section: command_body_extra
203+
}

0 commit comments

Comments
 (0)