"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.AlternateTarget=exports.ListenerRuleConfiguration=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};class ListenerRuleConfiguration{static[JSII_RTTI_SYMBOL_1]={fqn:"aws-cdk-lib.aws_ecs.ListenerRuleConfiguration",version:"2.256.1"};static applicationListenerRule(rule){try{jsiiDeprecationWarnings().aws_cdk_lib_aws_elasticloadbalancingv2_ApplicationListenerRule(rule)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,this.applicationListenerRule),error}return new ApplicationListenerRuleConfiguration(rule)}static networkListener(listener){try{jsiiDeprecationWarnings().aws_cdk_lib_aws_elasticloadbalancingv2_NetworkListener(listener)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,this.networkListener),error}return new NetworkListenerConfiguration(listener)}}exports.ListenerRuleConfiguration=ListenerRuleConfiguration;class ApplicationListenerRuleConfiguration extends ListenerRuleConfiguration{rule;constructor(rule){super(),this.rule=rule}get _listenerArn(){return this.rule.listenerRuleArn}}class NetworkListenerConfiguration extends ListenerRuleConfiguration{listener;constructor(listener){super(),this.listener=listener}get _listenerArn(){return this.listener.listenerArn}}class AlternateTarget{id;props;static[JSII_RTTI_SYMBOL_1]={fqn:"aws-cdk-lib.aws_ecs.AlternateTarget",version:"2.256.1"};constructor(id,props){this.id=id,this.props=props;try{jsiiDeprecationWarnings().aws_cdk_lib_aws_ecs_AlternateTargetProps(props)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,AlternateTarget),error}}bind(scope){const roleId=`${this.id}Role`,role=this.props.role??new(iam()).Role(scope,roleId,{assumedBy:new(iam()).ServicePrincipal("ecs.amazonaws.com"),managedPolicies:[iam().ManagedPolicy.fromAwsManagedPolicyName("AmazonECSInfrastructureRolePolicyForLoadBalancers")]});return{alternateTargetGroupArn:this.props.alternateTargetGroup.targetGroupRef.targetGroupArn,roleArn:role.roleArn,productionListenerRule:this.props.productionListener._listenerArn,testListenerRule:this.props.testListener?._listenerArn}}}exports.AlternateTarget=AlternateTarget;
