CloudWatch Event Source
See CloudWatch Event sample for an example of how to use the CloudWatch Event source.
Syntax
EventBus: String|Expression
Pattern: JSON
Properties
EventBus-
The
EventBusattribute specifies which event bus to listen to.Required: Yes
Type: String or Expression
Pattern-
The
Patternattribute describes which events are routed to the Lambda function. For more information, see Events and Event Patterns in EventBridge in the Amazon EventBridge User Guide.For better consistency with the SDK, the attributes can be capitalized and will be converted by the tool automatically. For example,
DetailTypebecomesdetail-type,Sourcebecomessource, and so on. Note the renaming is only applied to top-level attributes.NOTE: The
Resourcesattribute defaults to!Sub "lambdasharp:tier:${Deployment::Tier}"when omitted. UseResources: nullto have no constraints on theresourcesattribute.Required: Yes
Type: JSON
Examples
Receive Events from Deployment Tier
The following definition receives events from Sample.Event module of type MyEvent, but only when sent from the same deployment tier.
Sources:
- EventBus: default
Pattern:
Source:
- Sample.Event
DetailType:
- MyEvent
Resources:
- !Sub "lambdasharp:tier:${Deployment::Tier}"