"use strict";var _a;Object.defineProperty(exports,"__esModule",{value:!0}),exports.LambdaAction=void 0;var jsiiDeprecationWarnings=()=>{var tmp=require("../../.warnings.jsii.js");return jsiiDeprecationWarnings=()=>tmp,tmp};const JSII_RTTI_SYMBOL_1=Symbol.for("jsii.rtti");var iam=()=>{var tmp=require("../../aws-iam");return iam=()=>tmp,tmp},core_1=()=>{var tmp=require("../../core");return core_1=()=>tmp,tmp},cx_api_1=()=>{var tmp=require("../../cx-api");return cx_api_1=()=>tmp,tmp};class LambdaAction{constructor(lambdaFunction){this.lambdaFunction=lambdaFunction}bind(scope,alarm){try{jsiiDeprecationWarnings().aws_cdk_lib_aws_cloudwatch_IAlarm(alarm)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,this.bind),error}const permissionId=`${core_1().FeatureFlags.of(scope).isEnabled(cx_api_1().LAMBDA_PERMISSION_LOGICAL_ID_FOR_LAMBDA_ACTION)?alarm.node.id:""}AlarmPermission`;return this.lambdaFunction.permissionsNode.tryFindChild(permissionId)?.sourceArn!==alarm.alarmArn&&this.lambdaFunction.addPermission(permissionId,{sourceAccount:core_1().Stack.of(scope).account,action:"lambda:InvokeFunction",sourceArn:alarm.alarmArn,principal:new(iam()).ServicePrincipal("lambda.alarms.cloudwatch.amazonaws.com")}),{alarmActionArn:this.lambdaFunction.functionArn}}}exports.LambdaAction=LambdaAction,_a=JSII_RTTI_SYMBOL_1,LambdaAction[_a]={fqn:"aws-cdk-lib.aws_cloudwatch_actions.LambdaAction",version:"2.148.1"};
