Skip to content

Commit e90cde2

Browse files
author
awstools
committed
feat(client-cloudcontrol): Added support for CloudFormation Hooks with Cloud Control API. The GetResourceRequestStatus API response now includes an optional HooksProgressEvent and HooksRequestToken parameter for Hooks Invocation Progress as part of resource operation with Cloud Control.
1 parent 69415e0 commit e90cde2

File tree

9 files changed

+276
-5
lines changed

9 files changed

+276
-5
lines changed

clients/client-cloudcontrol/src/commands/CancelResourceRequestCommand.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ export interface CancelResourceRequestCommandOutput extends CancelResourceReques
5252
* // TypeName: "STRING_VALUE",
5353
* // Identifier: "STRING_VALUE",
5454
* // RequestToken: "STRING_VALUE",
55+
* // HooksRequestToken: "STRING_VALUE",
5556
* // Operation: "STRING_VALUE",
5657
* // OperationStatus: "STRING_VALUE",
5758
* // EventTime: new Date("TIMESTAMP"),

clients/client-cloudcontrol/src/commands/CreateResourceCommand.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ export interface CreateResourceCommandOutput extends CreateResourceOutput, __Met
5858
* // TypeName: "STRING_VALUE",
5959
* // Identifier: "STRING_VALUE",
6060
* // RequestToken: "STRING_VALUE",
61+
* // HooksRequestToken: "STRING_VALUE",
6162
* // Operation: "STRING_VALUE",
6263
* // OperationStatus: "STRING_VALUE",
6364
* // EventTime: new Date("TIMESTAMP"),

clients/client-cloudcontrol/src/commands/DeleteResourceCommand.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ export interface DeleteResourceCommandOutput extends DeleteResourceOutput, __Met
5353
* // TypeName: "STRING_VALUE",
5454
* // Identifier: "STRING_VALUE",
5555
* // RequestToken: "STRING_VALUE",
56+
* // HooksRequestToken: "STRING_VALUE",
5657
* // Operation: "STRING_VALUE",
5758
* // OperationStatus: "STRING_VALUE",
5859
* // EventTime: new Date("TIMESTAMP"),

