describeEvents method

Future<DescribeEventsOutput> describeEvents({
  1. String? changeSetName,
  2. EventFilter? filters,
  3. String? nextToken,
  4. String? operationId,
  5. String? stackName,
})

Returns CloudFormation events based on flexible query criteria. Groups events by operation ID, enabling you to focus on individual stack operations during deployment.

An operation is any action performed on a stack, including stack lifecycle actions (Create, Update, Delete, Rollback), change set creation, nested stack creation, and automatic rollbacks triggered by failures. Each operation has a unique identifier (Operation ID) and represents a discrete change attempt on the stack.

Returns different types of events including:

  • Progress events - Status updates during stack operation execution.
  • Validation errors - Failures from CloudFormation Early Validations.
  • Provisioning errors - Resource creation and update failures.
  • Hook invocation errors - Failures from CloudFormation Hook during stack operations.

Parameter changeSetName : The name or Amazon Resource Name (ARN) of the change set for which you want to retrieve events.

Parameter filters : Filters to apply when retrieving events.

Parameter nextToken : The token for the next set of items to return. (You received this token from a previous call.)

Parameter operationId : The unique identifier of the operation for which you want to retrieve events.

Parameter stackName : The name or unique stack ID for which you want to retrieve events.

Implementation

Future<DescribeEventsOutput> describeEvents({
  String? changeSetName,
  EventFilter? filters,
  String? nextToken,
  String? operationId,
  String? stackName,
}) async {
  final $request = <String, String>{
    if (changeSetName != null) 'ChangeSetName': changeSetName,
    if (filters != null)
      for (var e1 in filters.toQueryMap().entries)
        'Filters.${e1.key}': e1.value,
    if (nextToken != null) 'NextToken': nextToken,
    if (operationId != null) 'OperationId': operationId,
    if (stackName != null) 'StackName': stackName,
  };
  final $result = await _protocol.send(
    $request,
    action: 'DescribeEvents',
    version: '2010-05-15',
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    resultWrapper: 'DescribeEventsResult',
  );
  return DescribeEventsOutput.fromXml($result);
}