Skip to content

Commit 326e5dd

Browse files
author
awstools
committed
feat(client-cloudformation): CloudFormation now supports GetHookResult API with annotations to retrieve structured compliance check results and remediation guidance for each evaluated resource, replacing the previous single-message limitation with detailed validation outcomes.
1 parent b075f0f commit 326e5dd

17 files changed

+1351
-614
lines changed

clients/client-cloudformation/README.md

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ Amazon Simple Notification Service, Elastic Load Balancing, and Amazon EC2 Auto
1414
applications without creating or configuring the underlying Amazon Web Services infrastructure.</p>
1515
<p>With CloudFormation, you declare all your resources and dependencies in a template file. The
1616
template defines a collection of resources as a single unit called a stack. CloudFormation creates
17-
and deletes all member resources of the stack together and manages all dependencies between the
18-
resources for you.</p>
17+
and deletes all member resources of the stack together and manages all dependencies between
18+
the resources for you.</p>
1919
<p>For more information about CloudFormation, see the <a href="http://aws.amazon.com/cloudformation/">CloudFormation product page</a>.</p>
2020
<p>CloudFormation makes use of other Amazon Web Services products. If you need additional technical information
2121
about a specific Amazon Web Services product, you can find the product's technical documentation at <a href="https://docs.aws.amazon.com/">docs.aws.amazon.com</a>.</p>
@@ -574,6 +574,14 @@ GetGeneratedTemplate
574574

575575
[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/cloudformation/command/GetGeneratedTemplateCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-cloudformation/Interface/GetGeneratedTemplateCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-cloudformation/Interface/GetGeneratedTemplateCommandOutput/)
576576

577+
</details>
578+
<details>
579+
<summary>
580+
GetHookResult
581+
</summary>
582+
583+
[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/cloudformation/command/GetHookResultCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-cloudformation/Interface/GetHookResultCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-cloudformation/Interface/GetHookResultCommandOutput/)
584+
577585
</details>
578586
<details>
579587
<summary>

clients/client-cloudformation/src/CloudFormation.ts

