Skip to content

Commit

Permalink
feat(client-resiliencehub): Drift Detection capability added when app…
Browse files Browse the repository at this point in the history
…lications 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.
  • Loading branch information
awstools committed Aug 2, 2023
1 parent e96bea8 commit 8b83e9a
Show file tree
Hide file tree
Showing 25 changed files with 3,202 additions and 729 deletions.
16 changes: 16 additions & 0 deletions clients/client-resiliencehub/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,14 @@ AddDraftAppVersionResourceMappings

[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)

</details>
<details>
<summary>
BatchUpdateRecommendationStatus
</summary>

[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)

</details>
<details>
<summary>
Expand Down Expand Up @@ -398,6 +406,14 @@ ListAlarmRecommendations

[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)

</details>
<details>
<summary>
ListAppAssessmentComplianceDrifts
</summary>

[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)

</details>
<details>
<summary>
Expand Down
46 changes: 46 additions & 0 deletions clients/client-resiliencehub/src/Resiliencehub.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@ import {
AddDraftAppVersionResourceMappingsCommandInput,
AddDraftAppVersionResourceMappingsCommandOutput,
} from "./commands/AddDraftAppVersionResourceMappingsCommand";
import {
BatchUpdateRecommendationStatusCommand,
BatchUpdateRecommendationStatusCommandInput,
BatchUpdateRecommendationStatusCommandOutput,
} from "./commands/BatchUpdateRecommendationStatusCommand";
import { CreateAppCommand, CreateAppCommandInput, CreateAppCommandOutput } from "./commands/CreateAppCommand";
import {
CreateAppVersionAppComponentCommand,
Expand Down Expand Up @@ -110,6 +115,11 @@ import {
ListAlarmRecommendationsCommandInput,
ListAlarmRecommendationsCommandOutput,
} from "./commands/ListAlarmRecommendationsCommand";
import {
ListAppAssessmentComplianceDriftsCommand,
ListAppAssessmentComplianceDriftsCommandInput,
ListAppAssessmentComplianceDriftsCommandOutput,
} from "./commands/ListAppAssessmentComplianceDriftsCommand";
import {
ListAppAssessmentsCommand,
ListAppAssessmentsCommandInput,
Expand Down Expand Up @@ -242,6 +252,7 @@ import { ResiliencehubClient, ResiliencehubClientConfig } from "./ResiliencehubC

const commands = {
AddDraftAppVersionResourceMappingsCommand,
BatchUpdateRecommendationStatusCommand,
CreateAppCommand,
CreateAppVersionAppComponentCommand,
CreateAppVersionResourceCommand,
Expand All @@ -265,6 +276,7 @@ const commands = {
DescribeResiliencyPolicyCommand,
ImportResourcesToDraftAppVersionCommand,
ListAlarmRecommendationsCommand,
ListAppAssessmentComplianceDriftsCommand,
ListAppAssessmentsCommand,
ListAppComponentCompliancesCommand,
ListAppComponentRecommendationsCommand,
Expand Down Expand Up @@ -313,6 +325,23 @@ export interface Resiliencehub {
cb: (err: any, data?: AddDraftAppVersionResourceMappingsCommandOutput) => void
): void;

/**
* @see {@link BatchUpdateRecommendationStatusCommand}
*/
batchUpdateRecommendationStatus(
args: BatchUpdateRecommendationStatusCommandInput,
options?: __HttpHandlerOptions
): Promise<BatchUpdateRecommendationStatusCommandOutput>;
batchUpdateRecommendationStatus(
args: BatchUpdateRecommendationStatusCommandInput,
cb: (err: any, data?: BatchUpdateRecommendationStatusCommandOutput) => void
): void;
batchUpdateRecommendationStatus(
args: BatchUpdateRecommendationStatusCommandInput,
options: __HttpHandlerOptions,
cb: (err: any, data?: BatchUpdateRecommendationStatusCommandOutput) => void
): void;

/**
* @see {@link CreateAppCommand}
*/
Expand Down Expand Up @@ -686,6 +715,23 @@ export interface Resiliencehub {
cb: (err: any, data?: ListAlarmRecommendationsCommandOutput) => void
): void;

/**
* @see {@link ListAppAssessmentComplianceDriftsCommand}
*/
listAppAssessmentComplianceDrifts(
args: ListAppAssessmentComplianceDriftsCommandInput,
options?: __HttpHandlerOptions
): Promise<ListAppAssessmentComplianceDriftsCommandOutput>;
listAppAssessmentComplianceDrifts(
args: ListAppAssessmentComplianceDriftsCommandInput,
cb: (err: any, data?: ListAppAssessmentComplianceDriftsCommandOutput) => void
): void;
listAppAssessmentComplianceDrifts(
args: ListAppAssessmentComplianceDriftsCommandInput,
options: __HttpHandlerOptions,
cb: (err: any, data?: ListAppAssessmentComplianceDriftsCommandOutput) => void
): void;

/**
* @see {@link ListAppAssessmentsCommand}
*/
Expand Down
12 changes: 12 additions & 0 deletions clients/client-resiliencehub/src/ResiliencehubClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,10 @@ import {
AddDraftAppVersionResourceMappingsCommandInput,
AddDraftAppVersionResourceMappingsCommandOutput,
} from "./commands/AddDraftAppVersionResourceMappingsCommand";
import {
BatchUpdateRecommendationStatusCommandInput,
BatchUpdateRecommendationStatusCommandOutput,
} from "./commands/BatchUpdateRecommendationStatusCommand";
import { CreateAppCommandInput, CreateAppCommandOutput } from "./commands/CreateAppCommand";
import {
CreateAppVersionAppComponentCommandInput,
Expand Down Expand Up @@ -133,6 +137,10 @@ import {
ListAlarmRecommendationsCommandInput,
ListAlarmRecommendationsCommandOutput,
} from "./commands/ListAlarmRecommendationsCommand";
import {
ListAppAssessmentComplianceDriftsCommandInput,
ListAppAssessmentComplianceDriftsCommandOutput,
} from "./commands/ListAppAssessmentComplianceDriftsCommand";
import { ListAppAssessmentsCommandInput, ListAppAssessmentsCommandOutput } from "./commands/ListAppAssessmentsCommand";
import {
ListAppComponentCompliancesCommandInput,
Expand Down Expand Up @@ -233,6 +241,7 @@ export { __Client };
*/
export type ServiceInputTypes =
| AddDraftAppVersionResourceMappingsCommandInput
| BatchUpdateRecommendationStatusCommandInput
| CreateAppCommandInput
| CreateAppVersionAppComponentCommandInput
| CreateAppVersionResourceCommandInput
Expand All @@ -256,6 +265,7 @@ export type ServiceInputTypes =
| DescribeResiliencyPolicyCommandInput
| ImportResourcesToDraftAppVersionCommandInput
| ListAlarmRecommendationsCommandInput
| ListAppAssessmentComplianceDriftsCommandInput
| ListAppAssessmentsCommandInput
| ListAppComponentCompliancesCommandInput
| ListAppComponentRecommendationsCommandInput
Expand Down Expand Up @@ -290,6 +300,7 @@ export type ServiceInputTypes =
*/
export type ServiceOutputTypes =
| AddDraftAppVersionResourceMappingsCommandOutput
| BatchUpdateRecommendationStatusCommandOutput
| CreateAppCommandOutput
| CreateAppVersionAppComponentCommandOutput
| CreateAppVersionResourceCommandOutput
Expand All @@ -313,6 +324,7 @@ export type ServiceOutputTypes =
| DescribeResiliencyPolicyCommandOutput
| ImportResourcesToDraftAppVersionCommandOutput
| ListAlarmRecommendationsCommandOutput
| ListAppAssessmentComplianceDriftsCommandOutput
| ListAppAssessmentsCommandOutput
| ListAppComponentCompliancesCommandOutput
| ListAppComponentRecommendationsCommandOutput
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,8 @@ export interface AddDraftAppVersionResourceMappingsCommandOutput

/**
* @public
* <p>Adds the resource mapping for the draft application version. You can also update an existing resource mapping to a new physical resource.</p>
* <p>Adds the resource mapping for the draft application version. You can also update an
* existing resource mapping to a new physical resource.</p>
* @example
* Use a bare-bones client and the command you need to make an API call.
* ```javascript
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,203 @@
// smithy-typescript generated code
import { EndpointParameterInstructions, getEndpointPlugin } from "@smithy/middleware-endpoint";
import { getSerdePlugin } from "@smithy/middleware-serde";
import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http";
import { Command as $Command } from "@smithy/smithy-client";
import {
FinalizeHandlerArguments,
Handler,
HandlerExecutionContext,
HttpHandlerOptions as __HttpHandlerOptions,
MetadataBearer as __MetadataBearer,
MiddlewareStack,
SerdeContext as __SerdeContext,
} from "@smithy/types";

import { BatchUpdateRecommendationStatusRequest, BatchUpdateRecommendationStatusResponse } from "../models/models_0";
import {
de_BatchUpdateRecommendationStatusCommand,
se_BatchUpdateRecommendationStatusCommand,
} from "../protocols/Aws_restJson1";
import { ResiliencehubClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../ResiliencehubClient";

/**
* @public
*/
export { __MetadataBearer, $Command };
/**
* @public
*
* The input for {@link BatchUpdateRecommendationStatusCommand}.
*/
export interface BatchUpdateRecommendationStatusCommandInput extends BatchUpdateRecommendationStatusRequest {}
/**
* @public
*
* The output of {@link BatchUpdateRecommendationStatusCommand}.
*/
export interface BatchUpdateRecommendationStatusCommandOutput
extends BatchUpdateRecommendationStatusResponse,
__MetadataBearer {}

/**
* @public
* <p>Enables you to include or exclude one or more operational recommendations.</p>
* @example
* Use a bare-bones client and the command you need to make an API call.
* ```javascript
* import { ResiliencehubClient, BatchUpdateRecommendationStatusCommand } from "@aws-sdk/client-resiliencehub"; // ES Modules import
* // const { ResiliencehubClient, BatchUpdateRecommendationStatusCommand } = require("@aws-sdk/client-resiliencehub"); // CommonJS import
* const client = new ResiliencehubClient(config);
* const input = { // BatchUpdateRecommendationStatusRequest
* appArn: "STRING_VALUE", // required
* requestEntries: [ // UpdateRecommendationStatusRequestEntries // required
* { // UpdateRecommendationStatusRequestEntry
* entryId: "STRING_VALUE", // required
* referenceId: "STRING_VALUE", // required
* item: { // UpdateRecommendationStatusItem
* resourceId: "STRING_VALUE",
* targetAccountId: "STRING_VALUE",
* targetRegion: "STRING_VALUE",
* },
* excluded: true || false, // required
* excludeReason: "STRING_VALUE",
* },
* ],
* };
* const command = new BatchUpdateRecommendationStatusCommand(input);
* const response = await client.send(command);
* // { // BatchUpdateRecommendationStatusResponse
* // appArn: "STRING_VALUE", // required
* // successfulEntries: [ // BatchUpdateRecommendationStatusSuccessfulEntries // required
* // { // BatchUpdateRecommendationStatusSuccessfulEntry
* // entryId: "STRING_VALUE", // required
* // referenceId: "STRING_VALUE", // required
* // item: { // UpdateRecommendationStatusItem
* // resourceId: "STRING_VALUE",
* // targetAccountId: "STRING_VALUE",
* // targetRegion: "STRING_VALUE",
* // },
* // excluded: true || false, // required
* // excludeReason: "STRING_VALUE",
* // },
* // ],
* // failedEntries: [ // BatchUpdateRecommendationStatusFailedEntries // required
* // { // BatchUpdateRecommendationStatusFailedEntry
* // entryId: "STRING_VALUE", // required
* // errorMessage: "STRING_VALUE", // required
* // },
* // ],
* // };
*
* ```
*
* @param BatchUpdateRecommendationStatusCommandInput - {@link BatchUpdateRecommendationStatusCommandInput}
* @returns {@link BatchUpdateRecommendationStatusCommandOutput}
* @see {@link BatchUpdateRecommendationStatusCommandInput} for command's `input` shape.
* @see {@link BatchUpdateRecommendationStatusCommandOutput} for command's `response` shape.
* @see {@link ResiliencehubClientResolvedConfig | config} for ResiliencehubClient's `config` shape.
*
* @throws {@link AccessDeniedException} (client fault)
* <p>You don't have permissions to perform the requested operation. The user or role that is
* making the request must have at least one IAM permissions policy attached that grants the
* required permissions.</p>
*
* @throws {@link InternalServerException} (server fault)
* <p>This exception occurs when there is an internal failure in the Resilience Hub
* service.</p>
*
* @throws {@link ResourceNotFoundException} (client fault)
* <p>This exception occurs when the specified resource could not be found.</p>
*
* @throws {@link ThrottlingException} (client fault)
* <p>This exception occurs when you have exceeded the limit on the number of requests per second.</p>
*
* @throws {@link ValidationException} (client fault)
* <p>This exception occurs when a request is not valid.</p>
*
* @throws {@link ResiliencehubServiceException}
* <p>Base exception class for all service exceptions from Resiliencehub service.</p>
*
*/
export class BatchUpdateRecommendationStatusCommand extends $Command<
BatchUpdateRecommendationStatusCommandInput,
BatchUpdateRecommendationStatusCommandOutput,
ResiliencehubClientResolvedConfig
> {
// Start section: command_properties
// End section: command_properties

public static getEndpointParameterInstructions(): EndpointParameterInstructions {
return {
UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" },
Endpoint: { type: "builtInParams", name: "endpoint" },
Region: { type: "builtInParams", name: "region" },
UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" },
};
}

/**
* @public
*/
constructor(readonly input: BatchUpdateRecommendationStatusCommandInput) {
// Start section: command_constructor
super();
// End section: command_constructor
}

/**
* @internal
*/
resolveMiddleware(
clientStack: MiddlewareStack<ServiceInputTypes, ServiceOutputTypes>,
configuration: ResiliencehubClientResolvedConfig,
options?: __HttpHandlerOptions
): Handler<BatchUpdateRecommendationStatusCommandInput, BatchUpdateRecommendationStatusCommandOutput> {
this.middlewareStack.use(getSerdePlugin(configuration, this.serialize, this.deserialize));
this.middlewareStack.use(
getEndpointPlugin(configuration, BatchUpdateRecommendationStatusCommand.getEndpointParameterInstructions())
);

const stack = clientStack.concat(this.middlewareStack);

const { logger } = configuration;
const clientName = "ResiliencehubClient";
const commandName = "BatchUpdateRecommendationStatusCommand";
const handlerExecutionContext: HandlerExecutionContext = {
logger,
clientName,
commandName,
inputFilterSensitiveLog: (_: any) => _,
outputFilterSensitiveLog: (_: any) => _,
};
const { requestHandler } = configuration;
return stack.resolve(
(request: FinalizeHandlerArguments<any>) =>
requestHandler.handle(request.request as __HttpRequest, options || {}),
handlerExecutionContext
);
}

/**
* @internal
*/
private serialize(
input: BatchUpdateRecommendationStatusCommandInput,
context: __SerdeContext
): Promise<__HttpRequest> {
return se_BatchUpdateRecommendationStatusCommand(input, context);
}

/**
* @internal
*/
private deserialize(
output: __HttpResponse,
context: __SerdeContext
): Promise<BatchUpdateRecommendationStatusCommandOutput> {
return de_BatchUpdateRecommendationStatusCommand(output, context);
}

// Start section: command_body_extra
// End section: command_body_extra
}
Loading

0 comments on commit 8b83e9a

Please sign in to comment.