aws-cdk-lib.aws_events.IEventBus

interface IEventBus

LanguageType name
.NETAmazon.CDK.AWS.Events.IEventBus
Gogithub.com/aws/aws-cdk-go/awscdk/v2/awsevents#IEventBus
Javasoftware.amazon.awscdk.services.events.IEventBus
Pythonaws_cdk.aws_events.IEventBus
TypeScript (source)aws-cdk-lib » aws_events » IEventBus

Implemented by EventBus

Obtainable from EventBus.fromEventBusArn(), EventBus.fromEventBusAttributes(), EventBus.fromEventBusName()

Interface which all EventBus based classes MUST implement.

Properties

NameTypeDescription
envResourceEnvironmentThe environment this resource belongs to.
eventBusArnstringThe ARN of this event bus resource.
eventBusNamestringThe physical ID of this event bus resource.
eventBusPolicystringThe JSON policy of this event bus resource.
nodeNodeThe tree node.
stackStackThe stack in which this resource is defined.
eventSourceName?stringThe partner event source to associate with this event bus resource.

env

Type: ResourceEnvironment

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.


eventBusArn

Type: string

The ARN of this event bus resource.


eventBusName

Type: string

The physical ID of this event bus resource.


eventBusPolicy

Type: string

The JSON policy of this event bus resource.


node

Type: Node

The tree node.


stack

Type: Stack

The stack in which this resource is defined.


eventSourceName?

Type: string (optional)

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

Methods

NameDescription
applyRemovalPolicy(policy)Apply the given removal policy to this resource.
archive(id, props)Create an EventBridge archive to send events to.
grantPutEventsTo(grantee)Grants an IAM Principal to send custom events to the eventBus so that they can be matched to rules.

applyRemovalPolicy(policy)

public applyRemovalPolicy(policy: RemovalPolicy): void

Parameters

  • policy RemovalPolicy

Apply the given removal policy to this resource.

The Removal Policy controls what happens to this resource when it stops being managed by CloudFormation, either because you've removed it from the CDK application or because you've made a change that requires the resource to be replaced.

The resource can be deleted (RemovalPolicy.DESTROY), or left in your AWS account for data recovery and cleanup later (RemovalPolicy.RETAIN).


archive(id, props)

public archive(id: string, props: BaseArchiveProps): Archive

Parameters

  • id string
  • props BaseArchiveProps — Properties of the archive.

Returns

  • Archive

Create an EventBridge archive to send events to.

When you create an archive, incoming events might not immediately start being sent to the archive. Allow a short period of time for changes to take effect.


grantPutEventsTo(grantee)

public grantPutEventsTo(grantee: IGrantable): Grant

Parameters

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

Returns

  • Grant

Grants an IAM Principal to send custom events to the eventBus so that they can be matched to rules.