EventBusProps

class aws_cdk.aws_events.EventBusProps(*, event_bus_name=None, event_source_name=None)

Bases: object

Properties to define an event bus.

Parameters:
  • event_bus_name (Optional[str]) – The name of the event bus you are creating Note: If ‘eventSourceName’ is passed in, you cannot set this. Default: - automatically generated name

  • event_source_name (Optional[str]) – The partner event source to associate with this event bus resource Note: If ‘eventBusName’ is passed in, you cannot set this. Default: - no partner event source

ExampleMetadata:

infused

Example:

import aws_cdk.aws_events as events


event_bus = events.EventBus(self, "EventBus",
    event_bus_name="DomainEvents"
)

event_entry = targets.EventBridgePutEventsEntry(
    event_bus=event_bus,
    source="PetService",
    detail=ScheduleTargetInput.from_object({"Name": "Fluffy"}),
    detail_type="🐶"
)

Schedule(self, "Schedule",
    schedule=ScheduleExpression.rate(Duration.hours(1)),
    target=targets.EventBridgePutEvents(event_entry)
)

Attributes

event_bus_name

If ‘eventSourceName’ is passed in, you cannot set this.

Default:
  • automatically generated name

Link:

https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-events-eventbus.html#cfn-events-eventbus-name

Type:

The name of the event bus you are creating Note

event_source_name

If ‘eventBusName’ is passed in, you cannot set this.

Default:
  • no partner event source

Link:

https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-events-eventbus.html#cfn-events-eventbus-eventsourcename

Type:

The partner event source to associate with this event bus resource Note