UNPKG

aws-cdk-lib

Version:

Version 2 of the AWS Cloud Development Kit library

2 lines (1 loc) 9.13 kB
"use strict";var _a;Object.defineProperty(exports,"__esModule",{value:!0}),exports.CfnVirtualCluster=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 CfnVirtualClusterPropsValidator(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("containerProvider",cdk.requiredValidator)(properties.containerProvider)),errors.collect(cdk.propertyValidator("containerProvider",CfnVirtualCluster_ContainerProviderPropertyValidator)(properties.containerProvider)),errors.collect(cdk.propertyValidator("name",cdk.requiredValidator)(properties.name)),errors.collect(cdk.propertyValidator("name",cdk.validateString)(properties.name)),errors.collect(cdk.propertyValidator("tags",cdk.listValidator(cdk.validateCfnTag))(properties.tags)),errors.wrap('supplied properties not correct for "CfnVirtualClusterProps"')}function cfnVirtualClusterPropsToCloudFormation(properties){return cdk.canInspect(properties)?(CfnVirtualClusterPropsValidator(properties).assertSuccess(),{ContainerProvider:cfnVirtualClusterContainerProviderPropertyToCloudFormation(properties.containerProvider),Name:cdk.stringToCloudFormation(properties.name),Tags:cdk.listMapper(cdk.cfnTagToCloudFormation)(properties.tags)}):properties}function CfnVirtualClusterPropsFromCloudFormation(properties){if(properties=properties??{},typeof properties!="object")return new cfn_parse.FromCloudFormationResult(properties);const ret=new cfn_parse.FromCloudFormationPropertyObject;return ret.addPropertyResult("containerProvider","ContainerProvider",CfnVirtualClusterContainerProviderPropertyFromCloudFormation(properties.ContainerProvider)),ret.addPropertyResult("name","Name",cfn_parse.FromCloudFormation.getString(properties.Name)),ret.addPropertyResult("tags","Tags",properties.Tags!=null?cfn_parse.FromCloudFormation.getArray(cfn_parse.FromCloudFormation.getCfnTag)(properties.Tags):void 0),ret.addUnrecognizedPropertiesAsExtra(properties),ret}class CfnVirtualCluster extends cdk.CfnResource{constructor(scope,id,props){super(scope,id,{type:CfnVirtualCluster.CFN_RESOURCE_TYPE_NAME,properties:props});try{jsiiDeprecationWarnings.aws_cdk_lib_aws_emrcontainers_CfnVirtualClusterProps(props)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,CfnVirtualCluster),error}cdk.requireProperty(props,"containerProvider",this),cdk.requireProperty(props,"name",this),this.attrArn=cdk.Token.asString(this.getAtt("Arn",cdk.ResolutionTypeHint.STRING)),this.attrId=cdk.Token.asString(this.getAtt("Id",cdk.ResolutionTypeHint.STRING)),this.containerProvider=props.containerProvider,this.name=props.name,this.tags=new cdk.TagManager(cdk.TagType.STANDARD,"AWS::EMRContainers::VirtualCluster",props.tags,{tagPropertyName:"tags"})}static _fromCloudFormation(scope,id,resourceAttributes,options){resourceAttributes=resourceAttributes||{};const resourceProperties=options.parser.parseValue(resourceAttributes.Properties),propsResult=CfnVirtualClusterPropsFromCloudFormation(resourceProperties),ret=new CfnVirtualCluster(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",CfnVirtualCluster.CFN_RESOURCE_TYPE_NAME),inspector.addAttribute("aws:cdk:cloudformation:props",this.cfnProperties)}get cfnProperties(){return{containerProvider:this.containerProvider,name:this.name,tags:this.tags.renderTags()}}renderProperties(props){return cfnVirtualClusterPropsToCloudFormation(props)}}exports.CfnVirtualCluster=CfnVirtualCluster,_a=JSII_RTTI_SYMBOL_1,CfnVirtualCluster[_a]={fqn:"aws-cdk-lib.aws_emrcontainers.CfnVirtualCluster",version:"2.70.0"},CfnVirtualCluster.CFN_RESOURCE_TYPE_NAME="AWS::EMRContainers::VirtualCluster";function CfnVirtualCluster_ContainerInfoPropertyValidator(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("eksInfo",cdk.requiredValidator)(properties.eksInfo)),errors.collect(cdk.propertyValidator("eksInfo",CfnVirtualCluster_EksInfoPropertyValidator)(properties.eksInfo)),errors.wrap('supplied properties not correct for "ContainerInfoProperty"')}function cfnVirtualClusterContainerInfoPropertyToCloudFormation(properties){return cdk.canInspect(properties)?(CfnVirtualCluster_ContainerInfoPropertyValidator(properties).assertSuccess(),{EksInfo:cfnVirtualClusterEksInfoPropertyToCloudFormation(properties.eksInfo)}):properties}function CfnVirtualClusterContainerInfoPropertyFromCloudFormation(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("eksInfo","EksInfo",CfnVirtualClusterEksInfoPropertyFromCloudFormation(properties.EksInfo)),ret.addUnrecognizedPropertiesAsExtra(properties),ret}function CfnVirtualCluster_ContainerProviderPropertyValidator(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("id",cdk.requiredValidator)(properties.id)),errors.collect(cdk.propertyValidator("id",cdk.validateString)(properties.id)),errors.collect(cdk.propertyValidator("info",cdk.requiredValidator)(properties.info)),errors.collect(cdk.propertyValidator("info",CfnVirtualCluster_ContainerInfoPropertyValidator)(properties.info)),errors.collect(cdk.propertyValidator("type",cdk.requiredValidator)(properties.type)),errors.collect(cdk.propertyValidator("type",cdk.validateString)(properties.type)),errors.wrap('supplied properties not correct for "ContainerProviderProperty"')}function cfnVirtualClusterContainerProviderPropertyToCloudFormation(properties){return cdk.canInspect(properties)?(CfnVirtualCluster_ContainerProviderPropertyValidator(properties).assertSuccess(),{Id:cdk.stringToCloudFormation(properties.id),Info:cfnVirtualClusterContainerInfoPropertyToCloudFormation(properties.info),Type:cdk.stringToCloudFormation(properties.type)}):properties}function CfnVirtualClusterContainerProviderPropertyFromCloudFormation(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("id","Id",cfn_parse.FromCloudFormation.getString(properties.Id)),ret.addPropertyResult("info","Info",CfnVirtualClusterContainerInfoPropertyFromCloudFormation(properties.Info)),ret.addPropertyResult("type","Type",cfn_parse.FromCloudFormation.getString(properties.Type)),ret.addUnrecognizedPropertiesAsExtra(properties),ret}function CfnVirtualCluster_EksInfoPropertyValidator(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("namespace",cdk.requiredValidator)(properties.namespace)),errors.collect(cdk.propertyValidator("namespace",cdk.validateString)(properties.namespace)),errors.wrap('supplied properties not correct for "EksInfoProperty"')}function cfnVirtualClusterEksInfoPropertyToCloudFormation(properties){return cdk.canInspect(properties)?(CfnVirtualCluster_EksInfoPropertyValidator(properties).assertSuccess(),{Namespace:cdk.stringToCloudFormation(properties.namespace)}):properties}function CfnVirtualClusterEksInfoPropertyFromCloudFormation(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("namespace","Namespace",cfn_parse.FromCloudFormation.getString(properties.Namespace)),ret.addUnrecognizedPropertiesAsExtra(properties),ret}