IEventBus

class aws_cdk.aws_events.IEventBus(*args, **kwds)

Bases: IResource, Protocol

Interface which all EventBus based classes MUST implement.

Methods

apply_removal_policy(policy)

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).

Parameters:

policy (RemovalPolicy) –

Return type:

None

archive(id, *, event_pattern, archive_name=None, description=None, retention=None)

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.

Parameters:
  • id (str) –

  • event_pattern (Union[EventPattern, Dict[str, Any]]) – An event pattern to use to filter events sent to the archive.

  • archive_name (Optional[str]) – The name of the archive. Default: - Automatically generated

  • description (Optional[str]) – A description for the archive. Default: - none

  • retention (Optional[Duration]) – The number of days to retain events for. Default value is 0. If set to 0, events are retained indefinitely. Default: - Infinite

Return type:

Archive

grant_put_events_to(grantee)

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

Parameters:

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

Return type:

Grant

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.

event_bus_arn

The ARN of this event bus resource.

Attribute:

true

Link:

https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-events-eventbus.html#Arn-fn::getatt

event_bus_name

The physical ID of this event bus resource.

Attribute:

true

Link:

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

event_bus_policy

The JSON policy of this event bus resource.

Attribute:

true

Link:

https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-events-eventbus.html#Policy-fn::getatt

event_source_name

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

Link:

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

node

The construct tree node for this construct.

stack

The stack in which this resource is defined.