Skip to content

Commit

Permalink
feat(client-resiliencehub): AWS Resilience Hub has expanded its drift…
Browse files Browse the repository at this point in the history
… detection capabilities by introducing a new type of drift detection - application resource drift. This new enhancement detects changes, such as the addition or deletion of resources within the application's input sources.
  • Loading branch information
awstools committed May 7, 2024
1 parent 7008655 commit 612bf4a
Show file tree
Hide file tree
Showing 12 changed files with 666 additions and 242 deletions.
8 changes: 8 additions & 0 deletions clients/client-resiliencehub/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -414,6 +414,14 @@ ListAppAssessmentComplianceDrifts

[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/resiliencehub/command/ListAppAssessmentComplianceDriftsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-resiliencehub/Interface/ListAppAssessmentComplianceDriftsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-resiliencehub/Interface/ListAppAssessmentComplianceDriftsCommandOutput/)

</details>
<details>
<summary>
ListAppAssessmentResourceDrifts
</summary>

[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/resiliencehub/command/ListAppAssessmentResourceDriftsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-resiliencehub/Interface/ListAppAssessmentResourceDriftsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-resiliencehub/Interface/ListAppAssessmentResourceDriftsCommandOutput/)

</details>
<details>
<summary>
Expand Down
24 changes: 24 additions & 0 deletions clients/client-resiliencehub/src/Resiliencehub.ts
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,11 @@ import {
ListAppAssessmentComplianceDriftsCommandInput,
ListAppAssessmentComplianceDriftsCommandOutput,
} from "./commands/ListAppAssessmentComplianceDriftsCommand";
import {
ListAppAssessmentResourceDriftsCommand,
ListAppAssessmentResourceDriftsCommandInput,
ListAppAssessmentResourceDriftsCommandOutput,
} from "./commands/ListAppAssessmentResourceDriftsCommand";
import {
ListAppAssessmentsCommand,
ListAppAssessmentsCommandInput,
Expand Down Expand Up @@ -277,6 +282,7 @@ const commands = {
ImportResourcesToDraftAppVersionCommand,
ListAlarmRecommendationsCommand,
ListAppAssessmentComplianceDriftsCommand,
ListAppAssessmentResourceDriftsCommand,
ListAppAssessmentsCommand,
ListAppComponentCompliancesCommand,
ListAppComponentRecommendationsCommand,
Expand Down Expand Up @@ -732,6 +738,23 @@ export interface Resiliencehub {
cb: (err: any, data?: ListAppAssessmentComplianceDriftsCommandOutput) => void
): void;

/**
* @see {@link ListAppAssessmentResourceDriftsCommand}
*/
listAppAssessmentResourceDrifts(
args: ListAppAssessmentResourceDriftsCommandInput,
options?: __HttpHandlerOptions
): Promise<ListAppAssessmentResourceDriftsCommandOutput>;
listAppAssessmentResourceDrifts(
args: ListAppAssessmentResourceDriftsCommandInput,
cb: (err: any, data?: ListAppAssessmentResourceDriftsCommandOutput) => void
): void;
listAppAssessmentResourceDrifts(
args: ListAppAssessmentResourceDriftsCommandInput,
options: __HttpHandlerOptions,
cb: (err: any, data?: ListAppAssessmentResourceDriftsCommandOutput) => void
): void;

/**
* @see {@link ListAppAssessmentsCommand}
*/
Expand Down Expand Up @@ -881,6 +904,7 @@ export interface Resiliencehub {
/**
* @see {@link ListRecommendationTemplatesCommand}
*/
listRecommendationTemplates(): Promise<ListRecommendationTemplatesCommandOutput>;
listRecommendationTemplates(
args: ListRecommendationTemplatesCommandInput,
options?: __HttpHandlerOptions
Expand Down
6 changes: 6 additions & 0 deletions clients/client-resiliencehub/src/ResiliencehubClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,10 @@ import {
ListAppAssessmentComplianceDriftsCommandInput,
ListAppAssessmentComplianceDriftsCommandOutput,
} from "./commands/ListAppAssessmentComplianceDriftsCommand";
import {
ListAppAssessmentResourceDriftsCommandInput,
ListAppAssessmentResourceDriftsCommandOutput,
} from "./commands/ListAppAssessmentResourceDriftsCommand";
import { ListAppAssessmentsCommandInput, ListAppAssessmentsCommandOutput } from "./commands/ListAppAssessmentsCommand";
import {
ListAppComponentCompliancesCommandInput,
Expand Down Expand Up @@ -271,6 +275,7 @@ export type ServiceInputTypes =
| ImportResourcesToDraftAppVersionCommandInput
| ListAlarmRecommendationsCommandInput
| ListAppAssessmentComplianceDriftsCommandInput
| ListAppAssessmentResourceDriftsCommandInput
| ListAppAssessmentsCommandInput
| ListAppComponentCompliancesCommandInput
| ListAppComponentRecommendationsCommandInput
Expand Down Expand Up @@ -330,6 +335,7 @@ export type ServiceOutputTypes =
| ImportResourcesToDraftAppVersionCommandOutput
| ListAlarmRecommendationsCommandOutput
| ListAppAssessmentComplianceDriftsCommandOutput
| ListAppAssessmentResourceDriftsCommandOutput
| ListAppAssessmentsCommandOutput
| ListAppComponentCompliancesCommandOutput
| ListAppComponentRecommendationsCommandOutput
Expand Down
7 changes: 3 additions & 4 deletions clients/client-resiliencehub/src/commands/CreateAppCommand.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,9 @@ export interface CreateAppCommandOutput extends CreateAppResponse, __MetadataBea

/**
* <p>Creates an Resilience Hub application. An Resilience Hub application is a
* collection of Amazon Web Services resources structured to prevent and recover Amazon Web Services application disruptions. To describe a Resilience Hub application, you provide an
* application name, resources from one or more CloudFormation stacks, Resource Groups, Terraform state files, AppRegistry applications, and an appropriate
* resiliency policy. In addition, you can also add resources that are located on Amazon Elastic Kubernetes Service (Amazon EKS) clusters as optional resources. For more information
* about the number of resources supported per application, see <a href="https://docs.aws.amazon.com/general/latest/gr/resiliencehub.html#limits_resiliencehub">Service
* collection of Amazon Web Services resources structured to prevent and recover Amazon Web Services application disruptions. To describe a Resilience Hub application,
* you provide an application name, resources from one or more CloudFormation stacks, Resource Groups, Terraform state files, AppRegistry applications, and an appropriate
* resiliency policy. In addition, you can also add resources that are located on Amazon Elastic Kubernetes Service (Amazon EKS) clusters as optional resources. For more information about the number of resources supported per application, see <a href="https://docs.aws.amazon.com/general/latest/gr/resiliencehub.html#limits_resiliencehub">Service
* quotas</a>.</p>
* <p>After you create an Resilience Hub application, you publish it so that you can run a resiliency
* assessment on it. You can then use recommendations from the assessment to improve resiliency
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,121 @@
// 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 { commonParams } from "../endpoint/EndpointParameters";
import { ListAppAssessmentResourceDriftsRequest, ListAppAssessmentResourceDriftsResponse } from "../models/models_0";
import {
de_ListAppAssessmentResourceDriftsCommand,
se_ListAppAssessmentResourceDriftsCommand,
} from "../protocols/Aws_restJson1";
import { ResiliencehubClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../ResiliencehubClient";

/**
* @public
*/
export { __MetadataBearer, $Command };
/**
* @public
*
* The input for {@link ListAppAssessmentResourceDriftsCommand}.
*/
export interface ListAppAssessmentResourceDriftsCommandInput extends ListAppAssessmentResourceDriftsRequest {}
/**
* @public
*
* The output of {@link ListAppAssessmentResourceDriftsCommand}.
*/
export interface ListAppAssessmentResourceDriftsCommandOutput
extends ListAppAssessmentResourceDriftsResponse,
__MetadataBearer {}

/**
* <p>Indicates the list of resource drifts that were detected while running an assessment.</p>
* @example
* Use a bare-bones client and the command you need to make an API call.
* ```javascript
* import { ResiliencehubClient, ListAppAssessmentResourceDriftsCommand } from "@aws-sdk/client-resiliencehub"; // ES Modules import
* // const { ResiliencehubClient, ListAppAssessmentResourceDriftsCommand } = require("@aws-sdk/client-resiliencehub"); // CommonJS import
* const client = new ResiliencehubClient(config);
* const input = { // ListAppAssessmentResourceDriftsRequest
* assessmentArn: "STRING_VALUE", // required
* nextToken: "STRING_VALUE",
* maxResults: Number("int"),
* };
* const command = new ListAppAssessmentResourceDriftsCommand(input);
* const response = await client.send(command);
* // { // ListAppAssessmentResourceDriftsResponse
* // resourceDrifts: [ // ResourceDriftList // required
* // { // ResourceDrift
* // appArn: "STRING_VALUE",
* // appVersion: "STRING_VALUE",
* // referenceId: "STRING_VALUE",
* // resourceIdentifier: { // ResourceIdentifier
* // logicalResourceId: { // LogicalResourceId
* // identifier: "STRING_VALUE", // required
* // logicalStackName: "STRING_VALUE",
* // resourceGroupName: "STRING_VALUE",
* // terraformSourceName: "STRING_VALUE",
* // eksSourceName: "STRING_VALUE",
* // },
* // resourceType: "STRING_VALUE",
* // },
* // diffType: "STRING_VALUE",
* // },
* // ],
* // nextToken: "STRING_VALUE",
* // };
*
* ```
*
* @param ListAppAssessmentResourceDriftsCommandInput - {@link ListAppAssessmentResourceDriftsCommandInput}
* @returns {@link ListAppAssessmentResourceDriftsCommandOutput}
* @see {@link ListAppAssessmentResourceDriftsCommandInput} for command's `input` shape.
* @see {@link ListAppAssessmentResourceDriftsCommandOutput} 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 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>
*
* @public
*/
export class ListAppAssessmentResourceDriftsCommand extends $Command
.classBuilder<
ListAppAssessmentResourceDriftsCommandInput,
ListAppAssessmentResourceDriftsCommandOutput,
ResiliencehubClientResolvedConfig,
ServiceInputTypes,
ServiceOutputTypes
>()
.ep({
...commonParams,
})
.m(function (this: any, Command: any, cs: any, config: ResiliencehubClientResolvedConfig, o: any) {
return [
getSerdePlugin(config, this.serialize, this.deserialize),
getEndpointPlugin(config, Command.getEndpointParameterInstructions()),
];
})
.s("AwsResilienceHub", "ListAppAssessmentResourceDrifts", {})
.n("ResiliencehubClient", "ListAppAssessmentResourceDriftsCommand")
.f(void 0, void 0)
.ser(se_ListAppAssessmentResourceDriftsCommand)
.de(de_ListAppAssessmentResourceDriftsCommand)
.build() {}
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ export interface ListRecommendationTemplatesCommandOutput
* // const { ResiliencehubClient, ListRecommendationTemplatesCommand } = require("@aws-sdk/client-resiliencehub"); // CommonJS import
* const client = new ResiliencehubClient(config);
* const input = { // ListRecommendationTemplatesRequest
* assessmentArn: "STRING_VALUE", // required
* assessmentArn: "STRING_VALUE",
* reverseOrder: true || false,
* status: [ // RecommendationTemplateStatusList
* "STRING_VALUE",
Expand Down
1 change: 1 addition & 0 deletions clients/client-resiliencehub/src/commands/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ export * from "./DescribeResiliencyPolicyCommand";
export * from "./ImportResourcesToDraftAppVersionCommand";
export * from "./ListAlarmRecommendationsCommand";
export * from "./ListAppAssessmentComplianceDriftsCommand";
export * from "./ListAppAssessmentResourceDriftsCommand";
export * from "./ListAppAssessmentsCommand";
export * from "./ListAppComponentCompliancesCommand";
export * from "./ListAppComponentRecommendationsCommand";
Expand Down
Loading

0 comments on commit 612bf4a

Please sign in to comment.