Skip to content
v2.274.0

AppSyncEventBridgeDataSource ​

An AppSync datasource backed by EventBridge.

Example ​

ts
import * as events from 'aws-cdk-lib/aws-events';

const api = new appsync.EventApi(this, 'EventApiEventBridge', {
  apiName: 'EventBridgeEventApi',
});

const eventBus = new events.EventBus(this, 'test-bus');

const dataSource = api.addEventBridgeDataSource('eventbridgeds', eventBus);
python
import aws_cdk.aws_events as events


api = appsync.EventApi(self, "EventApiEventBridge",
    api_name="EventBridgeEventApi"
)

event_bus = events.EventBus(self, "test-bus")

data_source = api.add_event_bridge_data_source("eventbridgeds", event_bus)
java
import software.amazon.awscdk.services.events.*;


EventApi api = EventApi.Builder.create(this, "EventApiEventBridge")
        .apiName("EventBridgeEventApi")
        .build();

EventBus eventBus = new EventBus(this, "test-bus");

AppSyncEventBridgeDataSource dataSource = api.addEventBridgeDataSource("eventbridgeds", eventBus);
csharp
// Install: dotnet add package Amazon.CDK.Lib
using Amazon.CDK.AWS.Events;


var api = new EventApi(this, "EventApiEventBridge", new EventApiProps {
    ApiName = "EventBridgeEventApi"
});

var eventBus = new EventBus(this, "test-bus");

var dataSource = api.AddEventBridgeDataSource("eventbridgeds", eventBus);
go
// Install: go get github.com/aws/aws-cdk-go/awscdk/v2
import events "github.com/aws/aws-cdk-go/awscdk"


api := appsync.NewEventApi(this, jsii.String("EventApiEventBridge"), &EventApiProps{
	ApiName: jsii.String("EventBridgeEventApi"),
})

eventBus := events.NewEventBus(this, jsii.String("test-bus"))

dataSource := api.AddEventBridgeDataSource(jsii.String("eventbridgeds"), eventBus)

Initializer ​

ts
new AppSyncEventBridgeDataSource(scope: Construct, id: string, props: AppSyncEventBridgeDataSourceProps)
python
AppSyncEventBridgeDataSource(scope: Construct, id: str, props: AppSyncEventBridgeDataSourceProps)
java
new AppSyncEventBridgeDataSource(Construct scope, String id, AppSyncEventBridgeDataSourceProps props)
csharp
new AppSyncEventBridgeDataSource(Construct scope, string id, AppSyncEventBridgeDataSourceProps props)
go
NewAppSyncEventBridgeDataSource(Scope Construct, Id *string, Props AppSyncEventBridgeDataSourceProps)

Construct Props ​

The API to attach this data source to.
descriptionoptionalstringdescriptionoptionalstrdescriptionoptionalStringDescriptionoptionalstringDescriptionoptional*string= None#
The description of the data source.
eventBusIEventBusevent_busIEventBuseventBusIEventBusEventBusIEventBusEventBusIEventBusrequired#
The EventBridge EventBus.
nameoptionalstringnameoptionalstrnameoptionalStringNameoptionalstringNameoptional*string#
The name of the data source.

Default: id of data source

The only allowed pattern is: {[_A-Za-z][_0-9A-Za-z]*}. Any invalid characters will be automatically removed.

serviceRoleoptionalIRoleservice_roleoptionalIRoleserviceRoleoptionalIRoleServiceRoleoptionalIRoleServiceRoleoptionalIRole#
The IAM service role to be assumed by AppSync to interact with the data source.

Default: Create a new role

Properties ​

grantPrincipalIPrincipalgrant_principalIPrincipalgrantPrincipalIPrincipalGrantPrincipalIPrincipalGrantPrincipalIPrincipalrequired#
The principal of the data source to be IGrantable.
namestringnamestrnameStringNamestringName*stringrequired#
The name of the data source.
nodeNodenodeNodenodeNodeNodeNodeNodeNoderequired#
The tree node.
resourceCfnDataSourceresourceCfnDataSourceresourceCfnDataSourceResourceCfnDataSourceResourceCfnDataSourcerequired#
The underlying CFN data source resource.

Methods ​

isConstruct(x: any): boolean@staticmethod def is_construct(x: Any) -> boolpublic static Boolean isConstruct(Object x)public static bool IsConstruct(object x)func IsConstruct(X interface{}) *boolstatic#
Checks if `x` is a construct.
notes · 1 parameter · returns

Use this method instead of instanceof to properly detect Construct instances, even when the construct library is symlinked.

Explanation: in JavaScript, multiple copies of the constructs library on disk are seen as independent, completely different libraries. As a consequence, the class Construct in each copy of the constructs library is seen as a different class, and an instance of one class will not test as instanceof the other class. npm install will not create installations like this, but users may manually symlink construct libraries together or use a monorepo tool: in those cases, multiple copies of the constructs library can be accidentally installed, and instanceof will behave unpredictably. It is safest to avoid using instanceof, and using this type-testing method instead.

Parameters

  • xxxxX — Any object.

Returns: true if x is an object created from a class which extends Construct.

toString(): stringdef to_string(self, ) -> strpublic String toString()public string ToString()func ToString() *string#
Returns a string representation of this construct.
with(...mixins: IMixin[]): IConstructdef with(self, mixins: IMixin) -> IConstructpublic IConstruct with(IMixin mixins)public IConstruct With(IMixin mixins)func With(Mixins IMixin) IConstruct#
Applies one or more mixins to this construct.

Mixins are applied in order. The list of constructs is captured at the start of the call, so constructs added by a mixin will not be visited. Use multiple with() calls if subsequent mixins should apply to added constructs.

1 parameter · returns

Parameters

  • mixinsmixinsmixinsmixinsMixins — The mixins to apply.

Returns: This construct for chaining