"use strict";var _a;Object.defineProperty(exports,"__esModule",{value:!0}),exports.QueueProcessingEc2Service=void 0;const jsiiDeprecationWarnings=require("../../../.warnings.jsii.js"),JSII_RTTI_SYMBOL_1=Symbol.for("jsii.rtti"),aws_ecs_1=require("../../../aws-ecs"),core_1=require("../../../core"),cxapi=require("../../../cx-api"),queue_processing_service_base_1=require("../base/queue-processing-service-base");class QueueProcessingEc2Service extends queue_processing_service_base_1.QueueProcessingServiceBase{constructor(scope,id,props){super(scope,id,props);try{jsiiDeprecationWarnings.aws_cdk_lib_aws_ecs_patterns_QueueProcessingEc2ServiceProps(props)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,QueueProcessingEc2Service),error}const containerName=props.containerName??"QueueProcessingContainer";this.taskDefinition=new aws_ecs_1.Ec2TaskDefinition(this,"QueueProcessingTaskDef",{family:props.family}),this.taskDefinition.addContainer(containerName,{image:props.image,memoryLimitMiB:props.memoryLimitMiB,memoryReservationMiB:props.memoryReservationMiB,cpu:props.cpu,gpuCount:props.gpuCount,command:props.command,environment:this.environment,secrets:this.secrets,logging:this.logDriver});const desiredCount=core_1.FeatureFlags.of(this).isEnabled(cxapi.ECS_REMOVE_DEFAULT_DESIRED_COUNT)?void 0:this.desiredCount;this.service=new aws_ecs_1.Ec2Service(this,"QueueProcessingService",{cluster:this.cluster,desiredCount,taskDefinition:this.taskDefinition,serviceName:props.serviceName,minHealthyPercent:props.minHealthyPercent,maxHealthyPercent:props.maxHealthyPercent,propagateTags:props.propagateTags,enableECSManagedTags:props.enableECSManagedTags,deploymentController:props.deploymentController,circuitBreaker:props.circuitBreaker,capacityProviderStrategies:props.capacityProviderStrategies,enableExecuteCommand:props.enableExecuteCommand,placementConstraints:props.placementConstraints,placementStrategies:props.placementStrategies}),this.configureAutoscalingForService(this.service),this.grantPermissionsToService(this.service)}}exports.QueueProcessingEc2Service=QueueProcessingEc2Service,_a=JSII_RTTI_SYMBOL_1,QueueProcessingEc2Service[_a]={fqn:"aws-cdk-lib.aws_ecs_patterns.QueueProcessingEc2Service",version:"2.96.1"};
