"use strict";var _a;Object.defineProperty(exports,"__esModule",{value:!0}),exports.LambdaFunction=void 0;const jsiiDeprecationWarnings=require("../../.warnings.jsii.js"),JSII_RTTI_SYMBOL_1=Symbol.for("jsii.rtti"),util_1=require("./util");class LambdaFunction{constructor(handler,props={}){this.handler=handler,this.props=props;try{jsiiDeprecationWarnings.aws_cdk_lib_aws_lambda_IFunction(handler),jsiiDeprecationWarnings.aws_cdk_lib_aws_events_targets_LambdaFunctionProps(props)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,LambdaFunction),error}}bind(rule,_id){try{jsiiDeprecationWarnings.aws_cdk_lib_aws_events_IRule(rule)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,this.bind),error}return util_1.addLambdaPermission(rule,this.handler),this.props.deadLetterQueue&&util_1.addToDeadLetterQueueResourcePolicy(rule,this.props.deadLetterQueue),{...util_1.bindBaseTargetConfig(this.props),arn:this.handler.functionArn,input:this.props.event,targetResource:this.handler}}}exports.LambdaFunction=LambdaFunction,_a=JSII_RTTI_SYMBOL_1,LambdaFunction[_a]={fqn:"aws-cdk-lib.aws_events_targets.LambdaFunction",version:"2.29.0"};
//# sourceMappingURL=lambda.js.map
