"use strict";var _a;Object.defineProperty(exports,"__esModule",{value:!0}),exports.TriggerInvalidation=exports.Trigger=void 0;const jsiiDeprecationWarnings=require("../../.warnings.jsii.js"),JSII_RTTI_SYMBOL_1=Symbol.for("jsii.rtti"),path_1=require("path"),core_1=require("../../core"),constructs_1=require("constructs");class Trigger extends constructs_1.Construct{constructor(scope,id,props){var _b,_c;super(scope,id);try{jsiiDeprecationWarnings.aws_cdk_lib_triggers_TriggerProps(props)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,this.constructor),error}const handlerArn=this.determineHandlerArn(props),provider=core_1.CustomResourceProvider.getOrCreateProvider(this,"AWSCDK.TriggerCustomResourceProvider",{runtime:core_1.CustomResourceProviderRuntime.NODEJS_14_X,codeDirectory:path_1.join(__dirname,"lambda"),policyStatements:[{Effect:"Allow",Action:["lambda:InvokeFunction"],Resource:[handlerArn]}]});new core_1.CustomResource(this,"Default",{resourceType:"Custom::Trigger",serviceToken:provider.serviceToken,properties:{HandlerArn:handlerArn}}),this.executeAfter(...(_b=props.executeAfter)!==null&&_b!==void 0?_b:[]),this.executeBefore(...(_c=props.executeBefore)!==null&&_c!==void 0?_c:[])}executeAfter(...scopes){constructs_1.Node.of(this).addDependency(...scopes)}executeBefore(...scopes){for(const s of scopes)constructs_1.Node.of(s).addDependency(this)}determineHandlerArn(props){return props.handler.currentVersion.functionArn}}exports.Trigger=Trigger,_a=JSII_RTTI_SYMBOL_1,Trigger[_a]={fqn:"aws-cdk-lib.triggers.Trigger",version:"2.24.1"};var TriggerInvalidation;(function(TriggerInvalidation2){TriggerInvalidation2.HANDLER_CHANGE="WHEN_FUNCTION_CHANGES"})(TriggerInvalidation=exports.TriggerInvalidation||(exports.TriggerInvalidation={}));
//# sourceMappingURL=trigger.js.map
