aws-cdk-lib
Version:
Version 2 of the AWS Cloud Development Kit library
2 lines (1 loc) • 34.5 kB
JavaScript
"use strict";var _a,_b,_c,_d,_e,_f,_g;Object.defineProperty(exports,"__esModule",{value:!0}),exports.CfnSubscriptionFilter=exports.CfnResourcePolicy=exports.CfnQueryDefinition=exports.CfnMetricFilter=exports.CfnLogStream=exports.CfnLogGroup=exports.CfnDestination=void 0;const jsiiDeprecationWarnings=require("../../.warnings.jsii.js"),JSII_RTTI_SYMBOL_1=Symbol.for("jsii.rtti"),cdk=require("../../core"),cfn_parse=require("../../core/lib/helpers-internal");function CfnDestinationPropsValidator(properties){if(!cdk.canInspect(properties))return cdk.VALIDATION_SUCCESS;const errors=new cdk.ValidationResults;return typeof properties!="object"&&errors.collect(new cdk.ValidationResult("Expected an object, but received: "+JSON.stringify(properties))),errors.collect(cdk.propertyValidator("destinationName",cdk.requiredValidator)(properties.destinationName)),errors.collect(cdk.propertyValidator("destinationName",cdk.validateString)(properties.destinationName)),errors.collect(cdk.propertyValidator("destinationPolicy",cdk.validateString)(properties.destinationPolicy)),errors.collect(cdk.propertyValidator("roleArn",cdk.requiredValidator)(properties.roleArn)),errors.collect(cdk.propertyValidator("roleArn",cdk.validateString)(properties.roleArn)),errors.collect(cdk.propertyValidator("targetArn",cdk.requiredValidator)(properties.targetArn)),errors.collect(cdk.propertyValidator("targetArn",cdk.validateString)(properties.targetArn)),errors.wrap('supplied properties not correct for "CfnDestinationProps"')}function cfnDestinationPropsToCloudFormation(properties){return cdk.canInspect(properties)?(CfnDestinationPropsValidator(properties).assertSuccess(),{DestinationName:cdk.stringToCloudFormation(properties.destinationName),RoleArn:cdk.stringToCloudFormation(properties.roleArn),TargetArn:cdk.stringToCloudFormation(properties.targetArn),DestinationPolicy:cdk.stringToCloudFormation(properties.destinationPolicy)}):properties}function CfnDestinationPropsFromCloudFormation(properties){if(properties=properties??{},typeof properties!="object")return new cfn_parse.FromCloudFormationResult(properties);const ret=new cfn_parse.FromCloudFormationPropertyObject;return ret.addPropertyResult("destinationName","DestinationName",cfn_parse.FromCloudFormation.getString(properties.DestinationName)),ret.addPropertyResult("roleArn","RoleArn",cfn_parse.FromCloudFormation.getString(properties.RoleArn)),ret.addPropertyResult("targetArn","TargetArn",cfn_parse.FromCloudFormation.getString(properties.TargetArn)),ret.addPropertyResult("destinationPolicy","DestinationPolicy",properties.DestinationPolicy!=null?cfn_parse.FromCloudFormation.getString(properties.DestinationPolicy):void 0),ret.addUnrecognizedPropertiesAsExtra(properties),ret}class CfnDestination extends cdk.CfnResource{constructor(scope,id,props){super(scope,id,{type:CfnDestination.CFN_RESOURCE_TYPE_NAME,properties:props});try{jsiiDeprecationWarnings.aws_cdk_lib_aws_logs_CfnDestinationProps(props)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,CfnDestination),error}cdk.requireProperty(props,"destinationName",this),cdk.requireProperty(props,"roleArn",this),cdk.requireProperty(props,"targetArn",this),this.attrArn=cdk.Token.asString(this.getAtt("Arn",cdk.ResolutionTypeHint.STRING)),this.destinationName=props.destinationName,this.roleArn=props.roleArn,this.targetArn=props.targetArn,this.destinationPolicy=props.destinationPolicy}static _fromCloudFormation(scope,id,resourceAttributes,options){resourceAttributes=resourceAttributes||{};const resourceProperties=options.parser.parseValue(resourceAttributes.Properties),propsResult=CfnDestinationPropsFromCloudFormation(resourceProperties),ret=new CfnDestination(scope,id,propsResult.value);for(const[propKey,propVal]of Object.entries(propsResult.extraProperties))ret.addPropertyOverride(propKey,propVal);return options.parser.handleAttributes(ret,resourceAttributes,id),ret}inspect(inspector){try{jsiiDeprecationWarnings.aws_cdk_lib_TreeInspector(inspector)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,this.inspect),error}inspector.addAttribute("aws:cdk:cloudformation:type",CfnDestination.CFN_RESOURCE_TYPE_NAME),inspector.addAttribute("aws:cdk:cloudformation:props",this.cfnProperties)}get cfnProperties(){return{destinationName:this.destinationName,roleArn:this.roleArn,targetArn:this.targetArn,destinationPolicy:this.destinationPolicy}}renderProperties(props){return cfnDestinationPropsToCloudFormation(props)}}exports.CfnDestination=CfnDestination,_a=JSII_RTTI_SYMBOL_1,CfnDestination[_a]={fqn:"aws-cdk-lib.aws_logs.CfnDestination",version:"2.70.0"},CfnDestination.CFN_RESOURCE_TYPE_NAME="AWS::Logs::Destination";function CfnLogGroupPropsValidator(properties){if(!cdk.canInspect(properties))return cdk.VALIDATION_SUCCESS;const errors=new cdk.ValidationResults;return typeof properties!="object"&&errors.collect(new cdk.ValidationResult("Expected an object, but received: "+JSON.stringify(properties))),errors.collect(cdk.propertyValidator("dataProtectionPolicy",cdk.validateObject)(properties.dataProtectionPolicy)),errors.collect(cdk.propertyValidator("kmsKeyId",cdk.validateString)(properties.kmsKeyId)),errors.collect(cdk.propertyValidator("logGroupName",cdk.validateString)(properties.logGroupName)),errors.collect(cdk.propertyValidator("retentionInDays",cdk.validateNumber)(properties.retentionInDays)),errors.collect(cdk.propertyValidator("tags",cdk.listValidator(cdk.validateCfnTag))(properties.tags)),errors.wrap('supplied properties not correct for "CfnLogGroupProps"')}function cfnLogGroupPropsToCloudFormation(properties){return cdk.canInspect(properties)?(CfnLogGroupPropsValidator(properties).assertSuccess(),{DataProtectionPolicy:cdk.objectToCloudFormation(properties.dataProtectionPolicy),KmsKeyId:cdk.stringToCloudFormation(properties.kmsKeyId),LogGroupName:cdk.stringToCloudFormation(properties.logGroupName),RetentionInDays:cdk.numberToCloudFormation(properties.retentionInDays),Tags:cdk.listMapper(cdk.cfnTagToCloudFormation)(properties.tags)}):properties}function CfnLogGroupPropsFromCloudFormation(properties){if(properties=properties??{},typeof properties!="object")return new cfn_parse.FromCloudFormationResult(properties);const ret=new cfn_parse.FromCloudFormationPropertyObject;return ret.addPropertyResult("dataProtectionPolicy","DataProtectionPolicy",properties.DataProtectionPolicy!=null?cfn_parse.FromCloudFormation.getAny(properties.DataProtectionPolicy):void 0),ret.addPropertyResult("kmsKeyId","KmsKeyId",properties.KmsKeyId!=null?cfn_parse.FromCloudFormation.getString(properties.KmsKeyId):void 0),ret.addPropertyResult("logGroupName","LogGroupName",properties.LogGroupName!=null?cfn_parse.FromCloudFormation.getString(properties.LogGroupName):void 0),ret.addPropertyResult("retentionInDays","RetentionInDays",properties.RetentionInDays!=null?cfn_parse.FromCloudFormation.getNumber(properties.RetentionInDays):void 0),ret.addPropertyResult("tags","Tags",properties.Tags!=null?cfn_parse.FromCloudFormation.getArray(cfn_parse.FromCloudFormation.getCfnTag)(properties.Tags):void 0),ret.addUnrecognizedPropertiesAsExtra(properties),ret}class CfnLogGroup extends cdk.CfnResource{constructor(scope,id,props={}){super(scope,id,{type:CfnLogGroup.CFN_RESOURCE_TYPE_NAME,properties:props});try{jsiiDeprecationWarnings.aws_cdk_lib_aws_logs_CfnLogGroupProps(props)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,CfnLogGroup),error}this.attrArn=cdk.Token.asString(this.getAtt("Arn",cdk.ResolutionTypeHint.STRING)),this.dataProtectionPolicy=props.dataProtectionPolicy,this.kmsKeyId=props.kmsKeyId,this.logGroupName=props.logGroupName,this.retentionInDays=props.retentionInDays,this.tags=new cdk.TagManager(cdk.TagType.STANDARD,"AWS::Logs::LogGroup",props.tags,{tagPropertyName:"tags"}),this.node.scope&&cdk.Resource.isResource(this.node.scope)&&this.node.addValidation({validate:()=>this.cfnOptions.deletionPolicy===void 0?["'AWS::Logs::LogGroup' is a stateful resource type, and you must specify a Removal Policy for it. Call 'resource.applyRemovalPolicy()'."]:[]})}static _fromCloudFormation(scope,id,resourceAttributes,options){resourceAttributes=resourceAttributes||{};const resourceProperties=options.parser.parseValue(resourceAttributes.Properties),propsResult=CfnLogGroupPropsFromCloudFormation(resourceProperties),ret=new CfnLogGroup(scope,id,propsResult.value);for(const[propKey,propVal]of Object.entries(propsResult.extraProperties))ret.addPropertyOverride(propKey,propVal);return options.parser.handleAttributes(ret,resourceAttributes,id),ret}inspect(inspector){try{jsiiDeprecationWarnings.aws_cdk_lib_TreeInspector(inspector)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,this.inspect),error}inspector.addAttribute("aws:cdk:cloudformation:type",CfnLogGroup.CFN_RESOURCE_TYPE_NAME),inspector.addAttribute("aws:cdk:cloudformation:props",this.cfnProperties)}get cfnProperties(){return{dataProtectionPolicy:this.dataProtectionPolicy,kmsKeyId:this.kmsKeyId,logGroupName:this.logGroupName,retentionInDays:this.retentionInDays,tags:this.tags.renderTags()}}renderProperties(props){return cfnLogGroupPropsToCloudFormation(props)}}exports.CfnLogGroup=CfnLogGroup,_b=JSII_RTTI_SYMBOL_1,CfnLogGroup[_b]={fqn:"aws-cdk-lib.aws_logs.CfnLogGroup",version:"2.70.0"},CfnLogGroup.CFN_RESOURCE_TYPE_NAME="AWS::Logs::LogGroup";function CfnLogStreamPropsValidator(properties){if(!cdk.canInspect(properties))return cdk.VALIDATION_SUCCESS;const errors=new cdk.ValidationResults;return typeof properties!="object"&&errors.collect(new cdk.ValidationResult("Expected an object, but received: "+JSON.stringify(properties))),errors.collect(cdk.propertyValidator("logGroupName",cdk.requiredValidator)(properties.logGroupName)),errors.collect(cdk.propertyValidator("logGroupName",cdk.validateString)(properties.logGroupName)),errors.collect(cdk.propertyValidator("logStreamName",cdk.validateString)(properties.logStreamName)),errors.wrap('supplied properties not correct for "CfnLogStreamProps"')}function cfnLogStreamPropsToCloudFormation(properties){return cdk.canInspect(properties)?(CfnLogStreamPropsValidator(properties).assertSuccess(),{LogGroupName:cdk.stringToCloudFormation(properties.logGroupName),LogStreamName:cdk.stringToCloudFormation(properties.logStreamName)}):properties}function CfnLogStreamPropsFromCloudFormation(properties){if(properties=properties??{},typeof properties!="object")return new cfn_parse.FromCloudFormationResult(properties);const ret=new cfn_parse.FromCloudFormationPropertyObject;return ret.addPropertyResult("logGroupName","LogGroupName",cfn_parse.FromCloudFormation.getString(properties.LogGroupName)),ret.addPropertyResult("logStreamName","LogStreamName",properties.LogStreamName!=null?cfn_parse.FromCloudFormation.getString(properties.LogStreamName):void 0),ret.addUnrecognizedPropertiesAsExtra(properties),ret}class CfnLogStream extends cdk.CfnResource{constructor(scope,id,props){super(scope,id,{type:CfnLogStream.CFN_RESOURCE_TYPE_NAME,properties:props});try{jsiiDeprecationWarnings.aws_cdk_lib_aws_logs_CfnLogStreamProps(props)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,CfnLogStream),error}cdk.requireProperty(props,"logGroupName",this),this.attrId=cdk.Token.asString(this.getAtt("Id",cdk.ResolutionTypeHint.STRING)),this.logGroupName=props.logGroupName,this.logStreamName=props.logStreamName}static _fromCloudFormation(scope,id,resourceAttributes,options){resourceAttributes=resourceAttributes||{};const resourceProperties=options.parser.parseValue(resourceAttributes.Properties),propsResult=CfnLogStreamPropsFromCloudFormation(resourceProperties),ret=new CfnLogStream(scope,id,propsResult.value);for(const[propKey,propVal]of Object.entries(propsResult.extraProperties))ret.addPropertyOverride(propKey,propVal);return options.parser.handleAttributes(ret,resourceAttributes,id),ret}inspect(inspector){try{jsiiDeprecationWarnings.aws_cdk_lib_TreeInspector(inspector)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,this.inspect),error}inspector.addAttribute("aws:cdk:cloudformation:type",CfnLogStream.CFN_RESOURCE_TYPE_NAME),inspector.addAttribute("aws:cdk:cloudformation:props",this.cfnProperties)}get cfnProperties(){return{logGroupName:this.logGroupName,logStreamName:this.logStreamName}}renderProperties(props){return cfnLogStreamPropsToCloudFormation(props)}}exports.CfnLogStream=CfnLogStream,_c=JSII_RTTI_SYMBOL_1,CfnLogStream[_c]={fqn:"aws-cdk-lib.aws_logs.CfnLogStream",version:"2.70.0"},CfnLogStream.CFN_RESOURCE_TYPE_NAME="AWS::Logs::LogStream";function CfnMetricFilterPropsValidator(properties){if(!cdk.canInspect(properties))return cdk.VALIDATION_SUCCESS;const errors=new cdk.ValidationResults;return typeof properties!="object"&&errors.collect(new cdk.ValidationResult("Expected an object, but received: "+JSON.stringify(properties))),errors.collect(cdk.propertyValidator("filterName",cdk.validateString)(properties.filterName)),errors.collect(cdk.propertyValidator("filterPattern",cdk.requiredValidator)(properties.filterPattern)),errors.collect(cdk.propertyValidator("filterPattern",cdk.validateString)(properties.filterPattern)),errors.collect(cdk.propertyValidator("logGroupName",cdk.requiredValidator)(properties.logGroupName)),errors.collect(cdk.propertyValidator("logGroupName",cdk.validateString)(properties.logGroupName)),errors.collect(cdk.propertyValidator("metricTransformations",cdk.requiredValidator)(properties.metricTransformations)),errors.collect(cdk.propertyValidator("metricTransformations",cdk.listValidator(CfnMetricFilter_MetricTransformationPropertyValidator))(properties.metricTransformations)),errors.wrap('supplied properties not correct for "CfnMetricFilterProps"')}function cfnMetricFilterPropsToCloudFormation(properties){return cdk.canInspect(properties)?(CfnMetricFilterPropsValidator(properties).assertSuccess(),{FilterPattern:cdk.stringToCloudFormation(properties.filterPattern),LogGroupName:cdk.stringToCloudFormation(properties.logGroupName),MetricTransformations:cdk.listMapper(cfnMetricFilterMetricTransformationPropertyToCloudFormation)(properties.metricTransformations),FilterName:cdk.stringToCloudFormation(properties.filterName)}):properties}function CfnMetricFilterPropsFromCloudFormation(properties){if(properties=properties??{},typeof properties!="object")return new cfn_parse.FromCloudFormationResult(properties);const ret=new cfn_parse.FromCloudFormationPropertyObject;return ret.addPropertyResult("filterPattern","FilterPattern",cfn_parse.FromCloudFormation.getString(properties.FilterPattern)),ret.addPropertyResult("logGroupName","LogGroupName",cfn_parse.FromCloudFormation.getString(properties.LogGroupName)),ret.addPropertyResult("metricTransformations","MetricTransformations",cfn_parse.FromCloudFormation.getArray(CfnMetricFilterMetricTransformationPropertyFromCloudFormation)(properties.MetricTransformations)),ret.addPropertyResult("filterName","FilterName",properties.FilterName!=null?cfn_parse.FromCloudFormation.getString(properties.FilterName):void 0),ret.addUnrecognizedPropertiesAsExtra(properties),ret}class CfnMetricFilter extends cdk.CfnResource{constructor(scope,id,props){super(scope,id,{type:CfnMetricFilter.CFN_RESOURCE_TYPE_NAME,properties:props});try{jsiiDeprecationWarnings.aws_cdk_lib_aws_logs_CfnMetricFilterProps(props)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,CfnMetricFilter),error}cdk.requireProperty(props,"filterPattern",this),cdk.requireProperty(props,"logGroupName",this),cdk.requireProperty(props,"metricTransformations",this),this.filterPattern=props.filterPattern,this.logGroupName=props.logGroupName,this.metricTransformations=props.metricTransformations,this.filterName=props.filterName}static _fromCloudFormation(scope,id,resourceAttributes,options){resourceAttributes=resourceAttributes||{};const resourceProperties=options.parser.parseValue(resourceAttributes.Properties),propsResult=CfnMetricFilterPropsFromCloudFormation(resourceProperties),ret=new CfnMetricFilter(scope,id,propsResult.value);for(const[propKey,propVal]of Object.entries(propsResult.extraProperties))ret.addPropertyOverride(propKey,propVal);return options.parser.handleAttributes(ret,resourceAttributes,id),ret}inspect(inspector){try{jsiiDeprecationWarnings.aws_cdk_lib_TreeInspector(inspector)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,this.inspect),error}inspector.addAttribute("aws:cdk:cloudformation:type",CfnMetricFilter.CFN_RESOURCE_TYPE_NAME),inspector.addAttribute("aws:cdk:cloudformation:props",this.cfnProperties)}get cfnProperties(){return{filterPattern:this.filterPattern,logGroupName:this.logGroupName,metricTransformations:this.metricTransformations,filterName:this.filterName}}renderProperties(props){return cfnMetricFilterPropsToCloudFormation(props)}}exports.CfnMetricFilter=CfnMetricFilter,_d=JSII_RTTI_SYMBOL_1,CfnMetricFilter[_d]={fqn:"aws-cdk-lib.aws_logs.CfnMetricFilter",version:"2.70.0"},CfnMetricFilter.CFN_RESOURCE_TYPE_NAME="AWS::Logs::MetricFilter";function CfnMetricFilter_DimensionPropertyValidator(properties){if(!cdk.canInspect(properties))return cdk.VALIDATION_SUCCESS;const errors=new cdk.ValidationResults;return typeof properties!="object"&&errors.collect(new cdk.ValidationResult("Expected an object, but received: "+JSON.stringify(properties))),errors.collect(cdk.propertyValidator("key",cdk.requiredValidator)(properties.key)),errors.collect(cdk.propertyValidator("key",cdk.validateString)(properties.key)),errors.collect(cdk.propertyValidator("value",cdk.requiredValidator)(properties.value)),errors.collect(cdk.propertyValidator("value",cdk.validateString)(properties.value)),errors.wrap('supplied properties not correct for "DimensionProperty"')}function cfnMetricFilterDimensionPropertyToCloudFormation(properties){return cdk.canInspect(properties)?(CfnMetricFilter_DimensionPropertyValidator(properties).assertSuccess(),{Key:cdk.stringToCloudFormation(properties.key),Value:cdk.stringToCloudFormation(properties.value)}):properties}function CfnMetricFilterDimensionPropertyFromCloudFormation(properties){if(cdk.isResolvableObject(properties))return new cfn_parse.FromCloudFormationResult(properties);if(properties=properties??{},typeof properties!="object")return new cfn_parse.FromCloudFormationResult(properties);const ret=new cfn_parse.FromCloudFormationPropertyObject;return ret.addPropertyResult("key","Key",cfn_parse.FromCloudFormation.getString(properties.Key)),ret.addPropertyResult("value","Value",cfn_parse.FromCloudFormation.getString(properties.Value)),ret.addUnrecognizedPropertiesAsExtra(properties),ret}function CfnMetricFilter_MetricTransformationPropertyValidator(properties){if(!cdk.canInspect(properties))return cdk.VALIDATION_SUCCESS;const errors=new cdk.ValidationResults;return typeof properties!="object"&&errors.collect(new cdk.ValidationResult("Expected an object, but received: "+JSON.stringify(properties))),errors.collect(cdk.propertyValidator("defaultValue",cdk.validateNumber)(properties.defaultValue)),errors.collect(cdk.propertyValidator("dimensions",cdk.listValidator(CfnMetricFilter_DimensionPropertyValidator))(properties.dimensions)),errors.collect(cdk.propertyValidator("metricName",cdk.requiredValidator)(properties.metricName)),errors.collect(cdk.propertyValidator("metricName",cdk.validateString)(properties.metricName)),errors.collect(cdk.propertyValidator("metricNamespace",cdk.requiredValidator)(properties.metricNamespace)),errors.collect(cdk.propertyValidator("metricNamespace",cdk.validateString)(properties.metricNamespace)),errors.collect(cdk.propertyValidator("metricValue",cdk.requiredValidator)(properties.metricValue)),errors.collect(cdk.propertyValidator("metricValue",cdk.validateString)(properties.metricValue)),errors.collect(cdk.propertyValidator("unit",cdk.validateString)(properties.unit)),errors.wrap('supplied properties not correct for "MetricTransformationProperty"')}function cfnMetricFilterMetricTransformationPropertyToCloudFormation(properties){return cdk.canInspect(properties)?(CfnMetricFilter_MetricTransformationPropertyValidator(properties).assertSuccess(),{DefaultValue:cdk.numberToCloudFormation(properties.defaultValue),Dimensions:cdk.listMapper(cfnMetricFilterDimensionPropertyToCloudFormation)(properties.dimensions),MetricName:cdk.stringToCloudFormation(properties.metricName),MetricNamespace:cdk.stringToCloudFormation(properties.metricNamespace),MetricValue:cdk.stringToCloudFormation(properties.metricValue),Unit:cdk.stringToCloudFormation(properties.unit)}):properties}function CfnMetricFilterMetricTransformationPropertyFromCloudFormation(properties){if(cdk.isResolvableObject(properties))return new cfn_parse.FromCloudFormationResult(properties);if(properties=properties??{},typeof properties!="object")return new cfn_parse.FromCloudFormationResult(properties);const ret=new cfn_parse.FromCloudFormationPropertyObject;return ret.addPropertyResult("defaultValue","DefaultValue",properties.DefaultValue!=null?cfn_parse.FromCloudFormation.getNumber(properties.DefaultValue):void 0),ret.addPropertyResult("dimensions","Dimensions",properties.Dimensions!=null?cfn_parse.FromCloudFormation.getArray(CfnMetricFilterDimensionPropertyFromCloudFormation)(properties.Dimensions):void 0),ret.addPropertyResult("metricName","MetricName",cfn_parse.FromCloudFormation.getString(properties.MetricName)),ret.addPropertyResult("metricNamespace","MetricNamespace",cfn_parse.FromCloudFormation.getString(properties.MetricNamespace)),ret.addPropertyResult("metricValue","MetricValue",cfn_parse.FromCloudFormation.getString(properties.MetricValue)),ret.addPropertyResult("unit","Unit",properties.Unit!=null?cfn_parse.FromCloudFormation.getString(properties.Unit):void 0),ret.addUnrecognizedPropertiesAsExtra(properties),ret}function CfnQueryDefinitionPropsValidator(properties){if(!cdk.canInspect(properties))return cdk.VALIDATION_SUCCESS;const errors=new cdk.ValidationResults;return typeof properties!="object"&&errors.collect(new cdk.ValidationResult("Expected an object, but received: "+JSON.stringify(properties))),errors.collect(cdk.propertyValidator("logGroupNames",cdk.listValidator(cdk.validateString))(properties.logGroupNames)),errors.collect(cdk.propertyValidator("name",cdk.requiredValidator)(properties.name)),errors.collect(cdk.propertyValidator("name",cdk.validateString)(properties.name)),errors.collect(cdk.propertyValidator("queryString",cdk.requiredValidator)(properties.queryString)),errors.collect(cdk.propertyValidator("queryString",cdk.validateString)(properties.queryString)),errors.wrap('supplied properties not correct for "CfnQueryDefinitionProps"')}function cfnQueryDefinitionPropsToCloudFormation(properties){return cdk.canInspect(properties)?(CfnQueryDefinitionPropsValidator(properties).assertSuccess(),{Name:cdk.stringToCloudFormation(properties.name),QueryString:cdk.stringToCloudFormation(properties.queryString),LogGroupNames:cdk.listMapper(cdk.stringToCloudFormation)(properties.logGroupNames)}):properties}function CfnQueryDefinitionPropsFromCloudFormation(properties){if(properties=properties??{},typeof properties!="object")return new cfn_parse.FromCloudFormationResult(properties);const ret=new cfn_parse.FromCloudFormationPropertyObject;return ret.addPropertyResult("name","Name",cfn_parse.FromCloudFormation.getString(properties.Name)),ret.addPropertyResult("queryString","QueryString",cfn_parse.FromCloudFormation.getString(properties.QueryString)),ret.addPropertyResult("logGroupNames","LogGroupNames",properties.LogGroupNames!=null?cfn_parse.FromCloudFormation.getStringArray(properties.LogGroupNames):void 0),ret.addUnrecognizedPropertiesAsExtra(properties),ret}class CfnQueryDefinition extends cdk.CfnResource{constructor(scope,id,props){super(scope,id,{type:CfnQueryDefinition.CFN_RESOURCE_TYPE_NAME,properties:props});try{jsiiDeprecationWarnings.aws_cdk_lib_aws_logs_CfnQueryDefinitionProps(props)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,CfnQueryDefinition),error}cdk.requireProperty(props,"name",this),cdk.requireProperty(props,"queryString",this),this.attrQueryDefinitionId=cdk.Token.asString(this.getAtt("QueryDefinitionId",cdk.ResolutionTypeHint.STRING)),this.name=props.name,this.queryString=props.queryString,this.logGroupNames=props.logGroupNames}static _fromCloudFormation(scope,id,resourceAttributes,options){resourceAttributes=resourceAttributes||{};const resourceProperties=options.parser.parseValue(resourceAttributes.Properties),propsResult=CfnQueryDefinitionPropsFromCloudFormation(resourceProperties),ret=new CfnQueryDefinition(scope,id,propsResult.value);for(const[propKey,propVal]of Object.entries(propsResult.extraProperties))ret.addPropertyOverride(propKey,propVal);return options.parser.handleAttributes(ret,resourceAttributes,id),ret}inspect(inspector){try{jsiiDeprecationWarnings.aws_cdk_lib_TreeInspector(inspector)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,this.inspect),error}inspector.addAttribute("aws:cdk:cloudformation:type",CfnQueryDefinition.CFN_RESOURCE_TYPE_NAME),inspector.addAttribute("aws:cdk:cloudformation:props",this.cfnProperties)}get cfnProperties(){return{name:this.name,queryString:this.queryString,logGroupNames:this.logGroupNames}}renderProperties(props){return cfnQueryDefinitionPropsToCloudFormation(props)}}exports.CfnQueryDefinition=CfnQueryDefinition,_e=JSII_RTTI_SYMBOL_1,CfnQueryDefinition[_e]={fqn:"aws-cdk-lib.aws_logs.CfnQueryDefinition",version:"2.70.0"},CfnQueryDefinition.CFN_RESOURCE_TYPE_NAME="AWS::Logs::QueryDefinition";function CfnResourcePolicyPropsValidator(properties){if(!cdk.canInspect(properties))return cdk.VALIDATION_SUCCESS;const errors=new cdk.ValidationResults;return typeof properties!="object"&&errors.collect(new cdk.ValidationResult("Expected an object, but received: "+JSON.stringify(properties))),errors.collect(cdk.propertyValidator("policyDocument",cdk.requiredValidator)(properties.policyDocument)),errors.collect(cdk.propertyValidator("policyDocument",cdk.validateString)(properties.policyDocument)),errors.collect(cdk.propertyValidator("policyName",cdk.requiredValidator)(properties.policyName)),errors.collect(cdk.propertyValidator("policyName",cdk.validateString)(properties.policyName)),errors.wrap('supplied properties not correct for "CfnResourcePolicyProps"')}function cfnResourcePolicyPropsToCloudFormation(properties){return cdk.canInspect(properties)?(CfnResourcePolicyPropsValidator(properties).assertSuccess(),{PolicyDocument:cdk.stringToCloudFormation(properties.policyDocument),PolicyName:cdk.stringToCloudFormation(properties.policyName)}):properties}function CfnResourcePolicyPropsFromCloudFormation(properties){if(properties=properties??{},typeof properties!="object")return new cfn_parse.FromCloudFormationResult(properties);const ret=new cfn_parse.FromCloudFormationPropertyObject;return ret.addPropertyResult("policyDocument","PolicyDocument",cfn_parse.FromCloudFormation.getString(properties.PolicyDocument)),ret.addPropertyResult("policyName","PolicyName",cfn_parse.FromCloudFormation.getString(properties.PolicyName)),ret.addUnrecognizedPropertiesAsExtra(properties),ret}class CfnResourcePolicy extends cdk.CfnResource{constructor(scope,id,props){super(scope,id,{type:CfnResourcePolicy.CFN_RESOURCE_TYPE_NAME,properties:props});try{jsiiDeprecationWarnings.aws_cdk_lib_aws_logs_CfnResourcePolicyProps(props)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,CfnResourcePolicy),error}cdk.requireProperty(props,"policyDocument",this),cdk.requireProperty(props,"policyName",this),this.policyDocument=props.policyDocument,this.policyName=props.policyName}static _fromCloudFormation(scope,id,resourceAttributes,options){resourceAttributes=resourceAttributes||{};const resourceProperties=options.parser.parseValue(resourceAttributes.Properties),propsResult=CfnResourcePolicyPropsFromCloudFormation(resourceProperties),ret=new CfnResourcePolicy(scope,id,propsResult.value);for(const[propKey,propVal]of Object.entries(propsResult.extraProperties))ret.addPropertyOverride(propKey,propVal);return options.parser.handleAttributes(ret,resourceAttributes,id),ret}inspect(inspector){try{jsiiDeprecationWarnings.aws_cdk_lib_TreeInspector(inspector)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,this.inspect),error}inspector.addAttribute("aws:cdk:cloudformation:type",CfnResourcePolicy.CFN_RESOURCE_TYPE_NAME),inspector.addAttribute("aws:cdk:cloudformation:props",this.cfnProperties)}get cfnProperties(){return{policyDocument:this.policyDocument,policyName:this.policyName}}renderProperties(props){return cfnResourcePolicyPropsToCloudFormation(props)}}exports.CfnResourcePolicy=CfnResourcePolicy,_f=JSII_RTTI_SYMBOL_1,CfnResourcePolicy[_f]={fqn:"aws-cdk-lib.aws_logs.CfnResourcePolicy",version:"2.70.0"},CfnResourcePolicy.CFN_RESOURCE_TYPE_NAME="AWS::Logs::ResourcePolicy";function CfnSubscriptionFilterPropsValidator(properties){if(!cdk.canInspect(properties))return cdk.VALIDATION_SUCCESS;const errors=new cdk.ValidationResults;return typeof properties!="object"&&errors.collect(new cdk.ValidationResult("Expected an object, but received: "+JSON.stringify(properties))),errors.collect(cdk.propertyValidator("destinationArn",cdk.requiredValidator)(properties.destinationArn)),errors.collect(cdk.propertyValidator("destinationArn",cdk.validateString)(properties.destinationArn)),errors.collect(cdk.propertyValidator("distribution",cdk.validateString)(properties.distribution)),errors.collect(cdk.propertyValidator("filterName",cdk.validateString)(properties.filterName)),errors.collect(cdk.propertyValidator("filterPattern",cdk.requiredValidator)(properties.filterPattern)),errors.collect(cdk.propertyValidator("filterPattern",cdk.validateString)(properties.filterPattern)),errors.collect(cdk.propertyValidator("logGroupName",cdk.requiredValidator)(properties.logGroupName)),errors.collect(cdk.propertyValidator("logGroupName",cdk.validateString)(properties.logGroupName)),errors.collect(cdk.propertyValidator("roleArn",cdk.validateString)(properties.roleArn)),errors.wrap('supplied properties not correct for "CfnSubscriptionFilterProps"')}function cfnSubscriptionFilterPropsToCloudFormation(properties){return cdk.canInspect(properties)?(CfnSubscriptionFilterPropsValidator(properties).assertSuccess(),{DestinationArn:cdk.stringToCloudFormation(properties.destinationArn),FilterPattern:cdk.stringToCloudFormation(properties.filterPattern),LogGroupName:cdk.stringToCloudFormation(properties.logGroupName),Distribution:cdk.stringToCloudFormation(properties.distribution),FilterName:cdk.stringToCloudFormation(properties.filterName),RoleArn:cdk.stringToCloudFormation(properties.roleArn)}):properties}function CfnSubscriptionFilterPropsFromCloudFormation(properties){if(properties=properties??{},typeof properties!="object")return new cfn_parse.FromCloudFormationResult(properties);const ret=new cfn_parse.FromCloudFormationPropertyObject;return ret.addPropertyResult("destinationArn","DestinationArn",cfn_parse.FromCloudFormation.getString(properties.DestinationArn)),ret.addPropertyResult("filterPattern","FilterPattern",cfn_parse.FromCloudFormation.getString(properties.FilterPattern)),ret.addPropertyResult("logGroupName","LogGroupName",cfn_parse.FromCloudFormation.getString(properties.LogGroupName)),ret.addPropertyResult("distribution","Distribution",properties.Distribution!=null?cfn_parse.FromCloudFormation.getString(properties.Distribution):void 0),ret.addPropertyResult("filterName","FilterName",properties.FilterName!=null?cfn_parse.FromCloudFormation.getString(properties.FilterName):void 0),ret.addPropertyResult("roleArn","RoleArn",properties.RoleArn!=null?cfn_parse.FromCloudFormation.getString(properties.RoleArn):void 0),ret.addUnrecognizedPropertiesAsExtra(properties),ret}class CfnSubscriptionFilter extends cdk.CfnResource{constructor(scope,id,props){super(scope,id,{type:CfnSubscriptionFilter.CFN_RESOURCE_TYPE_NAME,properties:props});try{jsiiDeprecationWarnings.aws_cdk_lib_aws_logs_CfnSubscriptionFilterProps(props)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,CfnSubscriptionFilter),error}cdk.requireProperty(props,"destinationArn",this),cdk.requireProperty(props,"filterPattern",this),cdk.requireProperty(props,"logGroupName",this),this.destinationArn=props.destinationArn,this.filterPattern=props.filterPattern,this.logGroupName=props.logGroupName,this.distribution=props.distribution,this.filterName=props.filterName,this.roleArn=props.roleArn}static _fromCloudFormation(scope,id,resourceAttributes,options){resourceAttributes=resourceAttributes||{};const resourceProperties=options.parser.parseValue(resourceAttributes.Properties),propsResult=CfnSubscriptionFilterPropsFromCloudFormation(resourceProperties),ret=new CfnSubscriptionFilter(scope,id,propsResult.value);for(const[propKey,propVal]of Object.entries(propsResult.extraProperties))ret.addPropertyOverride(propKey,propVal);return options.parser.handleAttributes(ret,resourceAttributes,id),ret}inspect(inspector){try{jsiiDeprecationWarnings.aws_cdk_lib_TreeInspector(inspector)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,this.inspect),error}inspector.addAttribute("aws:cdk:cloudformation:type",CfnSubscriptionFilter.CFN_RESOURCE_TYPE_NAME),inspector.addAttribute("aws:cdk:cloudformation:props",this.cfnProperties)}get cfnProperties(){return{destinationArn:this.destinationArn,filterPattern:this.filterPattern,logGroupName:this.logGroupName,distribution:this.distribution,filterName:this.filterName,roleArn:this.roleArn}}renderProperties(props){return cfnSubscriptionFilterPropsToCloudFormation(props)}}exports.CfnSubscriptionFilter=CfnSubscriptionFilter,_g=JSII_RTTI_SYMBOL_1,CfnSubscriptionFilter[_g]={fqn:"aws-cdk-lib.aws_logs.CfnSubscriptionFilter",version:"2.70.0"},CfnSubscriptionFilter.CFN_RESOURCE_TYPE_NAME="AWS::Logs::SubscriptionFilter";