"use strict";var _a;Object.defineProperty(exports,"__esModule",{value:!0}),exports.ScheduledFargateTask=void 0;const jsiiDeprecationWarnings=require("../../../.warnings.jsii.js"),JSII_RTTI_SYMBOL_1=Symbol.for("jsii.rtti"),aws_ecs_1=require("../../../aws-ecs"),aws_events_targets_1=require("../../../aws-events-targets"),scheduled_task_base_1=require("../base/scheduled-task-base");class ScheduledFargateTask extends scheduled_task_base_1.ScheduledTaskBase{constructor(scope,id,props){var _b;super(scope,id,props);if(jsiiDeprecationWarnings.aws_cdk_lib_aws_ecs_patterns_ScheduledFargateTaskProps(props),props.scheduledFargateTaskDefinitionOptions&&props.scheduledFargateTaskImageOptions)throw new Error("You must specify either a scheduledFargateTaskDefinitionOptions or scheduledFargateTaskOptions, not both.");if(props.scheduledFargateTaskDefinitionOptions)this.taskDefinition=props.scheduledFargateTaskDefinitionOptions.taskDefinition;else if(props.scheduledFargateTaskImageOptions){const taskImageOptions=props.scheduledFargateTaskImageOptions;this.taskDefinition=new aws_ecs_1.FargateTaskDefinition(this,"ScheduledTaskDef",{memoryLimitMiB:taskImageOptions.memoryLimitMiB||512,cpu:taskImageOptions.cpu||256}),this.taskDefinition.addContainer("ScheduledContainer",{image:taskImageOptions.image,command:taskImageOptions.command,environment:taskImageOptions.environment,secrets:taskImageOptions.secrets,logging:(_b=taskImageOptions.logDriver)!==null&&_b!==void 0?_b:this.createAWSLogDriver(this.node.id)})}else throw new Error("You must specify one of: taskDefinition or image");this.task=new aws_events_targets_1.EcsTask({cluster:this.cluster,taskDefinition:this.taskDefinition,taskCount:this.desiredTaskCount,subnetSelection:this.subnetSelection,platformVersion:props.platformVersion,securityGroups:props.securityGroups}),this.addTaskAsTarget(this.task)}}exports.ScheduledFargateTask=ScheduledFargateTask,_a=JSII_RTTI_SYMBOL_1,ScheduledFargateTask[_a]={fqn:"aws-cdk-lib.aws_ecs_patterns.ScheduledFargateTask",version:"2.13.0"};
//# sourceMappingURL=scheduled-fargate-task.js.map
