Deletes the FileSystemPolicy for the specified file system. The default FileSystemPolicy goes into effect once the existing policy is deleted. For more information about the default file system policy, see Using Resource-based Policies with EFS.
This operation requires permissions for the elasticfilesystem:DeleteFileSystemPolicy action.
Parameters:
-
file_system_id
(FileSystemId)
–
Specifies the EFS file system for which to delete the FileSystemPolicy.
Raises:
-
BadRequest
–
Returned if the request is malformed or contains an error such as an invalid parameter value or a missing required parameter.
-
FileSystemNotFound
–
Returned if the specified FileSystemId value doesn't exist in the requester's Amazon Web Services account.
-
IncorrectFileSystemLifeCycleState
–
Returned if the file system's lifecycle state is not "available".
-
InternalServerError
–
Returned if an error occurred on the server side.
-
UnknownServiceError
–
The service returned an error code this client does not model.
Source code in docs_src/capo_efs/_services/efs.py
| def delete_file_system_policy(
self,
file_system_id: "capo_efs.types.file_system_id.FileSystemId",
*,
config_overrides: Optional[EFSClientConfig] = None,
) -> None:
"""<p>Deletes the <code>FileSystemPolicy</code> for the specified file system. The default <code>FileSystemPolicy</code> goes into effect once the existing policy is deleted. For more information about the default file system policy, see <a href="https://docs.aws.amazon.com/efs/latest/ug/res-based-policies-efs.html">Using Resource-based Policies with EFS</a>.</p> <p>This operation requires permissions for the <code>elasticfilesystem:DeleteFileSystemPolicy</code> action.</p>
Args:
file_system_id: <p>Specifies the EFS file system for which to delete the <code>FileSystemPolicy</code>.</p>
Raises:
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.UnknownServiceError: The service returned an error code this client does not model.
"""
def _handler(
req: "OperationRequest[capo_efs.types.delete_file_system_policy_request.DeleteFileSystemPolicyRequest]",
) -> OperationResponse[None]:
import capo_efs._operations.magnolio_api_service_v20150201.delete_file_system_policy
output, http_response = (
capo_efs._operations.magnolio_api_service_v20150201.delete_file_system_policy.delete_file_system_policy(
req.options, req.input
)
)
return OperationResponse(output=output, response=http_response)
interceptors_, options_ = self.operation_options(
config_overrides, OperationLogging("DeleteFileSystemPolicy")
)
input_: capo_efs.types.delete_file_system_policy_request.DeleteFileSystemPolicyRequest = {
"file_system_id": file_system_id
}
response = execute_pipeline(
OperationRequest(input=input_, options=options_),
handler=_handler,
interceptors=list(interceptors_),
)
response.response.close()
return response.output
|