EventBus

class aws_cdk.aws_events.EventBus(scope, id, *, event_bus_name=None, event_source_name=None)

Bases: aws_cdk.core.Resource

Define an EventBridge EventBus.

Resource

AWS::Events::EventBus

Parameters
  • scope (Construct) –

  • id (str) –

  • 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

Methods

to_string()

Returns a string representation of this construct.

Return type

str

Attributes

env

The environment this resource belongs to.

For resources that are created and managed by the CDK (generally, those created by creating new class instances like Role, Bucket, etc.), this is always the same as the environment of the stack they belong to; however, for imported resources (those obtained from static methods like fromRoleArn, fromBucketName, etc.), that might be different than the stack they were imported into.

Return type

ResourceEnvironment

event_bus_arn

aws:events:us-east-2:123456789012:event-bus/aws.partner/PartnerName/acct1/repo1.

Type

The ARN of the event bus, such as

Type

arn

Return type

str

event_bus_name

The physical ID of this event bus resource.

Return type

str

event_bus_policy

The policy for the event bus in JSON form.

Return type

str

event_source_name

The name of the partner event source.

Return type

Optional[str]

node

The construct tree node associated with this construct.

Return type

ConstructNode

stack

The stack in which this resource is defined.

Return type

Stack

Static Methods

classmethod from_event_bus_arn(scope, id, event_bus_arn)

Import an existing event bus resource.

Parameters
  • scope (Construct) – Parent construct.

  • id (str) – Construct ID.

  • event_bus_arn (str) – ARN of imported event bus.

Return type

IEventBus

classmethod from_event_bus_attributes(scope, id, *, event_bus_arn, event_bus_name, event_bus_policy, event_source_name=None)

Import an existing event bus resource.

Parameters
  • scope (Construct) – Parent construct.

  • id (str) – Construct ID.

  • event_bus_arn (str) – The ARN of this event bus resource.

  • event_bus_name (str) – The physical ID of this event bus resource.

  • event_bus_policy (str) – The JSON policy of this event bus resource.

  • event_source_name (Optional[str]) – The partner event source to associate with this event bus resource. Default: - no partner event source

Return type

IEventBus

classmethod grant_put_events(grantee)

Permits an IAM Principal to send custom events to EventBridge so that they can be matched to rules.

Parameters

grantee (IGrantable) – The principal (no-op if undefined).

Return type

Grant

classmethod is_construct(x)

Return whether the given object is a Construct.

Parameters

x (Any) –

Return type

bool