Lines changed: 25 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -220,6 +220,11 @@ import {
220220
GetGeneratedTemplateCommandInput,
221221
GetGeneratedTemplateCommandOutput,
222222
} from "./commands/GetGeneratedTemplateCommand";
223+
import {
224+
GetHookResultCommand,
225+
GetHookResultCommandInput,
226+
GetHookResultCommandOutput,
227+
} from "./commands/GetHookResultCommand";
223228
import {
224229
GetStackPolicyCommand,
225230
GetStackPolicyCommandInput,
@@ -450,6 +455,7 @@ const commands = {
450455
ExecuteChangeSetCommand,
451456
ExecuteStackRefactorCommand,
452457
GetGeneratedTemplateCommand,
458+
GetHookResultCommand,
453459
GetStackPolicyCommand,
454460
GetTemplateCommand,
455461
GetTemplateSummaryCommand,
@@ -930,7 +936,6 @@ export interface CloudFormation {
930936
/**
931937
* @see {@link DescribeStackEventsCommand}
932938
*/
933-
describeStackEvents(): Promise<DescribeStackEventsCommandOutput>;
934939
describeStackEvents(
935940
args: DescribeStackEventsCommandInput,
936941
options?: __HttpHandlerOptions
@@ -1229,6 +1234,18 @@ export interface CloudFormation {
12291234
cb: (err: any, data?: GetGeneratedTemplateCommandOutput) => void
12301235
): void;
12311236

1237+
/**
1238+
* @see {@link GetHookResultCommand}
1239+
*/
1240+
getHookResult(): Promise<GetHookResultCommandOutput>;
1241+
getHookResult(args: GetHookResultCommandInput, options?: __HttpHandlerOptions): Promise<GetHookResultCommandOutput>;
1242+
getHookResult(args: GetHookResultCommandInput, cb: (err: any, data?: GetHookResultCommandOutput) => void): void;
1243+
getHookResult(
1244+
args: GetHookResultCommandInput,
1245+
options: __HttpHandlerOptions,
1246+
cb: (err: any, data?: GetHookResultCommandOutput) => void
1247+
): void;
1248+
12321249
/**
12331250
* @see {@link GetStackPolicyCommand}
12341251
*/
@@ -1898,16 +1915,16 @@ export interface CloudFormation {
18981915
/**
18991916
* <fullname>CloudFormation</fullname>
19001917
* <p>CloudFormation allows you to create and manage Amazon Web Services infrastructure deployments predictably and
1901-
* repeatedly. You can use CloudFormation to leverage Amazon Web Services products, such as Amazon Elastic Compute Cloud, Amazon Elastic Block Store,
1902-
* Amazon Simple Notification Service, Elastic Load Balancing, and Amazon EC2 Auto Scaling to build highly reliable, highly scalable, cost-effective
1903-
* applications without creating or configuring the underlying Amazon Web Services infrastructure.</p>
1918+
* repeatedly. You can use CloudFormation to leverage Amazon Web Services products, such as Amazon Elastic Compute Cloud, Amazon Elastic Block Store,
1919+
* Amazon Simple Notification Service, Elastic Load Balancing, and Amazon EC2 Auto Scaling to build highly reliable, highly scalable, cost-effective
1920+
* applications without creating or configuring the underlying Amazon Web Services infrastructure.</p>
19041921
* <p>With CloudFormation, you declare all your resources and dependencies in a template file. The
1905-
* template defines a collection of resources as a single unit called a stack. CloudFormation creates
1906-
* and deletes all member resources of the stack together and manages all dependencies between the
1907-
* resources for you.</p>
1922+
* template defines a collection of resources as a single unit called a stack. CloudFormation creates
1923+
* and deletes all member resources of the stack together and manages all dependencies between
1924+
* the resources for you.</p>
19081925
* <p>For more information about CloudFormation, see the <a href="http://aws.amazon.com/cloudformation/">CloudFormation product page</a>.</p>
19091926
* <p>CloudFormation makes use of other Amazon Web Services products. If you need additional technical information
1910-
* about a specific Amazon Web Services product, you can find the product's technical documentation at <a href="https://docs.aws.amazon.com/">docs.aws.amazon.com</a>.</p>
1927+
* about a specific Amazon Web Services product, you can find the product's technical documentation at <a href="https://docs.aws.amazon.com/">docs.aws.amazon.com</a>.</p>
19111928
* @public
19121929
*/
19131930
export class CloudFormation extends CloudFormationClient implements CloudFormation {}

clients/client-cloudformation/src/CloudFormationClient.ts

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -186,6 +186,7 @@ import {
186186
GetGeneratedTemplateCommandInput,
187187
GetGeneratedTemplateCommandOutput,
188188
} from "./commands/GetGeneratedTemplateCommand";
189+
import { GetHookResultCommandInput, GetHookResultCommandOutput } from "./commands/GetHookResultCommand";
189190
import { GetStackPolicyCommandInput, GetStackPolicyCommandOutput } from "./commands/GetStackPolicyCommand";
190191
import { GetTemplateCommandInput, GetTemplateCommandOutput } from "./commands/GetTemplateCommand";
191192
import { GetTemplateSummaryCommandInput, GetTemplateSummaryCommandOutput } from "./commands/GetTemplateSummaryCommand";
@@ -340,6 +341,7 @@ export type ServiceInputTypes =
340341
| ExecuteChangeSetCommandInput
341342
| ExecuteStackRefactorCommandInput
342343
| GetGeneratedTemplateCommandInput
344+
| GetHookResultCommandInput
343345
| GetStackPolicyCommandInput
344346
| GetTemplateCommandInput
345347
| GetTemplateSummaryCommandInput
@@ -433,6 +435,7 @@ export type ServiceOutputTypes =
433435
| ExecuteChangeSetCommandOutput
434436
| ExecuteStackRefactorCommandOutput
435437
| GetGeneratedTemplateCommandOutput
438+
| GetHookResultCommandOutput
436439
| GetStackPolicyCommandOutput
437440
| GetTemplateCommandOutput
438441
| GetTemplateSummaryCommandOutput
@@ -680,16 +683,16 @@ export interface CloudFormationClientResolvedConfig extends CloudFormationClient
680683
/**
681684
* <fullname>CloudFormation</fullname>
682685
* <p>CloudFormation allows you to create and manage Amazon Web Services infrastructure deployments predictably and
683-
* repeatedly. You can use CloudFormation to leverage Amazon Web Services products, such as Amazon Elastic Compute Cloud, Amazon Elastic Block Store,
684-
* Amazon Simple Notification Service, Elastic Load Balancing, and Amazon EC2 Auto Scaling to build highly reliable, highly scalable, cost-effective
685-
* applications without creating or configuring the underlying Amazon Web Services infrastructure.</p>
686+
* repeatedly. You can use CloudFormation to leverage Amazon Web Services products, such as Amazon Elastic Compute Cloud, Amazon Elastic Block Store,
687+
* Amazon Simple Notification Service, Elastic Load Balancing, and Amazon EC2 Auto Scaling to build highly reliable, highly scalable, cost-effective
688+
* applications without creating or configuring the underlying Amazon Web Services infrastructure.</p>
686689
* <p>With CloudFormation, you declare all your resources and dependencies in a template file. The
687-
* template defines a collection of resources as a single unit called a stack. CloudFormation creates
688-
* and deletes all member resources of the stack together and manages all dependencies between the
689-
* resources for you.</p>
690+
* template defines a collection of resources as a single unit called a stack. CloudFormation creates
691+
* and deletes all member resources of the stack together and manages all dependencies between
692+
* the resources for you.</p>
690693
* <p>For more information about CloudFormation, see the <a href="http://aws.amazon.com/cloudformation/">CloudFormation product page</a>.</p>
691694
* <p>CloudFormation makes use of other Amazon Web Services products. If you need additional technical information
692-
* about a specific Amazon Web Services product, you can find the product's technical documentation at <a href="https://docs.aws.amazon.com/">docs.aws.amazon.com</a>.</p>
695+
* about a specific Amazon Web Services product, you can find the product's technical documentation at <a href="https://docs.aws.amazon.com/">docs.aws.amazon.com</a>.</p>
693696
* @public
694697
*/
695698
export class CloudFormationClient extends __Client<

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

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,7 @@ export interface ActivateTypeCommandOutput extends ActivateTypeOutput, __Metadat
3737
* <p>For more information, see <a href="https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/registry-public-activate-extension.html">Activate a
3838
* third-party public extension in your account</a> in the
3939
* <i>CloudFormation User Guide</i>. For information about creating Hooks, see the
40-
* <a href="https://docs.aws.amazon.com/cloudformation-cli/latest/hooks-userguide/what-is-cloudformation-hooks.html">CloudFormation
41-
* Hooks User Guide</a>.</p>
40+
* <a href="https://docs.aws.amazon.com/cloudformation-cli/latest/hooks-userguide/what-is-cloudformation-hooks.html">CloudFormation Hooks User Guide</a>.</p>
4241
* @example
4342
* Use a bare-bones client and the command you need to make an API call.
4443
* ```javascript

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@ export interface DescribeChangeSetHooksCommandInput extends DescribeChangeSetHoo
2727
export interface DescribeChangeSetHooksCommandOutput extends DescribeChangeSetHooksOutput, __MetadataBearer {}
2828

2929
/**
30-
* <p>Returns hook-related information for the change set and a list of changes that CloudFormation
31-
* makes when you run the change set.</p>
30+
* <p>Returns Hook-related information for the change set and a list of changes that
31+
* CloudFormation makes when you run the change set.</p>
3232
* @example
3333
* Use a bare-bones client and the command you need to make an API call.
3434
* ```javascript

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ export interface DescribeStackEventsCommandOutput extends DescribeStackEventsOut
4343
* const config = {}; // type is CloudFormationClientConfig
4444
* const client = new CloudFormationClient(config);
4545
* const input = { // DescribeStackEventsInput
46-
* StackName: "STRING_VALUE",
46+
* StackName: "STRING_VALUE", // required
4747
* NextToken: "STRING_VALUE",
4848
* };
4949
* const command = new DescribeStackEventsCommand(input);
Lines changed: 119 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,119 @@
1+
// smithy-typescript generated code
2+
import { getEndpointPlugin } from "@smithy/middleware-endpoint";
3+
import { Command as $Command } from "@smithy/smithy-client";
4+
import { MetadataBearer as __MetadataBearer } from "@smithy/types";
5+
6+
import { CloudFormationClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../CloudFormationClient";
7+
import { commonParams } from "../endpoint/EndpointParameters";
8+
import { GetHookResultInput, GetHookResultOutput } from "../models/models_0";
9+
import { GetHookResult } from "../schemas/schemas_0";
10+
11+
/**
12+
* @public
13+
*/
14+
export type { __MetadataBearer };
15+
export { $Command };
16+
/**
17+
* @public
18+
*
19+
* The input for {@link GetHookResultCommand}.
20+
*/
21+
export interface GetHookResultCommandInput extends GetHookResultInput {}
22+
/**
23+
* @public
24+
*
25+
* The output of {@link GetHookResultCommand}.
26+
*/
27+
export interface GetHookResultCommandOutput extends GetHookResultOutput, __MetadataBearer {}
28+
29+
/**
30+
* <p>Retrieves detailed information and remediation guidance for a Hook invocation
31+
* result.</p>
32+
* @example
33+
* Use a bare-bones client and the command you need to make an API call.
34+
* ```javascript
35+
* import { CloudFormationClient, GetHookResultCommand } from "@aws-sdk/client-cloudformation"; // ES Modules import
36+
* // const { CloudFormationClient, GetHookResultCommand } = require("@aws-sdk/client-cloudformation"); // CommonJS import
37+
* // import type { CloudFormationClientConfig } from "@aws-sdk/client-cloudformation";
38+
* const config = {}; // type is CloudFormationClientConfig
39+
* const client = new CloudFormationClient(config);
40+
* const input = { // GetHookResultInput
41+
* HookResultId: "STRING_VALUE",
42+
* };
43+
* const command = new GetHookResultCommand(input);
44+
* const response = await client.send(command);
45+
* // { // GetHookResultOutput
46+
* // HookResultId: "STRING_VALUE",
47+
* // InvocationPoint: "PRE_PROVISION",
48+
* // FailureMode: "FAIL" || "WARN",
49+
* // TypeName: "STRING_VALUE",
50+
* // OriginalTypeName: "STRING_VALUE",
51+
* // TypeVersionId: "STRING_VALUE",
52+
* // TypeConfigurationVersionId: "STRING_VALUE",
53+
* // TypeArn: "STRING_VALUE",
54+
* // Status: "HOOK_IN_PROGRESS" || "HOOK_COMPLETE_SUCCEEDED" || "HOOK_COMPLETE_FAILED" || "HOOK_FAILED",
55+
* // HookStatusReason: "STRING_VALUE",
56+
* // InvokedAt: new Date("TIMESTAMP"),
57+
* // Target: { // HookTarget
58+
* // TargetType: "RESOURCE", // required
59+
* // TargetTypeName: "STRING_VALUE", // required
60+
* // TargetId: "STRING_VALUE", // required
61+
* // Action: "CREATE" || "UPDATE" || "DELETE" || "IMPORT", // required
62+
* // },
63+
* // Annotations: [ // AnnotationList
64+
* // { // Annotation
65+
* // AnnotationName: "STRING_VALUE",
66+
* // Status: "PASSED" || "FAILED" || "SKIPPED",
67+
* // StatusMessage: "STRING_VALUE",
68+
* // RemediationMessage: "STRING_VALUE",
69+
* // RemediationLink: "STRING_VALUE",
70+
* // SeverityLevel: "INFORMATIONAL" || "LOW" || "MEDIUM" || "HIGH" || "CRITICAL",
71+
* // },
72+
* // ],
73+
* // };
74+
*
75+
* ```
76+
*
77+
* @param GetHookResultCommandInput - {@link GetHookResultCommandInput}
78+
* @returns {@link GetHookResultCommandOutput}
79+
* @see {@link GetHookResultCommandInput} for command's `input` shape.
80+
* @see {@link GetHookResultCommandOutput} for command's `response` shape.
81+
* @see {@link CloudFormationClientResolvedConfig | config} for CloudFormationClient's `config` shape.
82+
*
83+
* @throws {@link HookResultNotFoundException} (client fault)
84+
* <p>The specified target doesn't have any requested Hook invocations.</p>
85+
*
86+
* @throws {@link CloudFormationServiceException}
87+
* <p>Base exception class for all service exceptions from CloudFormation service.</p>
88+
*
89+
*
90+
* @public
91+
*/
92+
export class GetHookResultCommand extends $Command
93+
.classBuilder<
94+
GetHookResultCommandInput,
95+
GetHookResultCommandOutput,
96+
CloudFormationClientResolvedConfig,
97+
ServiceInputTypes,
98+
ServiceOutputTypes
99+
>()
100+
.ep(commonParams)
101+
.m(function (this: any, Command: any, cs: any, config: CloudFormationClientResolvedConfig, o: any) {
102+
return [getEndpointPlugin(config, Command.getEndpointParameterInstructions())];
103+
})
104+
.s("CloudFormation", "GetHookResult", {})
105+
.n("CloudFormationClient", "GetHookResultCommand")
106+
.sc(GetHookResult)
107+
.build() {
108+
/** @internal type navigation helper, not in runtime. */
109+
protected declare static __types: {
110+
api: {
111+
input: GetHookResultInput;
112+
output: GetHookResultOutput;
113+
};
114+
sdk: {
115+
input: GetHookResultCommandInput;
116+
output: GetHookResultCommandOutput;
117+
};
118+
};
119+
}

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,8 @@ export interface ListHookResultsCommandOutput extends ListHookResultsOutput, __M
4040
* </li>
4141
* <li>
4242
* <p>
43-
* <code>TypeArn</code> and <code>Status</code>: Returns summaries for a specific
44-
* Hook filtered by status.</p>
43+
* <code>TypeArn</code> and <code>Status</code>: Returns summaries for a specific Hook
44+
* filtered by status.</p>
4545
* </li>
4646
* <li>
4747
* <p>

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import { MetadataBearer as __MetadataBearer } from "@smithy/types";
55

66
import { CloudFormationClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../CloudFormationClient";
77
import { commonParams } from "../endpoint/EndpointParameters";
8-
import { ListStackSetOperationResultsInput, ListStackSetOperationResultsOutput } from "../models/models_0";
8+
import { ListStackSetOperationResultsInput, ListStackSetOperationResultsOutput } from "../models/models_1";
99
import { ListStackSetOperationResults } from "../schemas/schemas_0";
1010

1111
/**

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import { MetadataBearer as __MetadataBearer } from "@smithy/types";
55

66
import { CloudFormationClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../CloudFormationClient";
77
import { commonParams } from "../endpoint/EndpointParameters";
8-
import { ListStackSetOperationsInput, ListStackSetOperationsOutput } from "../models/models_0";
8+
import { ListStackSetOperationsInput, ListStackSetOperationsOutput } from "../models/models_1";
99
import { ListStackSetOperations } from "../schemas/schemas_0";
1010

1111
/**

0 commit comments

Comments
 (0)