"use strict";var _a;Object.defineProperty(exports,"__esModule",{value:!0}),exports.SubscriptionFilter=void 0;var jsiiDeprecationWarnings=()=>{var tmp=require("../../.warnings.jsii.js");return jsiiDeprecationWarnings=()=>tmp,tmp};const JSII_RTTI_SYMBOL_1=Symbol.for("jsii.rtti");var logs_generated_1=()=>{var tmp=require("./logs.generated");return logs_generated_1=()=>tmp,tmp},aws_logs_destinations_1=()=>{var tmp=require("../../aws-logs-destinations");return aws_logs_destinations_1=()=>tmp,tmp},core_1=()=>{var tmp=require("../../core");return core_1=()=>tmp,tmp};class SubscriptionFilter extends core_1().Resource{constructor(scope,id,props){super(scope,id,{physicalName:props.filterName});try{jsiiDeprecationWarnings().aws_cdk_lib_aws_logs_SubscriptionFilterProps(props)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,SubscriptionFilter),error}if(props.distribution&&!core_1().Token.isUnresolved(props.distribution)&&!core_1().Token.isUnresolved(props.destination)&&!(props.destination instanceof aws_logs_destinations_1().KinesisDestination))throw new Error("distribution property can only be used with KinesisDestination.");const destProps=props.destination.bind(this,props.logGroup);new(logs_generated_1()).CfnSubscriptionFilter(this,"Resource",{logGroupName:props.logGroup.logGroupName,destinationArn:destProps.arn,roleArn:destProps.role&&destProps.role.roleArn,filterPattern:props.filterPattern.logPatternString,filterName:this.physicalName,distribution:props.distribution})}}exports.SubscriptionFilter=SubscriptionFilter,_a=JSII_RTTI_SYMBOL_1,SubscriptionFilter[_a]={fqn:"aws-cdk-lib.aws_logs.SubscriptionFilter",version:"2.159.0"};
