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.
If multiple requests to create access points on the same file system are sent in quick succession, and the file system is near the limit of access points, you may experience a throttling response for these requests. This is to ensure that the file system does not exceed the stated access point limit.
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.
Parameters:
-
client_token
(ClientToken)
–
A string of up to 64 ASCII characters that Amazon EFS uses to ensure idempotent creation.
-
tags
(Optional[Tags], default:
None
)
–
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.
-
file_system_id
(FileSystemId)
–
The ID of the EFS file system that the access point provides access to.
-
posix_user
(Optional[PosixUser], default:
None
)
–
The operating system user and group applied to all file system requests made using the access point.
-
root_directory
(Optional[RootDirectory], default:
None
)
–
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.
Raises:
Source code in docs_src/capo_efs/_services/async_efs.py
| async def create_access_point(
self,
client_token: "capo_efs.types.client_token.ClientToken",
file_system_id: "capo_efs.types.file_system_id.FileSystemId",
*,
config_overrides: Optional[AsyncEFSClientConfig] = None,
tags: Optional["capo_efs.types.tags.Tags"] = None,
posix_user: Optional["capo_efs.types.posix_user.PosixUser"] = None,
root_directory: Optional["capo_efs.types.root_directory.RootDirectory"] = None,
) -> "capo_efs.types.access_point_description.AccessPointDescription":
"""<p>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 <a href="https://docs.aws.amazon.com/efs/latest/ug/efs-access-points.html">Mounting a file system using EFS access points</a>.</p> <note> <p>If multiple requests to create access points on the same file system are sent in quick succession, and the file system is near the limit of access points, you may experience a throttling response for these requests. This is to ensure that the file system does not exceed the stated access point limit.</p> </note> <p>This operation requires permissions for the <code>elasticfilesystem:CreateAccessPoint</code> action.</p> <p>Access points can be tagged on creation. If tags are specified in the creation action, IAM performs additional authorization on the <code>elasticfilesystem:TagResource</code> action to verify if users have permissions to create tags. Therefore, you must grant explicit permissions to use the <code>elasticfilesystem:TagResource</code> action. For more information, see <a href="https://docs.aws.amazon.com/efs/latest/ug/using-tags-efs.html#supported-iam-actions-tagging.html">Granting permissions to tag resources during creation</a>.</p>
Args:
client_token: <p>A string of up to 64 ASCII characters that Amazon EFS uses to ensure idempotent creation.</p>
tags: <p>Creates tags associated with the access point. Each tag is a key-value pair, each key must be unique. For more information, see <a href="https://docs.aws.amazon.com/general/latest/gr/aws_tagging.html">Tagging Amazon Web Services resources</a> in the <i>Amazon Web Services General Reference Guide</i>.</p>
file_system_id: <p>The ID of the EFS file system that the access point provides access to.</p>
posix_user: <p>The operating system user and group applied to all file system requests made using the access point.</p>
root_directory: <p>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 <code>RootDirectory</code> > <code>Path</code> specified does not exist, Amazon EFS creates it and applies the <code>CreationInfo</code> settings when a client connects to an access point. When specifying a <code>RootDirectory</code>, you must provide the <code>Path</code>, and the <code>CreationInfo</code>.</p> <p>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.</p>
Raises:
capo_efs.errors.access_point_already_exists.AccessPointAlreadyExists: <p>Returned if the access point that you are trying to create already exists, with the creation token you provided in the request.</p>
capo_efs.errors.access_point_limit_exceeded.AccessPointLimitExceeded: <p>Returned if the Amazon Web Services account has already created the maximum number of access points allowed per file system. For more informaton, see <a href="https://docs.aws.amazon.com/efs/latest/ug/limits.html#limits-efs-resources-per-account-per-region">https://docs.aws.amazon.com/efs/latest/ug/limits.html#limits-efs-resources-per-account-per-region</a>.</p>
capo_efs.errors.bad_request.BadRequest: <p>Returned if the request is malformed or contains an error such as an invalid parameter value or a missing required parameter.</p>
capo_efs.errors.file_system_not_found.FileSystemNotFound: <p>Returned if the specified <code>FileSystemId</code> value doesn't exist in the requester's Amazon Web Services account.</p>
capo_efs.errors.incorrect_file_system_life_cycle_state.IncorrectFileSystemLifeCycleState: <p>Returned if the file system's lifecycle state is not "available".</p>
capo_efs.errors.internal_server_error.InternalServerError: <p>Returned if an error occurred on the server side.</p>
capo_efs.errors.throttling_exception.ThrottlingException: <p>Returned when the <code>CreateAccessPoint</code> API action is called too quickly and the number of Access Points on the file system is nearing the <a href="https://docs.aws.amazon.com/efs/latest/ug/limits.html#limits-efs-resources-per-account-per-region">limit of 120</a>.</p>
capo_efs.errors.UnknownServiceError: The service returned an error code this client does not model.
"""
async def _handler(
req: "AsyncOperationRequest[capo_efs.types.create_access_point_request.CreateAccessPointRequest]",
) -> AsyncOperationResponse[
"capo_efs.types.access_point_description.AccessPointDescription"
]:
import capo_efs._operations.magnolio_api_service_v20150201.create_access_point
(
output,
http_response,
) = await capo_efs._operations.magnolio_api_service_v20150201.create_access_point.async_create_access_point(
req.options, req.input
)
return AsyncOperationResponse(output=output, response=http_response)
interceptors_, options_ = self.operation_options(
config_overrides, OperationLogging("CreateAccessPoint")
)
input_: capo_efs.types.create_access_point_request.CreateAccessPointRequest = {
"client_token": client_token,
"file_system_id": file_system_id,
}
if tags is not None:
input_["tags"] = tags
if posix_user is not None:
input_["posix_user"] = posix_user
if root_directory is not None:
input_["root_directory"] = root_directory
response = await aexecute_pipeline(
AsyncOperationRequest(input=input_, options=options_),
handler=_handler,
interceptors=list(interceptors_),
)
await response.response.aclose()
return response.output
|