"use strict";var _a;Object.defineProperty(exports,"__esModule",{value:!0}),exports.FargateTaskDefinition=void 0;var jsiiDeprecationWarnings=()=>{var tmp=require("../../../.warnings.jsii.js");return jsiiDeprecationWarnings=()=>tmp,tmp};const JSII_RTTI_SYMBOL_1=Symbol.for("jsii.rtti");var core_1=()=>{var tmp=require("../../../core");return core_1=()=>tmp,tmp},_imported_task_definition_1=()=>{var tmp=require("../base/_imported-task-definition");return _imported_task_definition_1=()=>tmp,tmp},task_definition_1=()=>{var tmp=require("../base/task-definition");return task_definition_1=()=>tmp,tmp};class FargateTaskDefinition extends task_definition_1().TaskDefinition{static fromFargateTaskDefinitionArn(scope,id,fargateTaskDefinitionArn){return new(_imported_task_definition_1()).ImportedTaskDefinition(scope,id,{taskDefinitionArn:fargateTaskDefinitionArn})}static fromFargateTaskDefinitionAttributes(scope,id,attrs){try{jsiiDeprecationWarnings().aws_cdk_lib_aws_ecs_FargateTaskDefinitionAttributes(attrs)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,this.fromFargateTaskDefinitionAttributes),error}return new(_imported_task_definition_1()).ImportedTaskDefinition(scope,id,{taskDefinitionArn:attrs.taskDefinitionArn,compatibility:task_definition_1().Compatibility.FARGATE,networkMode:attrs.networkMode,taskRole:attrs.taskRole,executionRole:attrs.executionRole})}constructor(scope,id,props={}){super(scope,id,{...props,cpu:props.cpu!==void 0?core_1().Tokenization.stringifyNumber(props.cpu):"256",memoryMiB:props.memoryLimitMiB!==void 0?core_1().Tokenization.stringifyNumber(props.memoryLimitMiB):"512",compatibility:task_definition_1().Compatibility.FARGATE,networkMode:task_definition_1().NetworkMode.AWS_VPC,pidMode:props.pidMode}),this.networkMode=task_definition_1().NetworkMode.AWS_VPC;try{jsiiDeprecationWarnings().aws_cdk_lib_aws_ecs_FargateTaskDefinitionProps(props)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,FargateTaskDefinition),error}if(props.ephemeralStorageGiB&&!core_1().Token.isUnresolved(props.ephemeralStorageGiB)&&(props.ephemeralStorageGiB<21||props.ephemeralStorageGiB>200))throw new Error("Ephemeral storage size must be between 21GiB and 200GiB");if(props.pidMode){if(!props.runtimePlatform?.operatingSystemFamily)throw new Error("Specifying 'pidMode' requires that operating system family also be provided.");if(props.runtimePlatform?.operatingSystemFamily?.isWindows())throw new Error("'pidMode' is not supported for Windows containers.");if(!core_1().Token.isUnresolved(props.pidMode)&&props.runtimePlatform?.operatingSystemFamily?.isLinux()&&props.pidMode!==task_definition_1().PidMode.TASK)throw new Error(`'pidMode' can only be set to '${task_definition_1().PidMode.TASK}' for Linux Fargate containers, got: '${props.pidMode}'.`)}this.ephemeralStorageGiB=props.ephemeralStorageGiB}}exports.FargateTaskDefinition=FargateTaskDefinition,_a=JSII_RTTI_SYMBOL_1,FargateTaskDefinition[_a]={fqn:"aws-cdk-lib.aws_ecs.FargateTaskDefinition",version:"2.159.0"};
