aws-cdk-lib
Version:
Version 2 of the AWS Cloud Development Kit library
2 lines (1 loc) • 18.6 kB
JavaScript
"use strict";var _a,_b,_c;Object.defineProperty(exports,"__esModule",{value:!0}),exports.CfnResourcePolicy=exports.CfnStreamConsumer=exports.CfnStream=void 0;var jsiiDeprecationWarnings=()=>{var tmp=require("../../.warnings.jsii.js");return jsiiDeprecationWarnings=()=>tmp,tmp};const JSII_RTTI_SYMBOL_1=Symbol.for("jsii.rtti");var cdk=()=>{var tmp=require("../../core");return cdk=()=>tmp,tmp},cfn_parse=()=>{var tmp=require("../../core/lib/helpers-internal");return cfn_parse=()=>tmp,tmp},cdk_errors=()=>{var tmp=require("../../core/lib/errors");return cdk_errors=()=>tmp,tmp};class CfnStream extends cdk().CfnResource{static _fromCloudFormation(scope,id,resourceAttributes,options){resourceAttributes=resourceAttributes||{};const resourceProperties=options.parser.parseValue(resourceAttributes.Properties),propsResult=CfnStreamPropsFromCloudFormation(resourceProperties);if(cdk().isResolvableObject(propsResult.value))throw new(cdk_errors()).ValidationError("Unexpected IResolvable",scope);const 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}constructor(scope,id,props={}){super(scope,id,{type:CfnStream.CFN_RESOURCE_TYPE_NAME,properties:props});try{jsiiDeprecationWarnings().aws_cdk_lib_aws_kinesis_CfnStreamProps(props)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,CfnStream),error}this.attrArn=cdk().Token.asString(this.getAtt("Arn",cdk().ResolutionTypeHint.STRING)),this.desiredShardLevelMetrics=props.desiredShardLevelMetrics,this.name=props.name,this.retentionPeriodHours=props.retentionPeriodHours,this.shardCount=props.shardCount,this.streamEncryption=props.streamEncryption,this.streamModeDetails=props.streamModeDetails,this.tags=new(cdk()).TagManager(cdk().TagType.STANDARD,"AWS::Kinesis::Stream",props.tags,{tagPropertyName:"tags"}),this.tagsRaw=props.tags,this.node.scope!=null&&cdk().Resource.isResource(this.node.scope)&&this.node.addValidation({validate:()=>this.cfnOptions.deletionPolicy===void 0?["'AWS::Kinesis::Stream' is a stateful resource type, and you must specify a Removal Policy for it. Call 'resource.applyRemovalPolicy()'."]:[]})}get cfnProperties(){return{desiredShardLevelMetrics:this.desiredShardLevelMetrics,name:this.name,retentionPeriodHours:this.retentionPeriodHours,shardCount:this.shardCount,streamEncryption:this.streamEncryption,streamModeDetails:this.streamModeDetails,tags:this.tags.renderTags()}}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)}renderProperties(props){return convertCfnStreamPropsToCloudFormation(props)}}exports.CfnStream=CfnStream,_a=JSII_RTTI_SYMBOL_1,CfnStream[_a]={fqn:"aws-cdk-lib.aws_kinesis.CfnStream",version:"2.202.0"},CfnStream.CFN_RESOURCE_TYPE_NAME="AWS::Kinesis::Stream";function CfnStreamStreamModeDetailsPropertyValidator(properties){if(!cdk().canInspect(properties))return cdk().VALIDATION_SUCCESS;const errors=new(cdk()).ValidationResults;return properties&&typeof properties=="object"&&!Array.isArray(properties)||errors.collect(new(cdk()).ValidationResult("Expected an object, but received: "+JSON.stringify(properties))),errors.collect(cdk().propertyValidator("streamMode",cdk().requiredValidator)(properties.streamMode)),errors.collect(cdk().propertyValidator("streamMode",cdk().validateString)(properties.streamMode)),errors.wrap('supplied properties not correct for "StreamModeDetailsProperty"')}function convertCfnStreamStreamModeDetailsPropertyToCloudFormation(properties){return cdk().canInspect(properties)?(CfnStreamStreamModeDetailsPropertyValidator(properties).assertSuccess(),{StreamMode:cdk().stringToCloudFormation(properties.streamMode)}):properties}function CfnStreamStreamModeDetailsPropertyFromCloudFormation(properties){if(cdk().isResolvableObject(properties))return new(cfn_parse()).FromCloudFormationResult(properties);if(properties=properties??{},!(properties&&typeof properties=="object"&&!Array.isArray(properties)))return new(cfn_parse()).FromCloudFormationResult(properties);const ret=new(cfn_parse()).FromCloudFormationPropertyObject;return ret.addPropertyResult("streamMode","StreamMode",properties.StreamMode!=null?cfn_parse().FromCloudFormation.getString(properties.StreamMode):void 0),ret.addUnrecognizedPropertiesAsExtra(properties),ret}function CfnStreamStreamEncryptionPropertyValidator(properties){if(!cdk().canInspect(properties))return cdk().VALIDATION_SUCCESS;const errors=new(cdk()).ValidationResults;return properties&&typeof properties=="object"&&!Array.isArray(properties)||errors.collect(new(cdk()).ValidationResult("Expected an object, but received: "+JSON.stringify(properties))),errors.collect(cdk().propertyValidator("encryptionType",cdk().requiredValidator)(properties.encryptionType)),errors.collect(cdk().propertyValidator("encryptionType",cdk().validateString)(properties.encryptionType)),errors.collect(cdk().propertyValidator("keyId",cdk().requiredValidator)(properties.keyId)),errors.collect(cdk().propertyValidator("keyId",cdk().validateString)(properties.keyId)),errors.wrap('supplied properties not correct for "StreamEncryptionProperty"')}function convertCfnStreamStreamEncryptionPropertyToCloudFormation(properties){return cdk().canInspect(properties)?(CfnStreamStreamEncryptionPropertyValidator(properties).assertSuccess(),{EncryptionType:cdk().stringToCloudFormation(properties.encryptionType),KeyId:cdk().stringToCloudFormation(properties.keyId)}):properties}function CfnStreamStreamEncryptionPropertyFromCloudFormation(properties){if(cdk().isResolvableObject(properties))return new(cfn_parse()).FromCloudFormationResult(properties);if(properties=properties??{},!(properties&&typeof properties=="object"&&!Array.isArray(properties)))return new(cfn_parse()).FromCloudFormationResult(properties);const ret=new(cfn_parse()).FromCloudFormationPropertyObject;return ret.addPropertyResult("encryptionType","EncryptionType",properties.EncryptionType!=null?cfn_parse().FromCloudFormation.getString(properties.EncryptionType):void 0),ret.addPropertyResult("keyId","KeyId",properties.KeyId!=null?cfn_parse().FromCloudFormation.getString(properties.KeyId):void 0),ret.addUnrecognizedPropertiesAsExtra(properties),ret}function CfnStreamPropsValidator(properties){if(!cdk().canInspect(properties))return cdk().VALIDATION_SUCCESS;const errors=new(cdk()).ValidationResults;return properties&&typeof properties=="object"&&!Array.isArray(properties)||errors.collect(new(cdk()).ValidationResult("Expected an object, but received: "+JSON.stringify(properties))),errors.collect(cdk().propertyValidator("desiredShardLevelMetrics",cdk().listValidator(cdk().validateString))(properties.desiredShardLevelMetrics)),errors.collect(cdk().propertyValidator("name",cdk().validateString)(properties.name)),errors.collect(cdk().propertyValidator("retentionPeriodHours",cdk().validateNumber)(properties.retentionPeriodHours)),errors.collect(cdk().propertyValidator("shardCount",cdk().validateNumber)(properties.shardCount)),errors.collect(cdk().propertyValidator("streamEncryption",CfnStreamStreamEncryptionPropertyValidator)(properties.streamEncryption)),errors.collect(cdk().propertyValidator("streamModeDetails",CfnStreamStreamModeDetailsPropertyValidator)(properties.streamModeDetails)),errors.collect(cdk().propertyValidator("tags",cdk().listValidator(cdk().validateCfnTag))(properties.tags)),errors.wrap('supplied properties not correct for "CfnStreamProps"')}function convertCfnStreamPropsToCloudFormation(properties){return cdk().canInspect(properties)?(CfnStreamPropsValidator(properties).assertSuccess(),{DesiredShardLevelMetrics:cdk().listMapper(cdk().stringToCloudFormation)(properties.desiredShardLevelMetrics),Name:cdk().stringToCloudFormation(properties.name),RetentionPeriodHours:cdk().numberToCloudFormation(properties.retentionPeriodHours),ShardCount:cdk().numberToCloudFormation(properties.shardCount),StreamEncryption:convertCfnStreamStreamEncryptionPropertyToCloudFormation(properties.streamEncryption),StreamModeDetails:convertCfnStreamStreamModeDetailsPropertyToCloudFormation(properties.streamModeDetails),Tags:cdk().listMapper(cdk().cfnTagToCloudFormation)(properties.tags)}):properties}function CfnStreamPropsFromCloudFormation(properties){if(cdk().isResolvableObject(properties))return new(cfn_parse()).FromCloudFormationResult(properties);if(properties=properties??{},!(properties&&typeof properties=="object"&&!Array.isArray(properties)))return new(cfn_parse()).FromCloudFormationResult(properties);const ret=new(cfn_parse()).FromCloudFormationPropertyObject;return ret.addPropertyResult("desiredShardLevelMetrics","DesiredShardLevelMetrics",properties.DesiredShardLevelMetrics!=null?cfn_parse().FromCloudFormation.getArray(cfn_parse().FromCloudFormation.getString)(properties.DesiredShardLevelMetrics):void 0),ret.addPropertyResult("name","Name",properties.Name!=null?cfn_parse().FromCloudFormation.getString(properties.Name):void 0),ret.addPropertyResult("retentionPeriodHours","RetentionPeriodHours",properties.RetentionPeriodHours!=null?cfn_parse().FromCloudFormation.getNumber(properties.RetentionPeriodHours):void 0),ret.addPropertyResult("shardCount","ShardCount",properties.ShardCount!=null?cfn_parse().FromCloudFormation.getNumber(properties.ShardCount):void 0),ret.addPropertyResult("streamEncryption","StreamEncryption",properties.StreamEncryption!=null?CfnStreamStreamEncryptionPropertyFromCloudFormation(properties.StreamEncryption):void 0),ret.addPropertyResult("streamModeDetails","StreamModeDetails",properties.StreamModeDetails!=null?CfnStreamStreamModeDetailsPropertyFromCloudFormation(properties.StreamModeDetails):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 CfnStreamConsumer extends cdk().CfnResource{static _fromCloudFormation(scope,id,resourceAttributes,options){resourceAttributes=resourceAttributes||{};const resourceProperties=options.parser.parseValue(resourceAttributes.Properties),propsResult=CfnStreamConsumerPropsFromCloudFormation(resourceProperties);if(cdk().isResolvableObject(propsResult.value))throw new(cdk_errors()).ValidationError("Unexpected IResolvable",scope);const ret=new CfnStreamConsumer(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}constructor(scope,id,props){super(scope,id,{type:CfnStreamConsumer.CFN_RESOURCE_TYPE_NAME,properties:props});try{jsiiDeprecationWarnings().aws_cdk_lib_aws_kinesis_CfnStreamConsumerProps(props)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,CfnStreamConsumer),error}cdk().requireProperty(props,"consumerName",this),cdk().requireProperty(props,"streamArn",this),this.attrConsumerArn=cdk().Token.asString(this.getAtt("ConsumerARN",cdk().ResolutionTypeHint.STRING)),this.attrConsumerCreationTimestamp=cdk().Token.asString(this.getAtt("ConsumerCreationTimestamp",cdk().ResolutionTypeHint.STRING)),this.attrConsumerName=cdk().Token.asString(this.getAtt("ConsumerName",cdk().ResolutionTypeHint.STRING)),this.attrConsumerStatus=cdk().Token.asString(this.getAtt("ConsumerStatus",cdk().ResolutionTypeHint.STRING)),this.attrId=cdk().Token.asString(this.getAtt("Id",cdk().ResolutionTypeHint.STRING)),this.attrStreamArn=cdk().Token.asString(this.getAtt("StreamARN",cdk().ResolutionTypeHint.STRING)),this.consumerName=props.consumerName,this.streamArn=props.streamArn}get cfnProperties(){return{consumerName:this.consumerName,streamArn:this.streamArn}}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",CfnStreamConsumer.CFN_RESOURCE_TYPE_NAME),inspector.addAttribute("aws:cdk:cloudformation:props",this.cfnProperties)}renderProperties(props){return convertCfnStreamConsumerPropsToCloudFormation(props)}}exports.CfnStreamConsumer=CfnStreamConsumer,_b=JSII_RTTI_SYMBOL_1,CfnStreamConsumer[_b]={fqn:"aws-cdk-lib.aws_kinesis.CfnStreamConsumer",version:"2.202.0"},CfnStreamConsumer.CFN_RESOURCE_TYPE_NAME="AWS::Kinesis::StreamConsumer";function CfnStreamConsumerPropsValidator(properties){if(!cdk().canInspect(properties))return cdk().VALIDATION_SUCCESS;const errors=new(cdk()).ValidationResults;return properties&&typeof properties=="object"&&!Array.isArray(properties)||errors.collect(new(cdk()).ValidationResult("Expected an object, but received: "+JSON.stringify(properties))),errors.collect(cdk().propertyValidator("consumerName",cdk().requiredValidator)(properties.consumerName)),errors.collect(cdk().propertyValidator("consumerName",cdk().validateString)(properties.consumerName)),errors.collect(cdk().propertyValidator("streamArn",cdk().requiredValidator)(properties.streamArn)),errors.collect(cdk().propertyValidator("streamArn",cdk().validateString)(properties.streamArn)),errors.wrap('supplied properties not correct for "CfnStreamConsumerProps"')}function convertCfnStreamConsumerPropsToCloudFormation(properties){return cdk().canInspect(properties)?(CfnStreamConsumerPropsValidator(properties).assertSuccess(),{ConsumerName:cdk().stringToCloudFormation(properties.consumerName),StreamARN:cdk().stringToCloudFormation(properties.streamArn)}):properties}function CfnStreamConsumerPropsFromCloudFormation(properties){if(cdk().isResolvableObject(properties))return new(cfn_parse()).FromCloudFormationResult(properties);if(properties=properties??{},!(properties&&typeof properties=="object"&&!Array.isArray(properties)))return new(cfn_parse()).FromCloudFormationResult(properties);const ret=new(cfn_parse()).FromCloudFormationPropertyObject;return ret.addPropertyResult("consumerName","ConsumerName",properties.ConsumerName!=null?cfn_parse().FromCloudFormation.getString(properties.ConsumerName):void 0),ret.addPropertyResult("streamArn","StreamARN",properties.StreamARN!=null?cfn_parse().FromCloudFormation.getString(properties.StreamARN):void 0),ret.addUnrecognizedPropertiesAsExtra(properties),ret}class CfnResourcePolicy extends cdk().CfnResource{static _fromCloudFormation(scope,id,resourceAttributes,options){resourceAttributes=resourceAttributes||{};const resourceProperties=options.parser.parseValue(resourceAttributes.Properties),propsResult=CfnResourcePolicyPropsFromCloudFormation(resourceProperties);if(cdk().isResolvableObject(propsResult.value))throw new(cdk_errors()).ValidationError("Unexpected IResolvable",scope);const 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}constructor(scope,id,props){super(scope,id,{type:CfnResourcePolicy.CFN_RESOURCE_TYPE_NAME,properties:props});try{jsiiDeprecationWarnings().aws_cdk_lib_aws_kinesis_CfnResourcePolicyProps(props)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,CfnResourcePolicy),error}cdk().requireProperty(props,"resourceArn",this),cdk().requireProperty(props,"resourcePolicy",this),this.resourceArn=props.resourceArn,this.resourcePolicy=props.resourcePolicy}get cfnProperties(){return{resourceArn:this.resourceArn,resourcePolicy:this.resourcePolicy}}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)}renderProperties(props){return convertCfnResourcePolicyPropsToCloudFormation(props)}}exports.CfnResourcePolicy=CfnResourcePolicy,_c=JSII_RTTI_SYMBOL_1,CfnResourcePolicy[_c]={fqn:"aws-cdk-lib.aws_kinesis.CfnResourcePolicy",version:"2.202.0"},CfnResourcePolicy.CFN_RESOURCE_TYPE_NAME="AWS::Kinesis::ResourcePolicy";function CfnResourcePolicyPropsValidator(properties){if(!cdk().canInspect(properties))return cdk().VALIDATION_SUCCESS;const errors=new(cdk()).ValidationResults;return properties&&typeof properties=="object"&&!Array.isArray(properties)||errors.collect(new(cdk()).ValidationResult("Expected an object, but received: "+JSON.stringify(properties))),errors.collect(cdk().propertyValidator("resourceArn",cdk().requiredValidator)(properties.resourceArn)),errors.collect(cdk().propertyValidator("resourceArn",cdk().validateString)(properties.resourceArn)),errors.collect(cdk().propertyValidator("resourcePolicy",cdk().requiredValidator)(properties.resourcePolicy)),errors.collect(cdk().propertyValidator("resourcePolicy",cdk().validateObject)(properties.resourcePolicy)),errors.wrap('supplied properties not correct for "CfnResourcePolicyProps"')}function convertCfnResourcePolicyPropsToCloudFormation(properties){return cdk().canInspect(properties)?(CfnResourcePolicyPropsValidator(properties).assertSuccess(),{ResourceArn:cdk().stringToCloudFormation(properties.resourceArn),ResourcePolicy:cdk().objectToCloudFormation(properties.resourcePolicy)}):properties}function CfnResourcePolicyPropsFromCloudFormation(properties){if(cdk().isResolvableObject(properties))return new(cfn_parse()).FromCloudFormationResult(properties);if(properties=properties??{},!(properties&&typeof properties=="object"&&!Array.isArray(properties)))return new(cfn_parse()).FromCloudFormationResult(properties);const ret=new(cfn_parse()).FromCloudFormationPropertyObject;return ret.addPropertyResult("resourceArn","ResourceArn",properties.ResourceArn!=null?cfn_parse().FromCloudFormation.getString(properties.ResourceArn):void 0),ret.addPropertyResult("resourcePolicy","ResourcePolicy",properties.ResourcePolicy!=null?cfn_parse().FromCloudFormation.getAny(properties.ResourcePolicy):void 0),ret.addUnrecognizedPropertiesAsExtra(properties),ret}