aws-cdk-lib
Version:
Version 2 of the AWS Cloud Development Kit library
2 lines (1 loc) • 2.12 kB
JavaScript
;var _a;Object.defineProperty(exports,"__esModule",{value:!0}),exports.SplunkLogDriver=exports.SplunkLogFormat=void 0;const jsiiDeprecationWarnings=require("../../../.warnings.jsii.js"),JSII_RTTI_SYMBOL_1=Symbol.for("jsii.rtti"),log_driver_1=require("./log-driver"),utils_1=require("./utils");var SplunkLogFormat;(function(SplunkLogFormat2){SplunkLogFormat2.INLINE="inline",SplunkLogFormat2.JSON="json",SplunkLogFormat2.RAW="raw"})(SplunkLogFormat=exports.SplunkLogFormat||(exports.SplunkLogFormat={}));class SplunkLogDriver extends log_driver_1.LogDriver{constructor(props){super(),this.props=props;try{jsiiDeprecationWarnings.aws_cdk_lib_aws_ecs_SplunkLogDriverProps(props)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,SplunkLogDriver),error}if(!props.token&&!props.secretToken)throw new Error("Please provide either token or secretToken.");props.gzipLevel&&utils_1.ensureInRange(props.gzipLevel,-1,9)}bind(_scope,_containerDefinition){try{jsiiDeprecationWarnings.aws_cdk_lib_aws_ecs_ContainerDefinition(_containerDefinition)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,this.bind),error}return{logDriver:"splunk",options:utils_1.stringifyOptions({"splunk-token":this.props.token?.unsafeUnwrap(),"splunk-url":this.props.url,"splunk-source":this.props.source,"splunk-sourcetype":this.props.sourceType,"splunk-index":this.props.index,"splunk-capath":this.props.caPath,"splunk-caname":this.props.caName,"splunk-insecureskipverify":this.props.insecureSkipVerify,"splunk-format":this.props.format,"splunk-verify-connection":this.props.verifyConnection,"splunk-gzip":this.props.gzip,"splunk-gzip-level":this.props.gzipLevel,...utils_1.renderCommonLogDriverOptions(this.props)}),secretOptions:this.props.secretToken&&utils_1.renderLogDriverSecretOptions({"splunk-token":this.props.secretToken},_containerDefinition.taskDefinition)}}}exports.SplunkLogDriver=SplunkLogDriver,_a=JSII_RTTI_SYMBOL_1,SplunkLogDriver[_a]={fqn:"aws-cdk-lib.aws_ecs.SplunkLogDriver",version:"2.70.0"};