UNPKG

aws-cdk-lib

Version:

Version 2 of the AWS Cloud Development Kit library

2 lines (1 loc) 7.1 kB
"use strict";var __esDecorate=exports&&exports.__esDecorate||function(ctor,descriptorIn,decorators,contextIn,initializers,extraInitializers){function accept(f){if(f!==void 0&&typeof f!="function")throw new TypeError("Function expected");return f}for(var kind=contextIn.kind,key=kind==="getter"?"get":kind==="setter"?"set":"value",target=!descriptorIn&&ctor?contextIn.static?ctor:ctor.prototype:null,descriptor=descriptorIn||(target?Object.getOwnPropertyDescriptor(target,contextIn.name):{}),_,done=!1,i=decorators.length-1;i>=0;i--){var context={};for(var p in contextIn)context[p]=p==="access"?{}:contextIn[p];for(var p in contextIn.access)context.access[p]=contextIn.access[p];context.addInitializer=function(f){if(done)throw new TypeError("Cannot add initializers after decoration has completed");extraInitializers.push(accept(f||null))};var result=(0,decorators[i])(kind==="accessor"?{get:descriptor.get,set:descriptor.set}:descriptor[key],context);if(kind==="accessor"){if(result===void 0)continue;if(result===null||typeof result!="object")throw new TypeError("Object expected");(_=accept(result.get))&&(descriptor.get=_),(_=accept(result.set))&&(descriptor.set=_),(_=accept(result.init))&&initializers.unshift(_)}else(_=accept(result))&&(kind==="field"?initializers.unshift(_):descriptor[key]=_)}target&&Object.defineProperty(target,contextIn.name,descriptor),done=!0},__runInitializers=exports&&exports.__runInitializers||function(thisArg,initializers,value){for(var useValue=arguments.length>2,i=0;i<initializers.length;i++)value=useValue?initializers[i].call(thisArg,value):initializers[i].call(thisArg);return useValue?value:void 0};Object.defineProperty(exports,"__esModule",{value:!0}),exports.AccessPoint=void 0;var jsiiDeprecationWarnings=()=>{var tmp=require("../../.warnings.jsii.js");return jsiiDeprecationWarnings=()=>tmp,tmp};const JSII_RTTI_SYMBOL_1=Symbol.for("jsii.rtti");var efs_generated_1=()=>{var tmp=require("./efs.generated");return efs_generated_1=()=>tmp,tmp},core_1=()=>{var tmp=require("../../core");return core_1=()=>tmp,tmp},metadata_resource_1=()=>{var tmp=require("../../core/lib/metadata-resource");return metadata_resource_1=()=>tmp,tmp},prop_injectable_1=()=>{var tmp=require("../../core/lib/prop-injectable");return prop_injectable_1=()=>tmp,tmp};class AccessPointBase extends core_1().Resource{}let AccessPoint=(()=>{let _classDecorators=[prop_injectable_1().propertyInjectable],_classDescriptor,_classExtraInitializers=[],_classThis,_classSuper=AccessPointBase;var AccessPoint2=class extends _classSuper{static{_classThis=this}static{const _metadata=typeof Symbol=="function"&&Symbol.metadata?Object.create(_classSuper[Symbol.metadata]??null):void 0;__esDecorate(null,_classDescriptor={value:_classThis},_classDecorators,{kind:"class",name:_classThis.name,metadata:_metadata},null,_classExtraInitializers),AccessPoint2=_classThis=_classDescriptor.value,_metadata&&Object.defineProperty(_classThis,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:_metadata})}static[JSII_RTTI_SYMBOL_1]={fqn:"aws-cdk-lib.aws_efs.AccessPoint",version:"2.233.0"};static PROPERTY_INJECTION_ID="aws-cdk-lib.aws-efs.AccessPoint";static fromAccessPointAttributes(scope,id,attrs){try{jsiiDeprecationWarnings().aws_cdk_lib_aws_efs_AccessPointAttributes(attrs)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,this.fromAccessPointAttributes),error}return new ImportedAccessPoint(scope,id,attrs)}static fromAccessPointId(scope,id,accessPointId){return new ImportedAccessPoint(scope,id,{accessPointId})}accessPointArn;accessPointId;fileSystem;constructor(scope,id,props){super(scope,id);try{jsiiDeprecationWarnings().aws_cdk_lib_aws_efs_AccessPointProps(props)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,AccessPoint2),error}(0,metadata_resource_1().addConstructMetadata)(this,props);const clientToken=props.clientToken;if((clientToken?.length===0||clientToken&&clientToken.length>64)&&!core_1().Token.isUnresolved(clientToken))throw new(core_1()).ValidationError(`The length of 'clientToken' must range from 1 to 64 characters, got: ${clientToken.length} characters`,this);const resource=new(efs_generated_1()).CfnAccessPoint(this,"Resource",{fileSystemId:props.fileSystem.fileSystemId,rootDirectory:{creationInfo:props.createAcl?{ownerGid:props.createAcl.ownerGid,ownerUid:props.createAcl.ownerUid,permissions:props.createAcl.permissions}:void 0,path:props.path},posixUser:props.posixUser?{uid:props.posixUser.uid,gid:props.posixUser.gid,secondaryGids:props.posixUser.secondaryGids}:void 0,clientToken});core_1().Tags.of(this).add("Name",this.node.path),this.accessPointId=resource.ref,this.accessPointArn=core_1().Stack.of(scope).formatArn({service:"elasticfilesystem",resource:"access-point",resourceName:this.accessPointId}),this.fileSystem=props.fileSystem}static{__runInitializers(_classThis,_classExtraInitializers)}};return AccessPoint2=_classThis})();exports.AccessPoint=AccessPoint;let ImportedAccessPoint=(()=>{let _classDecorators=[prop_injectable_1().propertyInjectable],_classDescriptor,_classExtraInitializers=[],_classThis,_classSuper=AccessPointBase;var ImportedAccessPoint2=class extends _classSuper{static{_classThis=this}static{const _metadata=typeof Symbol=="function"&&Symbol.metadata?Object.create(_classSuper[Symbol.metadata]??null):void 0;__esDecorate(null,_classDescriptor={value:_classThis},_classDecorators,{kind:"class",name:_classThis.name,metadata:_metadata},null,_classExtraInitializers),ImportedAccessPoint2=_classThis=_classDescriptor.value,_metadata&&Object.defineProperty(_classThis,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:_metadata})}static PROPERTY_INJECTION_ID="aws-cdk-lib.aws-efs.ImportedAccessPoint";accessPointId;accessPointArn;_fileSystem;constructor(scope,id,attrs){if(super(scope,id),(0,metadata_resource_1().addConstructMetadata)(this,attrs),attrs.accessPointId){if(attrs.accessPointArn)throw new(core_1()).ValidationError("Only one of accessPointId or AccessPointArn can be provided!",this);this.accessPointId=attrs.accessPointId,this.accessPointArn=core_1().Stack.of(scope).formatArn({service:"elasticfilesystem",resource:"access-point",resourceName:attrs.accessPointId})}else{if(!attrs.accessPointArn)throw new(core_1()).ValidationError("One of accessPointId or AccessPointArn is required!",this);this.accessPointArn=attrs.accessPointArn;let maybeApId=core_1().Stack.of(scope).splitArn(attrs.accessPointArn,core_1().ArnFormat.SLASH_RESOURCE_NAME).resourceName;if(!maybeApId)throw new(core_1()).ValidationError("ARN for AccessPoint must provide the resource name.",this);this.accessPointId=maybeApId}this._fileSystem=attrs.fileSystem}get fileSystem(){if(!this._fileSystem)throw new(core_1()).ValidationError("fileSystem is only available if 'fromAccessPointAttributes()' is used and a fileSystem is passed in as an attribute.",this);return this._fileSystem}static{__runInitializers(_classThis,_classExtraInitializers)}};return ImportedAccessPoint2=_classThis})();