"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.DeploymentLifecycleLambdaTarget=exports.DeploymentLifecycleStage=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},DeploymentLifecycleStage;(function(DeploymentLifecycleStage2){DeploymentLifecycleStage2.RECONCILE_SERVICE="RECONCILE_SERVICE",DeploymentLifecycleStage2.PRE_SCALE_UP="PRE_SCALE_UP",DeploymentLifecycleStage2.POST_SCALE_UP="POST_SCALE_UP",DeploymentLifecycleStage2.TEST_TRAFFIC_SHIFT="TEST_TRAFFIC_SHIFT",DeploymentLifecycleStage2.POST_TEST_TRAFFIC_SHIFT="POST_TEST_TRAFFIC_SHIFT",DeploymentLifecycleStage2.PRODUCTION_TRAFFIC_SHIFT="PRODUCTION_TRAFFIC_SHIFT",DeploymentLifecycleStage2.POST_PRODUCTION_TRAFFIC_SHIFT="POST_PRODUCTION_TRAFFIC_SHIFT"})(DeploymentLifecycleStage||(exports.DeploymentLifecycleStage=DeploymentLifecycleStage={}));class DeploymentLifecycleLambdaTarget{handler;id;props;static[JSII_RTTI_SYMBOL_1]={fqn:"aws-cdk-lib.aws_ecs.DeploymentLifecycleLambdaTarget",version:"2.256.1"};_role;constructor(handler,id,props){this.handler=handler,this.id=id,this.props=props;try{jsiiDeprecationWarnings().aws_cdk_lib_aws_lambda_IFunction(handler),jsiiDeprecationWarnings().aws_cdk_lib_aws_ecs_DeploymentLifecycleLambdaTargetProps(props)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,DeploymentLifecycleLambdaTarget),error}}get role(){return this._role}bind(scope){return this._role=this.props.role,this._role||(this._role=new(iam()).Role(scope,`${this.id}Role`,{assumedBy:new(iam()).ServicePrincipal("ecs.amazonaws.com")}),this.handler.grantInvoke(this._role)),{targetArn:this.handler.functionArn,role:this._role,lifecycleStages:this.props.lifecycleStages}}}exports.DeploymentLifecycleLambdaTarget=DeploymentLifecycleLambdaTarget;
