UNPKG

aws-cdk-lib

Version:

Version 2 of the AWS Cloud Development Kit library

2 lines (1 loc) 12.5 kB
"use strict";var _a,_b;Object.defineProperty(exports,"__esModule",{value:!0}),exports.CfnStream=exports.CfnLedger=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 CfnLedgerPropsValidator(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("deletionProtection",cdk.validateBoolean)(properties.deletionProtection)),errors.collect(cdk.propertyValidator("kmsKey",cdk.validateString)(properties.kmsKey)),errors.collect(cdk.propertyValidator("name",cdk.validateString)(properties.name)),errors.collect(cdk.propertyValidator("permissionsMode",cdk.requiredValidator)(properties.permissionsMode)),errors.collect(cdk.propertyValidator("permissionsMode",cdk.validateString)(properties.permissionsMode)),errors.collect(cdk.propertyValidator("tags",cdk.listValidator(cdk.validateCfnTag))(properties.tags)),errors.wrap('supplied properties not correct for "CfnLedgerProps"')}function cfnLedgerPropsToCloudFormation(properties){return cdk.canInspect(properties)?(CfnLedgerPropsValidator(properties).assertSuccess(),{PermissionsMode:cdk.stringToCloudFormation(properties.permissionsMode),DeletionProtection:cdk.booleanToCloudFormation(properties.deletionProtection),KmsKey:cdk.stringToCloudFormation(properties.kmsKey),Name:cdk.stringToCloudFormation(properties.name),Tags:cdk.listMapper(cdk.cfnTagToCloudFormation)(properties.tags)}):properties}function CfnLedgerPropsFromCloudFormation(properties){if(properties=properties??{},typeof properties!="object")return new cfn_parse.FromCloudFormationResult(properties);const ret=new cfn_parse.FromCloudFormationPropertyObject;return ret.addPropertyResult("permissionsMode","PermissionsMode",cfn_parse.FromCloudFormation.getString(properties.PermissionsMode)),ret.addPropertyResult("deletionProtection","DeletionProtection",properties.DeletionProtection!=null?cfn_parse.FromCloudFormation.getBoolean(properties.DeletionProtection):void 0),ret.addPropertyResult("kmsKey","KmsKey",properties.KmsKey!=null?cfn_parse.FromCloudFormation.getString(properties.KmsKey):void 0),ret.addPropertyResult("name","Name",properties.Name!=null?cfn_parse.FromCloudFormation.getString(properties.Name):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 CfnLedger extends cdk.CfnResource{constructor(scope,id,props){super(scope,id,{type:CfnLedger.CFN_RESOURCE_TYPE_NAME,properties:props});try{jsiiDeprecationWarnings.aws_cdk_lib_aws_qldb_CfnLedgerProps(props)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,CfnLedger),error}cdk.requireProperty(props,"permissionsMode",this),this.permissionsMode=props.permissionsMode,this.deletionProtection=props.deletionProtection,this.kmsKey=props.kmsKey,this.name=props.name,this.tags=new cdk.TagManager(cdk.TagType.STANDARD,"AWS::QLDB::Ledger",props.tags,{tagPropertyName:"tags"}),this.node.scope&&cdk.Resource.isResource(this.node.scope)&&this.node.addValidation({validate:()=>this.cfnOptions.deletionPolicy===void 0?["'AWS::QLDB::Ledger' 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=CfnLedgerPropsFromCloudFormation(resourceProperties),ret=new CfnLedger(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",CfnLedger.CFN_RESOURCE_TYPE_NAME),inspector.addAttribute("aws:cdk:cloudformation:props",this.cfnProperties)}get cfnProperties(){return{permissionsMode:this.permissionsMode,deletionProtection:this.deletionProtection,kmsKey:this.kmsKey,name:this.name,tags:this.tags.renderTags()}}renderProperties(props){return cfnLedgerPropsToCloudFormation(props)}}exports.CfnLedger=CfnLedger,_a=JSII_RTTI_SYMBOL_1,CfnLedger[_a]={fqn:"aws-cdk-lib.aws_qldb.CfnLedger",version:"2.70.0"},CfnLedger.CFN_RESOURCE_TYPE_NAME="AWS::QLDB::Ledger";function CfnStreamPropsValidator(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("exclusiveEndTime",cdk.validateString)(properties.exclusiveEndTime)),errors.collect(cdk.propertyValidator("inclusiveStartTime",cdk.requiredValidator)(properties.inclusiveStartTime)),errors.collect(cdk.propertyValidator("inclusiveStartTime",cdk.validateString)(properties.inclusiveStartTime)),errors.collect(cdk.propertyValidator("kinesisConfiguration",cdk.requiredValidator)(properties.kinesisConfiguration)),errors.collect(cdk.propertyValidator("kinesisConfiguration",CfnStream_KinesisConfigurationPropertyValidator)(properties.kinesisConfiguration)),errors.collect(cdk.propertyValidator("ledgerName",cdk.requiredValidator)(properties.ledgerName)),errors.collect(cdk.propertyValidator("ledgerName",cdk.validateString)(properties.ledgerName)),errors.collect(cdk.propertyValidator("roleArn",cdk.requiredValidator)(properties.roleArn)),errors.collect(cdk.propertyValidator("roleArn",cdk.validateString)(properties.roleArn)),errors.collect(cdk.propertyValidator("streamName",cdk.requiredValidator)(properties.streamName)),errors.collect(cdk.propertyValidator("streamName",cdk.validateString)(properties.streamName)),errors.collect(cdk.propertyValidator("tags",cdk.listValidator(cdk.validateCfnTag))(properties.tags)),errors.wrap('supplied properties not correct for "CfnStreamProps"')}function cfnStreamPropsToCloudFormation(properties){return cdk.canInspect(properties)?(CfnStreamPropsValidator(properties).assertSuccess(),{InclusiveStartTime:cdk.stringToCloudFormation(properties.inclusiveStartTime),KinesisConfiguration:cfnStreamKinesisConfigurationPropertyToCloudFormation(properties.kinesisConfiguration),LedgerName:cdk.stringToCloudFormation(properties.ledgerName),RoleArn:cdk.stringToCloudFormation(properties.roleArn),StreamName:cdk.stringToCloudFormation(properties.streamName),ExclusiveEndTime:cdk.stringToCloudFormation(properties.exclusiveEndTime),Tags:cdk.listMapper(cdk.cfnTagToCloudFormation)(properties.tags)}):properties}function CfnStreamPropsFromCloudFormation(properties){if(properties=properties??{},typeof properties!="object")return new cfn_parse.FromCloudFormationResult(properties);const ret=new cfn_parse.FromCloudFormationPropertyObject;return ret.addPropertyResult("inclusiveStartTime","InclusiveStartTime",cfn_parse.FromCloudFormation.getString(properties.InclusiveStartTime)),ret.addPropertyResult("kinesisConfiguration","KinesisConfiguration",CfnStreamKinesisConfigurationPropertyFromCloudFormation(properties.KinesisConfiguration)),ret.addPropertyResult("ledgerName","LedgerName",cfn_parse.FromCloudFormation.getString(properties.LedgerName)),ret.addPropertyResult("roleArn","RoleArn",cfn_parse.FromCloudFormation.getString(properties.RoleArn)),ret.addPropertyResult("streamName","StreamName",cfn_parse.FromCloudFormation.getString(properties.StreamName)),ret.addPropertyResult("exclusiveEndTime","ExclusiveEndTime",properties.ExclusiveEndTime!=null?cfn_parse.FromCloudFormation.getString(properties.ExclusiveEndTime):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 CfnStream extends cdk.CfnResource{constructor(scope,id,props){super(scope,id,{type:CfnStream.CFN_RESOURCE_TYPE_NAME,properties:props});try{jsiiDeprecationWarnings.aws_cdk_lib_aws_qldb_CfnStreamProps(props)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,CfnStream),error}cdk.requireProperty(props,"inclusiveStartTime",this),cdk.requireProperty(props,"kinesisConfiguration",this),cdk.requireProperty(props,"ledgerName",this),cdk.requireProperty(props,"roleArn",this),cdk.requireProperty(props,"streamName",this),this.attrArn=cdk.Token.asString(this.getAtt("Arn",cdk.ResolutionTypeHint.STRING)),this.attrId=cdk.Token.asString(this.getAtt("Id",cdk.ResolutionTypeHint.STRING)),this.inclusiveStartTime=props.inclusiveStartTime,this.kinesisConfiguration=props.kinesisConfiguration,this.ledgerName=props.ledgerName,this.roleArn=props.roleArn,this.streamName=props.streamName,this.exclusiveEndTime=props.exclusiveEndTime,this.tags=new cdk.TagManager(cdk.TagType.STANDARD,"AWS::QLDB::Stream",props.tags,{tagPropertyName:"tags"})}static _fromCloudFormation(scope,id,resourceAttributes,options){resourceAttributes=resourceAttributes||{};const resourceProperties=options.parser.parseValue(resourceAttributes.Properties),propsResult=CfnStreamPropsFromCloudFormation(resourceProperties),ret=new CfnStream(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",CfnStream.CFN_RESOURCE_TYPE_NAME),inspector.addAttribute("aws:cdk:cloudformation:props",this.cfnProperties)}get cfnProperties(){return{inclusiveStartTime:this.inclusiveStartTime,kinesisConfiguration:this.kinesisConfiguration,ledgerName:this.ledgerName,roleArn:this.roleArn,streamName:this.streamName,exclusiveEndTime:this.exclusiveEndTime,tags:this.tags.renderTags()}}renderProperties(props){return cfnStreamPropsToCloudFormation(props)}}exports.CfnStream=CfnStream,_b=JSII_RTTI_SYMBOL_1,CfnStream[_b]={fqn:"aws-cdk-lib.aws_qldb.CfnStream",version:"2.70.0"},CfnStream.CFN_RESOURCE_TYPE_NAME="AWS::QLDB::Stream";function CfnStream_KinesisConfigurationPropertyValidator(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("aggregationEnabled",cdk.validateBoolean)(properties.aggregationEnabled)),errors.collect(cdk.propertyValidator("streamArn",cdk.validateString)(properties.streamArn)),errors.wrap('supplied properties not correct for "KinesisConfigurationProperty"')}function cfnStreamKinesisConfigurationPropertyToCloudFormation(properties){return cdk.canInspect(properties)?(CfnStream_KinesisConfigurationPropertyValidator(properties).assertSuccess(),{AggregationEnabled:cdk.booleanToCloudFormation(properties.aggregationEnabled),StreamArn:cdk.stringToCloudFormation(properties.streamArn)}):properties}function CfnStreamKinesisConfigurationPropertyFromCloudFormation(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("aggregationEnabled","AggregationEnabled",properties.AggregationEnabled!=null?cfn_parse.FromCloudFormation.getBoolean(properties.AggregationEnabled):void 0),ret.addPropertyResult("streamArn","StreamArn",properties.StreamArn!=null?cfn_parse.FromCloudFormation.getString(properties.StreamArn):void 0),ret.addUnrecognizedPropertiesAsExtra(properties),ret}