aws-cdk-lib
Version:
Version 2 of the AWS Cloud Development Kit library
2 lines (1 loc) • 7.78 kB
JavaScript
;var __createBinding=exports&&exports.__createBinding||(Object.create?(function(o,m,k,k2){k2===void 0&&(k2=k);var desc=Object.getOwnPropertyDescriptor(m,k);(!desc||("get"in desc?!m.__esModule:desc.writable||desc.configurable))&&(desc={enumerable:!0,get:function(){return m[k]}}),Object.defineProperty(o,k2,desc)}):(function(o,m,k,k2){k2===void 0&&(k2=k),o[k2]=m[k]})),__setModuleDefault=exports&&exports.__setModuleDefault||(Object.create?(function(o,v){Object.defineProperty(o,"default",{enumerable:!0,value:v})}):function(o,v){o.default=v}),__importStar=exports&&exports.__importStar||(function(){var ownKeys=function(o){return ownKeys=Object.getOwnPropertyNames||function(o2){var ar=[];for(var k in o2)Object.prototype.hasOwnProperty.call(o2,k)&&(ar[ar.length]=k);return ar},ownKeys(o)};return function(mod){if(mod&&mod.__esModule)return mod;var result={};if(mod!=null)for(var k=ownKeys(mod),i=0;i<k.length;i++)k[i]!=="default"&&__createBinding(result,mod,k[i]);return __setModuleDefault(result,mod),result}})();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=__importStar(require("../../core/lib"));return cdk=()=>tmp,tmp},cfn_parse=()=>{var tmp=__importStar(require("../../core/lib/helpers-internal"));return cfn_parse=()=>tmp,tmp},cdk_errors=()=>{var tmp=__importStar(require("../../core/lib/errors"));return cdk_errors=()=>tmp,tmp};class CfnConnection extends cdk().CfnResource{static[JSII_RTTI_SYMBOL_1]={fqn:"aws-cdk-lib.aws_codeconnections.CfnConnection",version:"2.260.0"};static CFN_RESOURCE_TYPE_NAME="AWS::CodeConnections::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_codeconnections_IConnectionRef(resource)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,this.arnForConnection),error}return resource.connectionRef.connectionArn}cdkTagManager;_connectionName;_hostArn;_providerType;_tags;cfnPropertyNames={tags:"Tags",connectionName:"ConnectionName",hostArn:"HostArn",providerType:"ProviderType"};constructor(scope,id,props){super(scope,id,{type:CfnConnection.CFN_RESOURCE_TYPE_NAME,properties:props});try{jsiiDeprecationWarnings().aws_cdk_lib_aws_codeconnections_CfnConnectionProps(props)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,CfnConnection),error}cdk().requireProperty(props,"connectionName",this),this.cdkTagManager=new(cdk()).TagManager(cdk().TagType.STANDARD,"AWS::CodeConnections::Connection",void 0,{tagPropertyName:"tags"}),this._connectionName=props.connectionName,this._hostArn=props.hostArn,this._providerType=props.providerType,this._tags=props.tags}get connectionRef(){return{connectionArn:this.ref}}get connectionName(){return this._connectionName}set connectionName(value){cdk().traceProperty(this.node,"ConnectionName"),this._connectionName=value}get hostArn(){return this._hostArn}set hostArn(value){cdk().traceProperty(this.node,"HostArn"),this._hostArn=value}get providerType(){return this._providerType}set providerType(value){cdk().traceProperty(this.node,"ProviderType"),this._providerType=value}get tags(){return this._tags}set tags(value){cdk().traceProperty(this.node,"Tags"),this._tags=value}get attrConnectionArn(){return cdk().Token.asString(this.getAtt("ConnectionArn",cdk().ResolutionTypeHint.STRING))}get attrConnectionStatus(){return cdk().Token.asString(this.getAtt("ConnectionStatus",cdk().ResolutionTypeHint.STRING))}get attrOwnerAccountId(){return cdk().Token.asString(this.getAtt("OwnerAccountId",cdk().ResolutionTypeHint.STRING))}get cfnProperties(){return{tags:this.cdkTagManager.renderTags(this._tags),connectionName:this._connectionName,hostArn:this._hostArn,providerType:this._providerType}}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 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("connectionName",cdk().requiredValidator)(properties.connectionName)),errors.collect(cdk().propertyValidator("connectionName",cdk().validateString)(properties.connectionName)),errors.collect(cdk().propertyValidator("hostArn",cdk().validateString)(properties.hostArn)),errors.collect(cdk().propertyValidator("providerType",cdk().validateString)(properties.providerType)),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(),{ConnectionName:cdk().stringToCloudFormation(properties.connectionName),HostArn:cdk().stringToCloudFormation(properties.hostArn),ProviderType:cdk().stringToCloudFormation(properties.providerType),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("connectionName","ConnectionName",properties.ConnectionName!=null?cfn_parse().FromCloudFormation.getString(properties.ConnectionName):void 0),ret.addPropertyResult("hostArn","HostArn",properties.HostArn!=null?cfn_parse().FromCloudFormation.getString(properties.HostArn):void 0),ret.addPropertyResult("providerType","ProviderType",properties.ProviderType!=null?cfn_parse().FromCloudFormation.getString(properties.ProviderType):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}