interface EventBridgePutEventsEntry
Language | Type name |
---|---|
![]() | Amazon.CDK.AWS.Scheduler.Targets.EventBridgePutEventsEntry |
![]() | github.com/aws/aws-cdk-go/awscdk/v2/awsschedulertargets#EventBridgePutEventsEntry |
![]() | software.amazon.awscdk.services.scheduler.targets.EventBridgePutEventsEntry |
![]() | aws_cdk.aws_scheduler_targets.EventBridgePutEventsEntry |
![]() | aws-cdk-lib » aws_scheduler_targets » EventBridgePutEventsEntry |
An entry to be sent to EventBridge.
See also: https://docs.aws.amazon.com/eventbridge/latest/APIReference/API_PutEventsRequestEntry.html
Example
import * as events from 'aws-cdk-lib/aws-events';
const eventBus = new events.EventBus(this, 'EventBus', {
eventBusName: 'DomainEvents',
});
const eventEntry: targets.EventBridgePutEventsEntry = {
eventBus,
source: 'PetService',
detail: ScheduleTargetInput.fromObject({ Name: 'Fluffy' }),
detailType: '🐶',
};
new Schedule(this, 'Schedule', {
schedule: ScheduleExpression.rate(Duration.hours(1)),
target: new targets.EventBridgePutEvents(eventEntry),
});
Properties
Name | Type | Description |
---|---|---|
detail | Schedule | The event body. |
detail | string | Used along with the source field to help identify the fields and values expected in the detail field. |
event | IEvent | The event bus the entry will be sent to. |
source | string | The service or application that caused this event to be generated. |
detail
Type:
Schedule
The event body.
Can either be provided as an object or as a JSON-serialized string Example
ScheduleTargetInput.fromText('{"instance-id": "i-1234567890abcdef0", "state": "terminated"}');
ScheduleTargetInput.fromObject({ Message: 'Hello from a friendly event :)' });
detailType
Type:
string
Used along with the source field to help identify the fields and values expected in the detail field.
For example, events by CloudTrail have detail type "AWS API Call via CloudTrail"
See also: https://docs.aws.amazon.com/eventbridge/latest/userguide/eb-events.html
eventBus
Type:
IEvent
The event bus the entry will be sent to.
source
Type:
string
The service or application that caused this event to be generated.
Example value: com.example.service
See also: https://docs.aws.amazon.com/eventbridge/latest/userguide/eb-events.html