"use strict";var _a;Object.defineProperty(exports,"__esModule",{value:!0}),exports.AwsLogDriver=exports.AwsLogDriverMode=void 0;const jsiiDeprecationWarnings=require("../../../.warnings.jsii.js"),JSII_RTTI_SYMBOL_1=Symbol.for("jsii.rtti"),logs=require("../../../aws-logs"),log_driver_1=require("./log-driver"),utils_1=require("./utils");var AwsLogDriverMode;(function(AwsLogDriverMode2){AwsLogDriverMode2.BLOCKING="blocking",AwsLogDriverMode2.NON_BLOCKING="non-blocking"})(AwsLogDriverMode=exports.AwsLogDriverMode||(exports.AwsLogDriverMode={}));class AwsLogDriver extends log_driver_1.LogDriver{constructor(props){super();if(this.props=props,jsiiDeprecationWarnings.aws_cdk_lib_aws_ecs_AwsLogDriverProps(props),props.logGroup&&props.logRetention)throw new Error("Cannot specify both `logGroup` and `logRetentionDays`.")}bind(scope,containerDefinition){return jsiiDeprecationWarnings.aws_cdk_lib_aws_ecs_ContainerDefinition(containerDefinition),this.logGroup=this.props.logGroup||new logs.LogGroup(scope,"LogGroup",{retention:this.props.logRetention||1/0}),this.logGroup.grantWrite(containerDefinition.taskDefinition.obtainExecutionRole()),{logDriver:"awslogs",options:utils_1.removeEmpty({"awslogs-group":this.logGroup.logGroupName,"awslogs-stream-prefix":this.props.streamPrefix,"awslogs-region":this.logGroup.env.region,"awslogs-datetime-format":this.props.datetimeFormat,"awslogs-multiline-pattern":this.props.multilinePattern,mode:this.props.mode})}}}exports.AwsLogDriver=AwsLogDriver,_a=JSII_RTTI_SYMBOL_1,AwsLogDriver[_a]={fqn:"aws-cdk-lib.aws_ecs.AwsLogDriver",version:"2.13.0"};
//# sourceMappingURL=aws-log-driver.js.map
