Skip to content

Commit 86aa1cf

Browse files
author
awstools
committed
feat(client-cloudformation): This release adds a new API, ListHookResults, that allows retrieving CloudFormation Hooks invocation results for hooks invoked during a create change set operation or Cloud Control API operation
1 parent 2fc76d4 commit 86aa1cf

File tree

12 files changed

+860
-213
lines changed

12 files changed

+860
-213
lines changed

clients/client-cloudformation/README.md

+8
Original file line numberDiff line numberDiff line change
@@ -607,6 +607,14 @@ ListGeneratedTemplates
607607

608608
[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/cloudformation/command/ListGeneratedTemplatesCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-cloudformation/Interface/ListGeneratedTemplatesCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-cloudformation/Interface/ListGeneratedTemplatesCommandOutput/)
609609

610+
</details>
611+
<details>
612+
<summary>
613+
ListHookResults
614+
</summary>
615+
616+
[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/cloudformation/command/ListHookResultsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-cloudformation/Interface/ListHookResultsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-cloudformation/Interface/ListHookResultsCommandOutput/)
617+
610618
</details>
611619
<details>
612620
<summary>

clients/client-cloudformation/src/CloudFormation.ts

+20
Original file line numberDiff line numberDiff line change
@@ -232,6 +232,11 @@ import {
232232
ListGeneratedTemplatesCommandInput,
233233
ListGeneratedTemplatesCommandOutput,
234234
} from "./commands/ListGeneratedTemplatesCommand";
235+
import {
236+
ListHookResultsCommand,
237+
ListHookResultsCommandInput,
238+
ListHookResultsCommandOutput,
239+
} from "./commands/ListHookResultsCommand";
235240
import { ListImportsCommand, ListImportsCommandInput, ListImportsCommandOutput } from "./commands/ListImportsCommand";
236241
import {
237242
ListResourceScanRelatedResourcesCommand,
@@ -424,6 +429,7 @@ const commands = {
424429
ListChangeSetsCommand,
425430
ListExportsCommand,
426431
ListGeneratedTemplatesCommand,
432+
ListHookResultsCommand,
427433
ListImportsCommand,
428434
ListResourceScanRelatedResourcesCommand,
429435
ListResourceScanResourcesCommand,
@@ -1247,6 +1253,20 @@ export interface CloudFormation {
12471253
cb: (err: any, data?: ListGeneratedTemplatesCommandOutput) => void
12481254
): void;
12491255

1256+
/**
1257+
* @see {@link ListHookResultsCommand}
1258+
*/
1259+
listHookResults(
1260+
args: ListHookResultsCommandInput,
1261+
options?: __HttpHandlerOptions
1262+
): Promise<ListHookResultsCommandOutput>;
1263+
listHookResults(args: ListHookResultsCommandInput, cb: (err: any, data?: ListHookResultsCommandOutput) => void): void;
1264+
listHookResults(
1265+
args: ListHookResultsCommandInput,
1266+
options: __HttpHandlerOptions,
1267+
cb: (err: any, data?: ListHookResultsCommandOutput) => void
1268+
): void;
1269+
12501270
/**
12511271
* @see {@link ListImportsCommand}
12521272
*/

clients/client-cloudformation/src/CloudFormationClient.ts

+3
Original file line numberDiff line numberDiff line change
@@ -183,6 +183,7 @@ import {
183183
ListGeneratedTemplatesCommandInput,
184184
ListGeneratedTemplatesCommandOutput,
185185
} from "./commands/ListGeneratedTemplatesCommand";
186+
import { ListHookResultsCommandInput, ListHookResultsCommandOutput } from "./commands/ListHookResultsCommand";
186187
import { ListImportsCommandInput, ListImportsCommandOutput } from "./commands/ListImportsCommand";
187188
import {
188189
ListResourceScanRelatedResourcesCommandInput,
@@ -322,6 +323,7 @@ export type ServiceInputTypes =
322323
| ListChangeSetsCommandInput
323324
| ListExportsCommandInput
324325
| ListGeneratedTemplatesCommandInput
326+
| ListHookResultsCommandInput
325327
| ListImportsCommandInput
326328
| ListResourceScanRelatedResourcesCommandInput
327329
| ListResourceScanResourcesCommandInput
@@ -409,6 +411,7 @@ export type ServiceOutputTypes =
409411
| ListChangeSetsCommandOutput
410412
| ListExportsCommandOutput
411413
| ListGeneratedTemplatesCommandOutput
414+
| ListHookResultsCommandOutput
412415
| ListImportsCommandOutput
413416
| ListResourceScanRelatedResourcesCommandOutput
414417
| ListResourceScanResourcesCommandOutput
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,110 @@
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 { CloudFormationClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../CloudFormationClient";
8+
import { commonParams } from "../endpoint/EndpointParameters";
9+
import { ListHookResultsInput, ListHookResultsOutput } from "../models/models_0";
10+
import { de_ListHookResultsCommand, se_ListHookResultsCommand } from "../protocols/Aws_query";
11+
12+
/**
13+
* @public
14+
*/
15+
export type { __MetadataBearer };
16+
export { $Command };
17+
/**
18+
* @public
19+
*
20+
* The input for {@link ListHookResultsCommand}.
21+
*/
22+
export interface ListHookResultsCommandInput extends ListHookResultsInput {}
23+
/**
24+
* @public
25+
*
26+
* The output of {@link ListHookResultsCommand}.
27+
*/
28+
export interface ListHookResultsCommandOutput extends ListHookResultsOutput, __MetadataBearer {}
29+
30+
/**
31+
* <p>Returns summaries of invoked Hooks when a change set or Cloud Control API operation target is provided.</p>
32+
* @example
33+
* Use a bare-bones client and the command you need to make an API call.
34+
* ```javascript
35+
* import { CloudFormationClient, ListHookResultsCommand } from "@aws-sdk/client-cloudformation"; // ES Modules import
36+
* // const { CloudFormationClient, ListHookResultsCommand } = require("@aws-sdk/client-cloudformation"); // CommonJS import
37+
* const client = new CloudFormationClient(config);
38+
* const input = { // ListHookResultsInput
39+
* TargetType: "CHANGE_SET" || "STACK" || "RESOURCE" || "CLOUD_CONTROL", // required
40+
* TargetId: "STRING_VALUE", // required
41+
* NextToken: "STRING_VALUE",
42+
* };
43+
* const command = new ListHookResultsCommand(input);
44+
* const response = await client.send(command);
45+
* // { // ListHookResultsOutput
46+
* // TargetType: "CHANGE_SET" || "STACK" || "RESOURCE" || "CLOUD_CONTROL",
47+
* // TargetId: "STRING_VALUE",
48+
* // HookResults: [ // HookResultSummaries
49+
* // { // HookResultSummary
50+
* // InvocationPoint: "PRE_PROVISION",
51+
* // FailureMode: "FAIL" || "WARN",
52+
* // TypeName: "STRING_VALUE",
53+
* // TypeVersionId: "STRING_VALUE",
54+
* // TypeConfigurationVersionId: "STRING_VALUE",
55+
* // Status: "HOOK_IN_PROGRESS" || "HOOK_COMPLETE_SUCCEEDED" || "HOOK_COMPLETE_FAILED" || "HOOK_FAILED",
56+
* // HookStatusReason: "STRING_VALUE",
57+
* // },
58+
* // ],
59+
* // NextToken: "STRING_VALUE",
60+
* // };
61+
*
62+
* ```
63+
*
64+
* @param ListHookResultsCommandInput - {@link ListHookResultsCommandInput}
65+
* @returns {@link ListHookResultsCommandOutput}
66+
* @see {@link ListHookResultsCommandInput} for command's `input` shape.
67+
* @see {@link ListHookResultsCommandOutput} for command's `response` shape.
68+
* @see {@link CloudFormationClientResolvedConfig | config} for CloudFormationClient's `config` shape.
69+
*
70+
* @throws {@link HookResultNotFoundException} (client fault)
71+
* <p>The specified target doesn't have any requested Hook invocations.</p>
72+
*
73+
* @throws {@link CloudFormationServiceException}
74+
* <p>Base exception class for all service exceptions from CloudFormation service.</p>
75+
*
76+
* @public
77+
*/
78+
export class ListHookResultsCommand extends $Command
79+
.classBuilder<
80+
ListHookResultsCommandInput,
81+
ListHookResultsCommandOutput,
82+
CloudFormationClientResolvedConfig,
83+
ServiceInputTypes,
84+
ServiceOutputTypes
85+
>()
86+
.ep(commonParams)
87+
.m(function (this: any, Command: any, cs: any, config: CloudFormationClientResolvedConfig, o: any) {
88+
return [
89+
getSerdePlugin(config, this.serialize, this.deserialize),
90+
getEndpointPlugin(config, Command.getEndpointParameterInstructions()),
91+
];
92+
})
93+
.s("CloudFormation", "ListHookResults", {})
94+
.n("CloudFormationClient", "ListHookResultsCommand")
95+
.f(void 0, void 0)
96+
.ser(se_ListHookResultsCommand)
97+
.de(de_ListHookResultsCommand)
98+
.build() {
99+
/** @internal type navigation helper, not in runtime. */
100+
protected declare static __types: {
101+
api: {
102+
input: ListHookResultsInput;
103+
output: ListHookResultsOutput;
104+
};
105+
sdk: {
106+
input: ListHookResultsCommandInput;
107+
output: ListHookResultsCommandOutput;
108+
};
109+
};
110+
}

clients/client-cloudformation/src/commands/RegisterTypeCommand.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import { MetadataBearer as __MetadataBearer } from "@smithy/types";
66

77
import { CloudFormationClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../CloudFormationClient";
88
import { commonParams } from "../endpoint/EndpointParameters";
9-
import { RegisterTypeInput, RegisterTypeOutput } from "../models/models_0";
9+
import { RegisterTypeInput, RegisterTypeOutput } from "../models/models_1";
1010
import { de_RegisterTypeCommand, se_RegisterTypeCommand } from "../protocols/Aws_query";
1111

1212
/**

clients/client-cloudformation/src/commands/RollbackStackCommand.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import { MetadataBearer as __MetadataBearer } from "@smithy/types";
66

77
import { CloudFormationClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../CloudFormationClient";
88
import { commonParams } from "../endpoint/EndpointParameters";
9-
import { RollbackStackInput, RollbackStackOutput } from "../models/models_0";
9+
import { RollbackStackInput, RollbackStackOutput } from "../models/models_1";
1010
import { de_RollbackStackCommand, se_RollbackStackCommand } from "../protocols/Aws_query";
1111

1212
/**

clients/client-cloudformation/src/commands/SetStackPolicyCommand.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import { MetadataBearer as __MetadataBearer } from "@smithy/types";
66

77
import { CloudFormationClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../CloudFormationClient";
88
import { commonParams } from "../endpoint/EndpointParameters";
9-
import { SetStackPolicyInput } from "../models/models_0";
9+
import { SetStackPolicyInput } from "../models/models_1";
1010
import { de_SetStackPolicyCommand, se_SetStackPolicyCommand } from "../protocols/Aws_query";
1111

1212
/**

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

+1
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ export * from "./ImportStacksToStackSetCommand";
4848
export * from "./ListChangeSetsCommand";
4949
export * from "./ListExportsCommand";
5050
export * from "./ListGeneratedTemplatesCommand";
51+
export * from "./ListHookResultsCommand";
5152
export * from "./ListImportsCommand";
5253
export * from "./ListResourceScanRelatedResourcesCommand";
5354
export * from "./ListResourceScanResourcesCommand";

0 commit comments

Comments
 (0)