UNPKG

aws-cdk-lib

Version:

Version 2 of the AWS Cloud Development Kit library

2 lines (1 loc) 14.5 kB
"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.251.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;_remoteAccount;_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._remoteAccount=props.remoteAccount,this._remoteOwnerAccount=props.remoteOwnerAccount,this._tags=props.tags}get connectionRef(){return{connectionArn:this.ref}}get activationKey(){return this._activationKey}set activationKey(value){cdk().traceProperty(this.node,"ActivationKey"),this._activationKey=value}get attachPoint(){return this._attachPoint}set attachPoint(value){cdk().traceProperty(this.node,"AttachPoint"),this._attachPoint=value}get bandwidth(){return this._bandwidth}set bandwidth(value){cdk().traceProperty(this.node,"Bandwidth"),this._bandwidth=value}get description(){return this._description}set description(value){cdk().traceProperty(this.node,"Description"),this._description=value}get environmentId(){return this._environmentId}set environmentId(value){cdk().traceProperty(this.node,"EnvironmentId"),this._environmentId=value}get remoteAccount(){return this._remoteAccount}set remoteAccount(value){cdk().traceProperty(this.node,"RemoteAccount"),this._remoteAccount=value}get remoteOwnerAccount(){return this._remoteOwnerAccount}set remoteOwnerAccount(value){cdk().traceProperty(this.node,"RemoteOwnerAccount"),this._remoteOwnerAccount=value}get tags(){return this._tags}set tags(value){cdk().traceProperty(this.node,"Tags"),this._tags=value}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,remoteAccount:this._remoteAccount,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:logicalId",this._synthesizeLogicalId()),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 CfnConnectionRemoteAccountPropertyValidator(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("identifier",cdk().requiredValidator)(properties.identifier)),errors.collect(cdk().propertyValidator("identifier",cdk().validateString)(properties.identifier)),errors.wrap('supplied properties not correct for "RemoteAccountProperty"')}function convertCfnConnectionRemoteAccountPropertyToCloudFormation(properties){return cdk().canInspect(properties)?(CfnConnectionRemoteAccountPropertyValidator(properties).assertSuccess(),{Identifier:cdk().stringToCloudFormation(properties.identifier)}):properties}function CfnConnectionRemoteAccountPropertyFromCloudFormation(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("identifier","Identifier",properties.Identifier!=null?cfn_parse().FromCloudFormation.getString(properties.Identifier):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("remoteAccount",CfnConnectionRemoteAccountPropertyValidator)(properties.remoteAccount)),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),RemoteAccount:convertCfnConnectionRemoteAccountPropertyToCloudFormation(properties.remoteAccount),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("remoteAccount","RemoteAccount",properties.RemoteAccount!=null?CfnConnectionRemoteAccountPropertyFromCloudFormation(properties.RemoteAccount):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}