"use strict";var _a;Object.defineProperty(exports,"__esModule",{value:!0}),exports.ExternalTaskDefinition=void 0;const jsiiDeprecationWarnings=require("../../../.warnings.jsii.js"),JSII_RTTI_SYMBOL_1=Symbol.for("jsii.rtti"),_imported_task_definition_1=require("../../lib/base/_imported-task-definition"),task_definition_1=require("../base/task-definition");class ExternalTaskDefinition extends task_definition_1.TaskDefinition{static fromEc2TaskDefinitionArn(scope,id,externalTaskDefinitionArn){return new _imported_task_definition_1.ImportedTaskDefinition(scope,id,{taskDefinitionArn:externalTaskDefinitionArn})}static fromExternalTaskDefinitionAttributes(scope,id,attrs){try{jsiiDeprecationWarnings.aws_cdk_lib_aws_ecs_ExternalTaskDefinitionAttributes(attrs)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,this.fromExternalTaskDefinitionAttributes),error}return new _imported_task_definition_1.ImportedTaskDefinition(scope,id,{taskDefinitionArn:attrs.taskDefinitionArn,compatibility:task_definition_1.Compatibility.EXTERNAL,networkMode:attrs.networkMode,taskRole:attrs.taskRole,executionRole:attrs.executionRole})}constructor(scope,id,props={}){super(scope,id,{...props,compatibility:task_definition_1.Compatibility.EXTERNAL,networkMode:props.networkMode??task_definition_1.NetworkMode.BRIDGE});try{jsiiDeprecationWarnings.aws_cdk_lib_aws_ecs_ExternalTaskDefinitionProps(props)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,ExternalTaskDefinition),error}}addInferenceAccelerator(_inferenceAccelerator){try{jsiiDeprecationWarnings.aws_cdk_lib_aws_ecs_InferenceAccelerator(_inferenceAccelerator)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,this.addInferenceAccelerator),error}throw new Error("Cannot use inference accelerators on tasks that run on External service")}}exports.ExternalTaskDefinition=ExternalTaskDefinition,_a=JSII_RTTI_SYMBOL_1,ExternalTaskDefinition[_a]={fqn:"aws-cdk-lib.aws_ecs.ExternalTaskDefinition",version:"2.96.1"};
