2025/09/04 - AWS CloudFormation - 2 updated api methods
Changes ListHookResults API now supports retrieving invocation results for all CloudFormation Hooks (previously limited to create change set and Cloud Control operations) with new optional parameters for filtering by Hook status and ARN.
{'StackEvents': {'HookInvocationId': 'string'}}
Returns all stack related events for a specified stack in reverse chronological order. For more information about a stack's event history, see Understand CloudFormation stack creation events in the CloudFormation User Guide.
See also: AWS API Documentation
Request Syntax
client.describe_stack_events( StackName='string', NextToken='string' )
string
The name or the unique stack ID that's associated with the stack, which aren't always interchangeable:
Running stacks: You can specify either the stack's name or its unique stack ID.
Deleted stacks: You must specify the unique stack ID.
string
A string that identifies the next page of events that you want to retrieve.
dict
Response Syntax
{ 'StackEvents': [ { 'StackId': 'string', 'EventId': 'string', 'StackName': 'string', 'LogicalResourceId': 'string', 'PhysicalResourceId': 'string', 'ResourceType': 'string', 'Timestamp': datetime(2015, 1, 1), 'ResourceStatus': 'CREATE_IN_PROGRESS'|'CREATE_FAILED'|'CREATE_COMPLETE'|'DELETE_IN_PROGRESS'|'DELETE_FAILED'|'DELETE_COMPLETE'|'DELETE_SKIPPED'|'UPDATE_IN_PROGRESS'|'UPDATE_FAILED'|'UPDATE_COMPLETE'|'IMPORT_FAILED'|'IMPORT_COMPLETE'|'IMPORT_IN_PROGRESS'|'IMPORT_ROLLBACK_IN_PROGRESS'|'IMPORT_ROLLBACK_FAILED'|'IMPORT_ROLLBACK_COMPLETE'|'EXPORT_FAILED'|'EXPORT_COMPLETE'|'EXPORT_IN_PROGRESS'|'EXPORT_ROLLBACK_IN_PROGRESS'|'EXPORT_ROLLBACK_FAILED'|'EXPORT_ROLLBACK_COMPLETE'|'UPDATE_ROLLBACK_IN_PROGRESS'|'UPDATE_ROLLBACK_COMPLETE'|'UPDATE_ROLLBACK_FAILED'|'ROLLBACK_IN_PROGRESS'|'ROLLBACK_COMPLETE'|'ROLLBACK_FAILED', 'ResourceStatusReason': 'string', 'ResourceProperties': 'string', 'ClientRequestToken': 'string', 'HookType': 'string', 'HookStatus': 'HOOK_IN_PROGRESS'|'HOOK_COMPLETE_SUCCEEDED'|'HOOK_COMPLETE_FAILED'|'HOOK_FAILED', 'HookStatusReason': 'string', 'HookInvocationPoint': 'PRE_PROVISION', 'HookInvocationId': 'string', 'HookFailureMode': 'FAIL'|'WARN', 'DetailedStatus': 'CONFIGURATION_COMPLETE'|'VALIDATION_FAILED' }, ], 'NextToken': 'string' }
Response Structure
(dict) --
The output for a DescribeStackEvents action.
StackEvents (list) --
A list of StackEvents structures.
(dict) --
The StackEvent data type.
StackId (string) --
The unique ID name of the instance of the stack.
EventId (string) --
The unique identifier of this event.
StackName (string) --
The name associated with a stack.
LogicalResourceId (string) --
The logical name of the resource specified in the template.
PhysicalResourceId (string) --
The name or unique identifier associated with the physical instance of the resource.
ResourceType (string) --
Type of resource. For more information, see Amazon Web Services resource and property types reference in the CloudFormation User Guide.
Timestamp (datetime) --
Time the status was updated.
ResourceStatus (string) --
Current status of the resource.
ResourceStatusReason (string) --
Success/failure message associated with the resource.
ResourceProperties (string) --
BLOB of the properties used to create the resource.
ClientRequestToken (string) --
The token passed to the operation that generated this event.
All events triggered by a given stack operation are assigned the same client request token, which you can use to track operations. For example, if you execute a CreateStack operation with the token token1, then all the StackEvents generated by that operation will have ClientRequestToken set as token1.
In the console, stack operations display the client request token on the Events tab. Stack operations that are initiated from the console use the token format Console-StackOperation-ID, which helps you easily identify the stack operation . For example, if you create a stack using the console, each stack event would be assigned the same token in the following format: Console-CreateStack-7f59c3cf-00d2-40c7-b2ff-e75db0987002.
HookType (string) --
The name of the Hook.
HookStatus (string) --
Provides the status of the change set Hook.
HookStatusReason (string) --
Provides the reason for the Hook status.
HookInvocationPoint (string) --
The specific point in the provisioning process where the Hook is invoked.
HookInvocationId (string) --
The unique identifier of the Hook invocation.
HookFailureMode (string) --
Specify the Hook failure mode for non-compliant resources in the followings ways.
FAIL Stops provisioning resources.
WARN Allows provisioning to continue with a warning message.
DetailedStatus (string) --
An optional field that contains information about the detailed status of the stack event.
CONFIGURATION_COMPLETE - all of the resources in the stack have reached that event. For more information, see Understand CloudFormation stack creation events in the CloudFormation User Guide.
VALIDATION_FAILED - template validation failed because of invalid properties in the template. The ResourceStatusReason field shows what properties are defined incorrectly.
NextToken (string) --
If the output exceeds 1 MB in size, a string that identifies the next page of events. If no additional page exists, this value is null.
{'Status': 'HOOK_IN_PROGRESS | HOOK_COMPLETE_SUCCEEDED | HOOK_COMPLETE_FAILED ' '| HOOK_FAILED', 'TypeArn': 'string'}Response
{'HookResults': {'HookExecutionTarget': 'string', 'HookResultId': 'string', 'InvokedAt': 'timestamp', 'TargetId': 'string', 'TargetType': 'CHANGE_SET | STACK | RESOURCE | CLOUD_CONTROL', 'TypeArn': 'string'}}
Returns summaries of invoked Hooks. For more information, see View CloudFormation Hooks invocations in the CloudFormation Hooks User Guide.
This operation supports the following parameter combinations:
No parameters: Returns all Hook invocation summaries.
TypeArn only: Returns summaries for a specific Hook.
TypeArn and Status: Returns summaries for a specific Hook filtered by status.
TargetId and TargetType: Returns summaries for a specific Hook invocation target.
See also: AWS API Documentation
Request Syntax
client.list_hook_results( TargetType='CHANGE_SET'|'STACK'|'RESOURCE'|'CLOUD_CONTROL', TargetId='string', TypeArn='string', Status='HOOK_IN_PROGRESS'|'HOOK_COMPLETE_SUCCEEDED'|'HOOK_COMPLETE_FAILED'|'HOOK_FAILED', NextToken='string' )
string
Filters results by target type. Currently, only CHANGE_SET and CLOUD_CONTROL are supported filter options.
Required when TargetId is specified and cannot be used otherwise.
string
Filters results by the unique identifier of the target the Hook was invoked against.
For change sets, this is the change set ARN. When the target is a Cloud Control API operation, this value must be the HookRequestToken returned by the Cloud Control API request. For more information on the HookRequestToken, see ProgressEvent.
Required when TargetType is specified and cannot be used otherwise.
string
Filters results by the ARN of the Hook. Can be used alone or in combination with Status.
string
Filters results by the status of Hook invocations. Can only be used in combination with TypeArn. Valid values are:
HOOK_IN_PROGRESS: The Hook is currently running.
HOOK_COMPLETE_SUCCEEDED: The Hook completed successfully.
HOOK_COMPLETE_FAILED: The Hook completed but failed validation.
HOOK_FAILED: The Hook encountered an error during execution.
string
A string that identifies the next page of events that you want to retrieve.
dict
Response Syntax
{ 'TargetType': 'CHANGE_SET'|'STACK'|'RESOURCE'|'CLOUD_CONTROL', 'TargetId': 'string', 'HookResults': [ { 'HookResultId': 'string', 'InvocationPoint': 'PRE_PROVISION', 'FailureMode': 'FAIL'|'WARN', 'TypeName': 'string', 'TypeVersionId': 'string', 'TypeConfigurationVersionId': 'string', 'Status': 'HOOK_IN_PROGRESS'|'HOOK_COMPLETE_SUCCEEDED'|'HOOK_COMPLETE_FAILED'|'HOOK_FAILED', 'HookStatusReason': 'string', 'InvokedAt': datetime(2015, 1, 1), 'TargetType': 'CHANGE_SET'|'STACK'|'RESOURCE'|'CLOUD_CONTROL', 'TargetId': 'string', 'TypeArn': 'string', 'HookExecutionTarget': 'string' }, ], 'NextToken': 'string' }
Response Structure
(dict) --
TargetType (string) --
The target type.
TargetId (string) --
The unique identifier of the Hook invocation target.
HookResults (list) --
A list of HookResultSummary structures that provides the status and Hook status reason for each Hook invocation for the specified target.
(dict) --
Describes a Hook invocation, its status, and the reason for its status.
HookResultId (string) --
The unique identifier for this Hook invocation result.
InvocationPoint (string) --
The specific point in the provisioning process where the Hook is invoked.
FailureMode (string) --
The failure mode of the invocation.
TypeName (string) --
The name of the Hook that was invoked.
TypeVersionId (string) --
The version of the Hook that was invoked.
TypeConfigurationVersionId (string) --
The version of the Hook configuration.
Status (string) --
The status of the Hook invocation. The following statuses are possible:
HOOK_IN_PROGRESS: The Hook is currently running.
HOOK_COMPLETE_SUCCEEDED: The Hook completed successfully.
HOOK_COMPLETE_FAILED: The Hook completed but failed validation.
HOOK_FAILED: The Hook encountered an error during execution.
HookStatusReason (string) --
A description of the Hook results status. For example, if the Hook result is in a failed state, this may contain additional information for the failed state.
InvokedAt (datetime) --
The timestamp when the Hook was invoked.
Only shown in responses when the request does not specify TargetType and TargetId filters.
TargetType (string) --
The target type that the Hook was invoked against.
TargetId (string) --
The unique identifier of the Hook invocation target.
TypeArn (string) --
The ARN of the Hook that was invoked.
HookExecutionTarget (string) --
The ARN of the target stack or request token of the Cloud Control API operation.
Only shown in responses when the request does not specify TargetType and TargetId filters.
NextToken (string) --
Pagination token, null or empty if no more results.