Class EventBridgePutEventsEntry
An entry to be sent to EventBridge.
Implements
Inherited Members
Namespace: Amazon.CDK.AWS.Scheduler.Targets
Assembly: Amazon.CDK.Lib.dll
Syntax (csharp)
public class EventBridgePutEventsEntry : IEventBridgePutEventsEntry
Syntax (vb)
Public Class EventBridgePutEventsEntry Implements IEventBridgePutEventsEntry
Remarks
ExampleMetadata: infused
Examples
using Amazon.CDK.AWS.Events;
var eventBus = new EventBus(this, "EventBus", new EventBusProps {
EventBusName = "DomainEvents"
});
var eventEntry = new EventBridgePutEventsEntry {
EventBus = eventBus,
Source = "PetService",
Detail = ScheduleTargetInput.FromObject(new Dictionary<string, string> { { "Name", "Fluffy" } }),
DetailType = "🐶"
};
new Schedule(this, "Schedule", new ScheduleProps {
Schedule = ScheduleExpression.Rate(Duration.Hours(1)),
Target = new EventBridgePutEvents(eventEntry)
});
Synopsis
Constructors
EventBridgePutEventsEntry() | An entry to be sent to EventBridge. |
Properties
Detail | The event body. |
DetailType | Used along with the source field to help identify the fields and values expected in the detail field. |
EventBus | The event bus the entry will be sent to. |
Source | The service or application that caused this event to be generated. |
Constructors
EventBridgePutEventsEntry()
An entry to be sent to EventBridge.
public EventBridgePutEventsEntry()
Remarks
ExampleMetadata: infused
Examples
using Amazon.CDK.AWS.Events;
var eventBus = new EventBus(this, "EventBus", new EventBusProps {
EventBusName = "DomainEvents"
});
var eventEntry = new EventBridgePutEventsEntry {
EventBus = eventBus,
Source = "PetService",
Detail = ScheduleTargetInput.FromObject(new Dictionary<string, string> { { "Name", "Fluffy" } }),
DetailType = "🐶"
};
new Schedule(this, "Schedule", new ScheduleProps {
Schedule = ScheduleExpression.Rate(Duration.Hours(1)),
Target = new EventBridgePutEvents(eventEntry)
});
Properties
Detail
The event body.
public ScheduleTargetInput Detail { get; set; }
Property Value
Remarks
Can either be provided as an object or as a JSON-serialized string
Examples
ScheduleTargetInput.FromText("{\"instance-id\": \"i-1234567890abcdef0\", \"state\": \"terminated\"}");
ScheduleTargetInput.FromObject(new Dictionary<string, string> { { "Message", "Hello from a friendly event :)" } });
DetailType
Used along with the source field to help identify the fields and values expected in the detail field.
public string DetailType { get; set; }
Property Value
Remarks
For example, events by CloudTrail have detail type "AWS API Call via CloudTrail"
See: https://docs.aws.amazon.com/eventbridge/latest/userguide/eb-events.html
EventBus
The event bus the entry will be sent to.
public IEventBus EventBus { get; set; }
Property Value
Remarks
ExampleMetadata: infused
Source
The service or application that caused this event to be generated.
public string Source { get; set; }
Property Value
Remarks
Example value: com.example.service
See: https://docs.aws.amazon.com/eventbridge/latest/userguide/eb-events.html