clients/client-cloudcontrol/src/commands/GetResourceRequestStatusCommand.ts

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ export interface GetResourceRequestStatusCommandOutput extends GetResourceReques
5151
* // TypeName: "STRING_VALUE",
5252
* // Identifier: "STRING_VALUE",
5353
* // RequestToken: "STRING_VALUE",
54+
* // HooksRequestToken: "STRING_VALUE",
5455
* // Operation: "STRING_VALUE",
5556
* // OperationStatus: "STRING_VALUE",
5657
* // EventTime: new Date("TIMESTAMP"),
@@ -59,6 +60,18 @@ export interface GetResourceRequestStatusCommandOutput extends GetResourceReques
5960
* // ErrorCode: "STRING_VALUE",
6061
* // RetryAfter: new Date("TIMESTAMP"),
6162
* // },
63+
* // HooksProgressEvent: [ // HooksProgressEvent
64+
* // { // HookProgressEvent
65+
* // HookTypeName: "STRING_VALUE",
66+
* // HookTypeVersionId: "STRING_VALUE",
67+
* // HookTypeArn: "STRING_VALUE",
68+
* // InvocationPoint: "STRING_VALUE",
69+
* // HookStatus: "STRING_VALUE",
70+
* // HookEventTime: new Date("TIMESTAMP"),
71+
* // HookStatusMessage: "STRING_VALUE",
72+
* // FailureMode: "STRING_VALUE",
73+
* // },
74+
* // ],
6275
* // };
6376
*
6477
* ```

clients/client-cloudcontrol/src/commands/ListResourceRequestsCommand.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ export interface ListResourceRequestsCommandOutput extends ListResourceRequestsO
6464
* // TypeName: "STRING_VALUE",
6565
* // Identifier: "STRING_VALUE",
6666
* // RequestToken: "STRING_VALUE",
67+
* // HooksRequestToken: "STRING_VALUE",
6768
* // Operation: "STRING_VALUE",
6869
* // OperationStatus: "STRING_VALUE",
6970
* // EventTime: new Date("TIMESTAMP"),

clients/client-cloudcontrol/src/commands/UpdateResourceCommand.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ export interface UpdateResourceCommandOutput extends UpdateResourceOutput, __Met
6666
* // TypeName: "STRING_VALUE",
6767
* // Identifier: "STRING_VALUE",
6868
* // RequestToken: "STRING_VALUE",
69+
* // HooksRequestToken: "STRING_VALUE",
6970
* // Operation: "STRING_VALUE",
7071
* // OperationStatus: "STRING_VALUE",
7172
* // EventTime: new Date("TIMESTAMP"),

clients/client-cloudcontrol/src/models/models_0.ts

Lines changed: 102 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ export const HandlerErrorCode = {
5757
SERVICE_LIMIT_EXCEEDED: "ServiceLimitExceeded",
5858
SERVICE_TIMEOUT: "ServiceTimeout",
5959
THROTTLING: "Throttling",
60+
UNAUTHORIZED_TAGGING_OPERATION: "UnauthorizedTaggingOperation",
6061
} as const;
6162

6263
/**
@@ -128,6 +129,12 @@ export interface ProgressEvent {
128129
*/
129130
RequestToken?: string | undefined;
130131

132+
/**
133+
* <p>The unique token representing the Hooks operation for the request.</p>
134+
* @public
135+
*/
136+
HooksRequestToken?: string | undefined;
137+
131138
/**
132139
* <p>The resource operation type.</p>
133140
* @public
@@ -949,6 +956,95 @@ export interface GetResourceRequestStatusInput {
949956
RequestToken: string | undefined;
950957
}
951958

959+
/**
960+
* <p>Represents the current status of applicable Hooks for a resource operation request. It contains list of
961+
* Hook invocation information for the resource specified in the request since the same target can invoke multiple Hooks.
962+
* For more information, see <a href="https://docs.aws.amazon.com/cloudcontrolapi/latest/userguide/resource-operations-manage-requests.html">Managing resource operation requests with Amazon Web Services Cloud Control API
963+
* </a>.</p>
964+
* @public
965+
*/
966+
export interface HookProgressEvent {
967+
/**
968+
* <p>The type name of the Hook being invoked.</p>
969+
* @public
970+
*/
971+
HookTypeName?: string | undefined;
972+
973+
/**
974+
* <p>The type version of the Hook being invoked.</p>
975+
* @public
976+
*/
977+
HookTypeVersionId?: string | undefined;
978+
979+
/**
980+
* <p>The ARN of the Hook being invoked.</p>
981+
* @public
982+
*/
983+
HookTypeArn?: string | undefined;
984+
985+
/**
986+
* <p>States whether the Hook is invoked before or after resource provisioning.</p>
987+
* @public
988+
*/
989+
InvocationPoint?: string | undefined;
990+
991+
/**
992+
* <p>The status of the Hook invocation. The following are potential statuses:</p>
993+
* <ul>
994+
* <li>
995+
* <p>
996+
* <code>HOOK_PENDING</code>: The Hook was added to the invocation plan, but not yet invoked.</p>
997+
* </li>
998+
* <li>
999+
* <p>
1000+
* <code>HOOK_IN_PROGRESS</code>: The Hook was invoked, but hasn't completed.</p>
1001+
* </li>
1002+
* <li>
1003+
* <p>
1004+
* <code>HOOK_COMPLETE_SUCCEEDED</code>: The Hook invocation is complete with a successful result.</p>
1005+
* </li>
1006+
* <li>
1007+
* <p>
1008+
* <code>HOOK_COMPLETE_FAILED</code>: The Hook invocation is complete with a failed result.</p>
1009+
* </li>
1010+
* <li>
1011+
* <p>
1012+
* <code>HOOK_FAILED</code>: The Hook invocation didn't complete successfully.</p>
1013+
* </li>
1014+
* </ul>
1015+
* @public
1016+
*/
1017+
HookStatus?: string | undefined;
1018+
1019+
/**
1020+
* <p>The time that the Hook invocation request initiated.</p>
1021+
* @public
1022+
*/
1023+
HookEventTime?: Date | undefined;
1024+
1025+
/**
1026+
* <p>The message explaining the current Hook status.</p>
1027+
* @public
1028+
*/
1029+
HookStatusMessage?: string | undefined;
1030+
1031+
/**
1032+
* <p>The failure mode of the invocation. The following are the potential statuses:</p>
1033+
* <ul>
1034+
* <li>
1035+
* <p>
1036+
* <code>FAIL</code>: This will fail the Hook invocation and the request associated with it.</p>
1037+
* </li>
1038+
* <li>
1039+
* <p>
1040+
* <code>WARN</code>: This will fail the Hook invocation, but not the request associated with it.</p>
1041+
* </li>
1042+
* </ul>
1043+
* @public
1044+
*/
1045+
FailureMode?: string | undefined;
1046+
}
1047+
9521048
/**
9531049
* @public
9541050
*/
@@ -958,6 +1054,12 @@ export interface GetResourceRequestStatusOutput {
9581054
* @public
9591055
*/
9601056
ProgressEvent?: ProgressEvent | undefined;
1057+
1058+
/**
1059+
* <p>Lists Hook invocations for the specified target in the request. This is a list since the same target can invoke multiple Hooks.</p>
1060+
* @public
1061+
*/
1062+
HooksProgressEvent?: HookProgressEvent[] | undefined;
9611063
}
9621064

9631065
/**

clients/client-cloudcontrol/src/protocols/Aws_json1_0.ts

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ import {
5555
GetResourceRequestStatusOutput,
5656
HandlerFailureException,
5757
HandlerInternalFailureException,
58+
HookProgressEvent,
5859
InvalidCredentialsException,
5960
InvalidRequestException,
6061
ListResourceRequestsInput,
@@ -860,6 +861,7 @@ const de_DeleteResourceOutput = (output: any, context: __SerdeContext): DeleteRe
860861
*/
861862
const de_GetResourceRequestStatusOutput = (output: any, context: __SerdeContext): GetResourceRequestStatusOutput => {
862863
return take(output, {
864+
HooksProgressEvent: (_: any) => de_HooksProgressEvent(_, context),
863865
ProgressEvent: (_: any) => de_ProgressEvent(_, context),
864866
}) as any;
865867
};
@@ -868,6 +870,34 @@ const de_GetResourceRequestStatusOutput = (output: any, context: __SerdeContext)
868870

869871
// de_HandlerInternalFailureException omitted.
870872

873+
/**
874+
* deserializeAws_json1_0HookProgressEvent
875+
*/
876+
const de_HookProgressEvent = (output: any, context: __SerdeContext): HookProgressEvent => {
877+
return take(output, {
878+
FailureMode: __expectString,
879+
HookEventTime: (_: any) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))),
880+
HookStatus: __expectString,
881+
HookStatusMessage: __expectString,
882+
HookTypeArn: __expectString,
883+
HookTypeName: __expectString,
884+
HookTypeVersionId: __expectString,
885+
InvocationPoint: __expectString,
886+
}) as any;
887+
};
888+
889+
/**
890+
* deserializeAws_json1_0HooksProgressEvent
891+
*/
892+
const de_HooksProgressEvent = (output: any, context: __SerdeContext): HookProgressEvent[] => {
893+
const retVal = (output || [])
894+
.filter((e: any) => e != null)
895+
.map((entry: any) => {
896+
return de_HookProgressEvent(entry, context);
897+
});
898+
return retVal;
899+
};
900+
871901
// de_InvalidCredentialsException omitted.
872902

873903
// de_InvalidRequestException omitted.
@@ -899,6 +929,7 @@ const de_ProgressEvent = (output: any, context: __SerdeContext): ProgressEvent =
899929
return take(output, {
900930
ErrorCode: __expectString,
901931
EventTime: (_: any) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))),
932+
HooksRequestToken: __expectString,
902933
Identifier: __expectString,
903934
Operation: __expectString,
904935
OperationStatus: __expectString,

0 commit comments

Comments
 (0)