aws-cdk-lib
Version:
Version 2 of the AWS Cloud Development Kit library
2 lines (1 loc) • 11.3 kB
JavaScript
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.CfnConnection=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/lib");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 CfnConnection extends cdk().CfnResource{static[JSII_RTTI_SYMBOL_1]={fqn:"aws-cdk-lib.aws_interconnect.CfnConnection",version:"2.248.0"};static CFN_RESOURCE_TYPE_NAME="AWS::Interconnect::Connection";static _fromCloudFormation(scope,id,resourceAttributes,options){resourceAttributes=resourceAttributes||{};const resourceProperties=options.parser.parseValue(resourceAttributes.Properties),propsResult=CfnConnectionPropsFromCloudFormation(resourceProperties);if(cdk().isResolvableObject(propsResult.value))throw new(cdk_errors()).ValidationError(cfn_parse().lit`UnexpectedIResolvable`,"Unexpected IResolvable",scope);const ret=new CfnConnection(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}static isCfnConnection(x){return cdk().CfnResource.isCfnResource(x)&&x.cfnResourceType===CfnConnection.CFN_RESOURCE_TYPE_NAME}static arnForConnection(resource){try{jsiiDeprecationWarnings().aws_cdk_lib_interfaces_aws_interconnect_IConnectionRef(resource)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,this.arnForConnection),error}return resource.connectionRef.connectionArn}activationKey;attachPoint;bandwidth;cdkTagManager;description;environmentId;remoteOwnerAccount;tags;constructor(scope,id,props){super(scope,id,{type:CfnConnection.CFN_RESOURCE_TYPE_NAME,properties:props});try{jsiiDeprecationWarnings().aws_cdk_lib_aws_interconnect_CfnConnectionProps(props)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,CfnConnection),error}cdk().requireProperty(props,"attachPoint",this),this.activationKey=props.activationKey,this.attachPoint=props.attachPoint,this.bandwidth=props.bandwidth,this.cdkTagManager=new(cdk()).TagManager(cdk().TagType.STANDARD,"AWS::Interconnect::Connection",void 0,{tagPropertyName:"tags"}),this.description=props.description,this.environmentId=props.environmentId,this.remoteOwnerAccount=props.remoteOwnerAccount,this.tags=props.tags}get connectionRef(){return{connectionArn:this.ref}}get attrArn(){return cdk().Token.asString(this.getAtt("Arn",cdk().ResolutionTypeHint.STRING))}get attrBillingTier(){return cdk().Token.asNumber(this.getAtt("BillingTier",cdk().ResolutionTypeHint.NUMBER))}get attrConnectionId(){return cdk().Token.asString(this.getAtt("ConnectionId",cdk().ResolutionTypeHint.STRING))}get attrOwnerAccount(){return cdk().Token.asString(this.getAtt("OwnerAccount",cdk().ResolutionTypeHint.STRING))}get attrProvider(){return this.getAtt("Provider")}get attrSharedId(){return cdk().Token.asString(this.getAtt("SharedId",cdk().ResolutionTypeHint.STRING))}get attrState(){return cdk().Token.asString(this.getAtt("State",cdk().ResolutionTypeHint.STRING))}get attrType(){return cdk().Token.asString(this.getAtt("Type",cdk().ResolutionTypeHint.STRING))}get cfnProperties(){return{activationKey:this.activationKey,attachPoint:this.attachPoint,bandwidth:this.bandwidth,tags:this.cdkTagManager.renderTags(this.tags),description:this.description,environmentId:this.environmentId,remoteOwnerAccount:this.remoteOwnerAccount}}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",CfnConnection.CFN_RESOURCE_TYPE_NAME),inspector.addAttribute("aws:cdk:cloudformation:props",this.cfnProperties)}renderProperties(props){return convertCfnConnectionPropsToCloudFormation(props)}}exports.CfnConnection=CfnConnection;function CfnConnectionAttachPointPropertyValidator(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("arn",cdk().validateString)(properties.arn)),errors.collect(cdk().propertyValidator("directConnectGateway",cdk().validateString)(properties.directConnectGateway)),errors.wrap('supplied properties not correct for "AttachPointProperty"')}function convertCfnConnectionAttachPointPropertyToCloudFormation(properties){return cdk().canInspect(properties)?(CfnConnectionAttachPointPropertyValidator(properties).assertSuccess(),{Arn:cdk().stringToCloudFormation(properties.arn),DirectConnectGateway:cdk().stringToCloudFormation(properties.directConnectGateway)}):properties}function CfnConnectionAttachPointPropertyFromCloudFormation(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("arn","Arn",properties.Arn!=null?cfn_parse().FromCloudFormation.getString(properties.Arn):void 0),ret.addPropertyResult("directConnectGateway","DirectConnectGateway",properties.DirectConnectGateway!=null?cfn_parse().FromCloudFormation.getString(properties.DirectConnectGateway):void 0),ret.addUnrecognizedPropertiesAsExtra(properties),ret}function CfnConnectionProviderPropertyValidator(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("cloudServiceProvider",cdk().validateString)(properties.cloudServiceProvider)),errors.collect(cdk().propertyValidator("lastMileProvider",cdk().validateString)(properties.lastMileProvider)),errors.wrap('supplied properties not correct for "ProviderProperty"')}function convertCfnConnectionProviderPropertyToCloudFormation(properties){return cdk().canInspect(properties)?(CfnConnectionProviderPropertyValidator(properties).assertSuccess(),{CloudServiceProvider:cdk().stringToCloudFormation(properties.cloudServiceProvider),LastMileProvider:cdk().stringToCloudFormation(properties.lastMileProvider)}):properties}function CfnConnectionProviderPropertyFromCloudFormation(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("cloudServiceProvider","CloudServiceProvider",properties.CloudServiceProvider!=null?cfn_parse().FromCloudFormation.getString(properties.CloudServiceProvider):void 0),ret.addPropertyResult("lastMileProvider","LastMileProvider",properties.LastMileProvider!=null?cfn_parse().FromCloudFormation.getString(properties.LastMileProvider):void 0),ret.addUnrecognizedPropertiesAsExtra(properties),ret}function CfnConnectionPropsValidator(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("activationKey",cdk().validateString)(properties.activationKey)),errors.collect(cdk().propertyValidator("attachPoint",cdk().requiredValidator)(properties.attachPoint)),errors.collect(cdk().propertyValidator("attachPoint",CfnConnectionAttachPointPropertyValidator)(properties.attachPoint)),errors.collect(cdk().propertyValidator("bandwidth",cdk().validateString)(properties.bandwidth)),errors.collect(cdk().propertyValidator("description",cdk().validateString)(properties.description)),errors.collect(cdk().propertyValidator("environmentId",cdk().validateString)(properties.environmentId)),errors.collect(cdk().propertyValidator("remoteOwnerAccount",cdk().validateString)(properties.remoteOwnerAccount)),errors.collect(cdk().propertyValidator("tags",cdk().listValidator(cdk().validateCfnTag))(properties.tags)),errors.wrap('supplied properties not correct for "CfnConnectionProps"')}function convertCfnConnectionPropsToCloudFormation(properties){return cdk().canInspect(properties)?(CfnConnectionPropsValidator(properties).assertSuccess(),{ActivationKey:cdk().stringToCloudFormation(properties.activationKey),AttachPoint:convertCfnConnectionAttachPointPropertyToCloudFormation(properties.attachPoint),Bandwidth:cdk().stringToCloudFormation(properties.bandwidth),Description:cdk().stringToCloudFormation(properties.description),EnvironmentId:cdk().stringToCloudFormation(properties.environmentId),RemoteOwnerAccount:cdk().stringToCloudFormation(properties.remoteOwnerAccount),Tags:cdk().listMapper(cdk().cfnTagToCloudFormation)(properties.tags)}):properties}function CfnConnectionPropsFromCloudFormation(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("activationKey","ActivationKey",properties.ActivationKey!=null?cfn_parse().FromCloudFormation.getString(properties.ActivationKey):void 0),ret.addPropertyResult("attachPoint","AttachPoint",properties.AttachPoint!=null?CfnConnectionAttachPointPropertyFromCloudFormation(properties.AttachPoint):void 0),ret.addPropertyResult("bandwidth","Bandwidth",properties.Bandwidth!=null?cfn_parse().FromCloudFormation.getString(properties.Bandwidth):void 0),ret.addPropertyResult("description","Description",properties.Description!=null?cfn_parse().FromCloudFormation.getString(properties.Description):void 0),ret.addPropertyResult("environmentId","EnvironmentId",properties.EnvironmentId!=null?cfn_parse().FromCloudFormation.getString(properties.EnvironmentId):void 0),ret.addPropertyResult("remoteOwnerAccount","RemoteOwnerAccount",properties.RemoteOwnerAccount!=null?cfn_parse().FromCloudFormation.getString(properties.RemoteOwnerAccount):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}