Class EventBus
Define an EventBridge EventBus.
Implements
Inherited Members
Namespace: Amazon.CDK.AWS.Events
Assembly: Amazon.CDK.Lib.dll
Syntax (csharp)
public class EventBus : Resource, IEventBus, IResourceWithPolicy, IResource, IConstruct, IDependable, IResourceWithPolicyV2, IEnvironmentAware
Syntax (vb)
Public Class EventBus Inherits Resource Implements IEventBus, IResourceWithPolicy, IResource, IConstruct, IDependable, IResourceWithPolicyV2, IEnvironmentAware
Remarks
Resource: AWS::Events::EventBus
ExampleMetadata: infused
Examples
using Amazon.CDK.AWS.Events;
ConfigurationSet myConfigurationSet;
var bus = EventBus.FromEventBusName(this, "EventBus", "default");
myConfigurationSet.AddEventDestination("ToEventBus", new ConfigurationSetEventDestinationOptions {
Destination = EventDestination.EventBus(bus)
});
Synopsis
Constructors
| EventBus(Construct, string, IEventBusProps?) | Define an EventBridge EventBus. |
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. |
| PROPERTY_INJECTION_ID | Uniquely identifies this class. |
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, string?) | Grants an IAM Principal to send custom events to the eventBus so that they can be matched to rules. |
Constructors
EventBus(Construct, string, IEventBusProps?)
Define an EventBridge EventBus.
public EventBus(Construct scope, string id, IEventBusProps? props = null)
Parameters
- scope Construct
- id string
- props IEventBusProps
Remarks
Resource: AWS::Events::EventBus
ExampleMetadata: infused
Examples
using Amazon.CDK.AWS.Events;
ConfigurationSet myConfigurationSet;
var bus = EventBus.FromEventBusName(this, "EventBus", "default");
myConfigurationSet.AddEventDestination("ToEventBus", new ConfigurationSetEventDestinationOptions {
Destination = EventDestination.EventBus(bus)
});
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
Remarks
Resource: AWS::Events::EventBus
ExampleMetadata: infused
EventBusName
The physical ID of this event bus resource.
public virtual string EventBusName { get; }
Property Value
Remarks
Resource: AWS::Events::EventBus
ExampleMetadata: infused
EventBusPolicy
The policy for the event bus in JSON form.
public virtual string EventBusPolicy { get; }
Property Value
Remarks
Resource: AWS::Events::EventBus
ExampleMetadata: infused
EventSourceName
The name of the partner event source.
public virtual string? EventSourceName { get; }
Property Value
Remarks
Resource: AWS::Events::EventBus
ExampleMetadata: infused
PROPERTY_INJECTION_ID
Uniquely identifies this class.
public static string PROPERTY_INJECTION_ID { get; }
Property Value
Remarks
Resource: AWS::Events::EventBus
ExampleMetadata: infused
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
Remarks
Resource: AWS::Events::EventBus
ExampleMetadata: infused
Archive(string, IBaseArchiveProps)
Create an EventBridge archive to send events to.
public virtual Archive Archive(string id, IBaseArchiveProps props)
Parameters
- id 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 Construct
Parent construct.
- id string
Construct ID.
- eventBusArn string
ARN of imported event bus.
Returns
Remarks
Resource: AWS::Events::EventBus
ExampleMetadata: infused
FromEventBusAttributes(Construct, string, IEventBusAttributes)
Import an existing event bus resource.
public static IEventBus FromEventBusAttributes(Construct scope, string id, IEventBusAttributes attrs)
Parameters
- scope Construct
Parent construct.
- id string
Construct ID.
- attrs IEventBusAttributes
Imported event bus properties.
Returns
Remarks
Resource: AWS::Events::EventBus
ExampleMetadata: infused
FromEventBusName(Construct, string, string)
Import an existing event bus resource.
public static IEventBus FromEventBusName(Construct scope, string id, string eventBusName)
Parameters
- scope Construct
Parent construct.
- id string
Construct ID.
- eventBusName string
Name of imported event bus.
Returns
Remarks
Resource: AWS::Events::EventBus
ExampleMetadata: infused
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
Remarks
Resource: AWS::Events::EventBus
ExampleMetadata: infused
GrantPutEventsTo(IGrantable, string?)
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, string? sid = null)
Parameters
- grantee IGrantable
- sid string
Returns
Remarks
Resource: AWS::Events::EventBus
ExampleMetadata: infused