aws-cdk-lib
Version:
Version 2 of the AWS Cloud Development Kit library
2 lines (1 loc) • 1.44 kB
JavaScript
;var _a;Object.defineProperty(exports,"__esModule",{value:!0}),exports.EventBridgeDestination=void 0;const jsiiDeprecationWarnings=require("../../.warnings.jsii.js"),JSII_RTTI_SYMBOL_1=Symbol.for("jsii.rtti"),events=require("../../aws-events"),core_1=require("../../core");class EventBridgeDestination{constructor(eventBus){this.eventBus=eventBus;try{jsiiDeprecationWarnings.aws_cdk_lib_aws_events_IEventBus(eventBus)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,EventBridgeDestination),error}}bind(_scope,fn,_options){try{jsiiDeprecationWarnings.aws_cdk_lib_aws_lambda_IFunction(fn),jsiiDeprecationWarnings.aws_cdk_lib_aws_lambda_DestinationOptions(_options)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,this.bind),error}if(this.eventBus)return this.eventBus.grantPutEventsTo(fn),{destination:this.eventBus.eventBusArn};let eventBus=_scope.node.tryFindChild("DefaultEventBus")||events.EventBus.fromEventBusArn(_scope,"DefaultEventBus",core_1.Stack.of(fn).formatArn({service:"events",resource:"event-bus",resourceName:"default"}));return eventBus.grantPutEventsTo(fn),{destination:eventBus.eventBusArn}}}exports.EventBridgeDestination=EventBridgeDestination,_a=JSII_RTTI_SYMBOL_1,EventBridgeDestination[_a]={fqn:"aws-cdk-lib.aws_lambda_destinations.EventBridgeDestination",version:"2.70.0"};