Monitoring CloudFormation and Git sync events with EventBridge - AWS CloudFormation

Monitoring CloudFormation and Git sync events with EventBridge

Amazon EventBridge is a serverless service that uses events to connect application components together, making it easier for you to build scalable event-driven applications. Event-driven architecture is a style of building loosely-coupled software systems that work together by emitting and responding to events. Events represent a change in a resource or environment.

As with many AWS services, CloudFormation generates and sends events to the EventBridge default event bus, which is automatically provisioned in every AWS account. An event bus is a router that receives events and delivers them to zero or more destinations, or targets. Rules you specify for the event bus evaluate events as they arrive. Each rule checks whether an event matches the rule's event pattern. If the event does match, the event bus sends the event to the specified target(s).

For more information, see Getting started with Amazon EventBridge in the Amazon EventBridge User Guide.

AWS services send events to the EventBridge default event bus. If the event matches a rule's event pattern, EventBridge sends the event to the targets specified for that rule.

CloudFormation and Git sync events overview

CloudFormation sends events to EventBridge whenever a create, update, delete, or drift-detection operation is performed on a stack. CloudFormation also sends events to EventBridge for status changes to stack sets and stack set instances. You can use EventBridge rules to route events to your defined targets. These events are guaranteed to be delivered, and they might be delivered out of order.

Since CloudFormation events represent changes to stacks or stack sets and their resources, you can use them to initiate workflows associated with respective events. For example:

  • Create stack or stack set specific tags on all resource provisioned through CloudFormation.

  • Establish an association between a CloudFormation stack or stack set and an Amazon WorkSpaces Application Manager (Amazon WAM).

  • Specify an association with an AppRegistry for the created stack or stack set.

The following events are generated by CloudFormation and sent to the default event bus in EventBridge. For more information, see CloudFormation events detail reference.

Event type Description Event source

Resource Status Change

Any updates performed on a stack which changes underlying resource properties.

For a complete list of supported AWS resource types, see AWS resource and property types reference.

AWS CloudFormation

Stack Status Change

Represents a status change to a given stack.

For code details, see Stack status codes.

AWS CloudFormation

Drift Detection Status Change

Represents a user-initiated drift detection update on a given stack.

For a complete list of fully mutable and immutable types that support drift detection, see Resource type support

AWS CloudFormation

StackSet Status Change

Represents a status change to a given stack set.

AWS CloudFormation

StackSet Stack Instance Status Change

Represents a status change to a specific StackSet stack instance.

For code details, see Stack instance status codes.

AWS CloudFormation

StackSet operation status

Represents a status change to a given StackSet operation.

For code details, see StackSets status codes.

AWS CloudFormation

Additionally, AWS CloudFormation Git sync sends events for status changes for repository syncs and resource syncs to EventBridge.

The following Git sync events are generated by CodeConnections and sent to the default event bus in EventBridge. For more information, see CloudFormation events detail reference.

Event type Description Event source

Repository sync status change

Represents a status change to a Git repository sync.

AWS CodeConnections

Resource sync status change

Represents a status change to a Git resource sync.

AWS CodeConnections

Amazon EventBridge permissions

CloudFormation doesn't require any additional permissions to deliver events to EventBridge. The events contain information that's already available through CloudFormation's API operations.

The targets you specify may need specific permissions or configuration. For more details on using specific services for targets, see Amazon EventBridge targets in the Amazon EventBridge User Guide.