EventBusReference

class aws_cdk.interfaces.aws_events.EventBusReference(*, event_bus_arn, event_bus_name)

Bases: object

A reference to a EventBus resource.

Parameters:
  • event_bus_arn (str) – The ARN of the EventBus resource.

  • event_bus_name (str) – The Name of the EventBus resource.

ExampleMetadata:

infused

Example:

import aws_cdk.aws_events as events
from aws_cdk.aws_apigatewayv2_integrations import HttpEventBridgeIntegration

# bus: events.IEventBus
# http_api: apigwv2.HttpApi


# default integration (PutEvents)
http_api.add_routes(
    path="/default",
    methods=[apigwv2.HttpMethod.POST],
    integration=HttpEventBridgeIntegration("DefaultEventBridgeIntegration",
        event_bus_ref=bus.event_bus_ref
    )
)

# explicit subtype
http_api.add_routes(
    path="/put-events",
    methods=[apigwv2.HttpMethod.POST],
    integration=HttpEventBridgeIntegration("ExplicitSubtypeIntegration",
        event_bus_ref=bus.event_bus_ref,
        subtype=apigwv2.HttpIntegrationSubtype.EVENTBRIDGE_PUT_EVENTS
    )
)

Attributes

event_bus_arn

The ARN of the EventBus resource.

event_bus_name

The Name of the EventBus resource.