Class EventBus
Define an EventBridge EventBus.
Inherited Members
Namespace: Amazon.CDK.AWS.Events
Assembly: Amazon.CDK.Lib.dll
Syntax (csharp)
public class EventBus : Resource, IEventBus, IResource
Syntax (vb)
Public Class EventBus
Inherits Resource
Implements IEventBus, IResource
Remarks
Resource: AWS::Events::EventBus
ExampleMetadata: infused
Examples
var bus = new EventBus(this, "bus", new EventBusProps {
EventBusName = "MyCustomEventBus",
Description = "MyCustomEventBus"
});
bus.Archive("MyArchive", new BaseArchiveProps {
ArchiveName = "MyCustomEventBusArchive",
Description = "MyCustomerEventBus Archive",
EventPattern = new EventPattern {
Account = new [] { Stack.Of(this).Account }
},
Retention = Duration.Days(365)
});
Synopsis
Constructors
EventBus(ByRefValue) | Used by jsii to construct an instance of this class from a Javascript-owned object reference |
EventBus(DeputyBase.DeputyProps) | Used by jsii to construct an instance of this class from DeputyProps |
EventBus(Construct, String, IEventBusProps) |
Properties
EventBusArn | The ARN of the event bus, such as: arn:aws:events:us-east-2:123456789012:event-bus/aws.partner/PartnerName/acct1/repo1. |
EventBusName | The physical ID of this event bus resource. |
EventBusPolicy | The policy for the event bus in JSON form. |
EventSourceName | The name of the partner event source. |
Methods
AddToResourcePolicy(PolicyStatement) | Adds a statement to the IAM resource policy associated with this event bus. |
Archive(String, IBaseArchiveProps) | Create an EventBridge archive to send events to. |
FromEventBusArn(Construct, String, String) | Import an existing event bus resource. |
FromEventBusAttributes(Construct, String, IEventBusAttributes) | Import an existing event bus resource. |
FromEventBusName(Construct, String, String) | Import an existing event bus resource. |
GrantAllPutEvents(IGrantable) | Permits an IAM Principal to send custom events to EventBridge so that they can be matched to rules. |
GrantPutEventsTo(IGrantable) | Grants an IAM Principal to send custom events to the eventBus so that they can be matched to rules. |
Constructors
EventBus(ByRefValue)
Used by jsii to construct an instance of this class from a Javascript-owned object reference
protected EventBus(ByRefValue reference)
Parameters
- reference Amazon.JSII.Runtime.Deputy.ByRefValue
The Javascript-owned object reference
EventBus(DeputyBase.DeputyProps)
Used by jsii to construct an instance of this class from DeputyProps
protected EventBus(DeputyBase.DeputyProps props)
Parameters
- props Amazon.JSII.Runtime.Deputy.DeputyBase.DeputyProps
The deputy props
EventBus(Construct, String, IEventBusProps)
public EventBus(Construct scope, string id, IEventBusProps props = null)
Parameters
- scope Constructs.Construct
- id System.String
- props IEventBusProps
Properties
EventBusArn
The ARN of the event bus, such as: arn:aws:events:us-east-2:123456789012:event-bus/aws.partner/PartnerName/acct1/repo1.
public virtual string EventBusArn { get; }
Property Value
System.String
EventBusName
The physical ID of this event bus resource.
public virtual string EventBusName { get; }
Property Value
System.String
EventBusPolicy
The policy for the event bus in JSON form.
public virtual string EventBusPolicy { get; }
Property Value
System.String
EventSourceName
The name of the partner event source.
public virtual string EventSourceName { get; }
Property Value
System.String
Methods
AddToResourcePolicy(PolicyStatement)
Adds a statement to the IAM resource policy associated with this event bus.
public virtual IAddToResourcePolicyResult AddToResourcePolicy(PolicyStatement statement)
Parameters
- statement PolicyStatement
Returns
Archive(String, IBaseArchiveProps)
Create an EventBridge archive to send events to.
public virtual Archive Archive(string id, IBaseArchiveProps props)
Parameters
- id System.String
- props IBaseArchiveProps
Returns
Remarks
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.
FromEventBusArn(Construct, String, String)
Import an existing event bus resource.
public static IEventBus FromEventBusArn(Construct scope, string id, string eventBusArn)
Parameters
- scope Constructs.Construct
Parent construct.
- id System.String
Construct ID.
- eventBusArn System.String
ARN of imported event bus.
Returns
FromEventBusAttributes(Construct, String, IEventBusAttributes)
Import an existing event bus resource.
public static IEventBus FromEventBusAttributes(Construct scope, string id, IEventBusAttributes attrs)
Parameters
- scope Constructs.Construct
Parent construct.
- id System.String
Construct ID.
- attrs IEventBusAttributes
Imported event bus properties.
Returns
FromEventBusName(Construct, String, String)
Import an existing event bus resource.
public static IEventBus FromEventBusName(Construct scope, string id, string eventBusName)
Parameters
- scope Constructs.Construct
Parent construct.
- id System.String
Construct ID.
- eventBusName System.String
Name of imported event bus.
Returns
GrantAllPutEvents(IGrantable)
Permits an IAM Principal to send custom events to EventBridge so that they can be matched to rules.
public static Grant GrantAllPutEvents(IGrantable grantee)
Parameters
- grantee IGrantable
The principal (no-op if undefined).
Returns
GrantPutEventsTo(IGrantable)
Grants an IAM Principal to send custom events to the eventBus so that they can be matched to rules.
public virtual Grant GrantPutEventsTo(IGrantable grantee)
Parameters
- grantee IGrantable
Returns