deleteMountTarget method

Future<void> deleteMountTarget({
  1. required String mountTargetId,
})

Deletes the specified mount target.

This operation forcibly breaks any mounts of the file system by using the mount target that is being deleted, which might disrupt instances or applications using those mounts. To avoid applications getting cut off abruptly, you might consider unmounting any mounts of the mount target, if feasible. The operation also deletes the associated network interface. Uncommitted writes might be lost, but breaking a mount target using this operation does not corrupt the file system itself. The file system you created remains. You can mount an EC2 instance in your VPC by using another mount target.

This operation requires permissions for the following action on the file system:

  • elasticfilesystem:DeleteMountTarget
The operation also requires permissions for the following Amazon EC2 action on the mount target's network interface:
  • ec2:DeleteNetworkInterface

May throw BadRequest. May throw InternalServerError. May throw DependencyTimeout. May throw MountTargetNotFound.

Parameter mountTargetId : The ID of the mount target to delete (String).

Implementation

Future<void> deleteMountTarget({
  required String mountTargetId,
}) async {
  ArgumentError.checkNotNull(mountTargetId, 'mountTargetId');
  _s.validateStringLength(
    'mountTargetId',
    mountTargetId,
    13,
    45,
    isRequired: true,
  );
  await _protocol.send(
    payload: null,
    method: 'DELETE',
    requestUri:
        '/2015-02-01/mount-targets/${Uri.encodeComponent(mountTargetId)}',
    exceptionFnMap: _exceptionFns,
  );
}