createAccessPoint method
Creates an EFS access point. An access point is an application-specific
view into an EFS file system that applies an operating system user and
group, and a file system path, to any file system request made through the
access point. The operating system user and group override any identity
information provided by the NFS client. The file system path is exposed as
the access point's root directory. Applications using the access point can
only access data in the application's own directory and any
subdirectories. A file system can have a maximum of 10,000 access points
unless you request an increase. To learn more, see Mounting
a file system using EFS access points.
This operation requires permissions for the
elasticfilesystem:CreateAccessPoint action.
Access points can be tagged on creation. If tags are specified in the
creation action, IAM performs additional authorization on the
elasticfilesystem:TagResource action to verify if users have
permissions to create tags. Therefore, you must grant explicit permissions
to use the elasticfilesystem:TagResource action. For more
information, see Granting
permissions to tag resources during creation.
May throw AccessPointAlreadyExists.
May throw AccessPointLimitExceeded.
May throw BadRequest.
May throw FileSystemNotFound.
May throw IncorrectFileSystemLifeCycleState.
May throw InternalServerError.
May throw ThrottlingException.
Parameter fileSystemId :
The ID of the EFS file system that the access point provides access to.
Parameter clientToken :
A string of up to 64 ASCII characters that Amazon EFS uses to ensure
idempotent creation.
Parameter posixUser :
The operating system user and group applied to all file system requests
made using the access point.
Parameter rootDirectory :
Specifies the directory on the EFS file system that the access point
exposes as the root directory of your file system to NFS clients using the
access point. The clients using the access point can only access the root
directory and below. If the RootDirectory > Path
specified does not exist, Amazon EFS creates it and applies the
CreationInfo settings when a client connects to an access
point. When specifying a RootDirectory, you must provide the
Path, and the CreationInfo.
Amazon EFS creates a root directory only if you have provided the CreationInfo: OwnUid, OwnGID, and permissions for the directory. If you do not provide this information, Amazon EFS does not create the root directory. If the root directory does not exist, attempts to mount using the access point will fail.
Parameter tags :
Creates tags associated with the access point. Each tag is a key-value
pair, each key must be unique. For more information, see Tagging
Amazon Web Services resources in the Amazon Web Services General
Reference Guide.
Implementation
Future<AccessPointDescription> createAccessPoint({
required String fileSystemId,
String? clientToken,
PosixUser? posixUser,
RootDirectory? rootDirectory,
List<Tag>? tags,
}) async {
final $payload = <String, dynamic>{
'FileSystemId': fileSystemId,
'ClientToken': clientToken ?? _s.generateIdempotencyToken(),
if (posixUser != null) 'PosixUser': posixUser,
if (rootDirectory != null) 'RootDirectory': rootDirectory,
if (tags != null) 'Tags': tags,
};
final response = await _protocol.send(
payload: $payload,
method: 'POST',
requestUri: '/2015-02-01/access-points',
exceptionFnMap: _exceptionFns,
);
return AccessPointDescription.fromJson(response);
}