Class EventBridgeDataSource
An AppSync datasource backed by EventBridge.
Implements
Inherited Members
Namespace: Amazon.CDK.AWS.AppSync
Assembly: Amazon.CDK.Lib.dll
Syntax (csharp)
public class EventBridgeDataSource : BackedDataSource, IGrantable
Syntax (vb)
Public Class EventBridgeDataSource Inherits BackedDataSource Implements IGrantable
Remarks
ExampleMetadata: infused
Examples
using Amazon.CDK.AWS.Events;
var api = new GraphqlApi(this, "EventBridgeApi", new GraphqlApiProps {
Name = "EventBridgeApi",
Definition = Definition.FromFile(Join(__dirname, "appsync.eventbridge.graphql"))
});
var bus = new EventBus(this, "DestinationEventBus", new EventBusProps { });
var dataSource = api.AddEventBridgeDataSource("NoneDS", bus);
dataSource.CreateResolver("EventResolver", new BaseResolverProps {
TypeName = "Mutation",
FieldName = "emitEvent",
RequestMappingTemplate = MappingTemplate.FromFile("request.vtl"),
ResponseMappingTemplate = MappingTemplate.FromFile("response.vtl")
});
Synopsis
Constructors
EventBridgeDataSource(Construct, string, IEventBridgeDataSourceProps) | An AppSync datasource backed by EventBridge. |
Properties
PROPERTY_INJECTION_ID | Uniquely identifies this class. |
Constructors
EventBridgeDataSource(Construct, string, IEventBridgeDataSourceProps)
An AppSync datasource backed by EventBridge.
public EventBridgeDataSource(Construct scope, string id, IEventBridgeDataSourceProps props)
Parameters
- scope Construct
- id string
- props IEventBridgeDataSourceProps
Remarks
ExampleMetadata: infused
Examples
using Amazon.CDK.AWS.Events;
var api = new GraphqlApi(this, "EventBridgeApi", new GraphqlApiProps {
Name = "EventBridgeApi",
Definition = Definition.FromFile(Join(__dirname, "appsync.eventbridge.graphql"))
});
var bus = new EventBus(this, "DestinationEventBus", new EventBusProps { });
var dataSource = api.AddEventBridgeDataSource("NoneDS", bus);
dataSource.CreateResolver("EventResolver", new BaseResolverProps {
TypeName = "Mutation",
FieldName = "emitEvent",
RequestMappingTemplate = MappingTemplate.FromFile("request.vtl"),
ResponseMappingTemplate = MappingTemplate.FromFile("response.vtl")
});
Properties
PROPERTY_INJECTION_ID
Uniquely identifies this class.
public static string PROPERTY_INJECTION_ID { get; }
Property Value
Remarks
ExampleMetadata: infused