Skip to content

update_file_system_protection

update_file_system_protection(
    file_system_id: FileSystemId,
    *,
    config_overrides: Optional[EFSClientConfig] = None,
    replication_overwrite_protection: Optional[ReplicationOverwriteProtection] = None,
) -> FileSystemProtectionDescription

Updates protection on the file system.

This operation requires permissions for the elasticfilesystem:UpdateFileSystemProtection action.

Parameters:

  • file_system_id (FileSystemId) –

    The ID of the file system to update.

  • replication_overwrite_protection (Optional[ReplicationOverwriteProtection], default: None ) –

    The status of the file system's replication overwrite protection.

    • ENABLED – The file system cannot be used as the destination file system in a replication configuration. The file system is writeable. Replication overwrite protection is ENABLED by default.

    • DISABLED – The file system can be used as the destination file system in a replication configuration. The file system is read-only and can only be modified by EFS replication.

    • REPLICATING – The file system is being used as the destination file system in a replication configuration. The file system is read-only and is only modified only by EFS replication.

    If the replication configuration is deleted, the file system's replication overwrite protection is re-enabled and the file system becomes writeable.

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".

  • InsufficientThroughputCapacity –

    Returned if there's not enough capacity to provision additional throughput. This value might be returned when you try to create a file system in provisioned throughput mode, when you attempt to increase the provisioned throughput of an existing file system, or when you attempt to change an existing file system from Bursting Throughput to Provisioned Throughput mode. Try again later.

  • InternalServerError –

    Returned if an error occurred on the server side.

  • ReplicationAlreadyExists –

    Returned if the file system is already included in a replication configuration.>

  • ThroughputLimitExceeded –

    Returned if the throughput mode or amount of provisioned throughput can't be changed because the throughput limit of 1024 MiB/s has been reached.

  • TooManyRequests –

    Returned if you don’t wait at least 24 hours before either changing the throughput mode, or decreasing the Provisioned Throughput value.

  • UnknownServiceError –

    The service returned an error code this client does not model.

Source code in docs_src/capo_efs/_services/efs.py
def update_file_system_protection(
    self,
    file_system_id: "capo_efs.types.file_system_id.FileSystemId",
    *,
    config_overrides: Optional[EFSClientConfig] = None,
    replication_overwrite_protection: Optional[
        "capo_efs.types.replication_overwrite_protection.ReplicationOverwriteProtection"
    ] = None,
) -> "capo_efs.types.file_system_protection_description.FileSystemProtectionDescription":
    """<p>Updates protection on the file system.</p> <p>This operation requires permissions for the <code>elasticfilesystem:UpdateFileSystemProtection</code> action. </p>

    Args:
        file_system_id: <p>The ID of the file system to update. </p>
        replication_overwrite_protection: <p>The status of the file system's replication overwrite protection.</p> <ul> <li> <p> <code>ENABLED</code> – The file system cannot be used as the destination file system in a replication configuration. The file system is writeable. Replication overwrite protection is <code>ENABLED</code> by default. </p> </li> <li> <p> <code>DISABLED</code> – The file system can be used as the destination file system in a replication configuration. The file system is read-only and can only be modified by EFS replication.</p> </li> <li> <p> <code>REPLICATING</code> – The file system is being used as the destination file system in a replication configuration. The file system is read-only and is only modified only by EFS replication.</p> </li> </ul> <p>If the replication configuration is deleted, the file system's replication overwrite protection is re-enabled and the file system becomes writeable.</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.insufficient_throughput_capacity.InsufficientThroughputCapacity: <p>Returned if there's not enough capacity to provision additional throughput. This value might be returned when you try to create a file system in provisioned throughput mode, when you attempt to increase the provisioned throughput of an existing file system, or when you attempt to change an existing file system from Bursting Throughput to Provisioned Throughput mode. Try again later.</p>
        capo_efs.errors.internal_server_error.InternalServerError: <p>Returned if an error occurred on the server side.</p>
        capo_efs.errors.replication_already_exists.ReplicationAlreadyExists: <p>Returned if the file system is already included in a replication configuration.></p>
        capo_efs.errors.throughput_limit_exceeded.ThroughputLimitExceeded: <p>Returned if the throughput mode or amount of provisioned throughput can't be changed because the throughput limit of 1024 MiB/s has been reached.</p>
        capo_efs.errors.too_many_requests.TooManyRequests: <p>Returned if you don’t wait at least 24 hours before either changing the throughput mode, or decreasing the Provisioned Throughput value.</p>
        capo_efs.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    def _handler(
        req: "OperationRequest[capo_efs.types.update_file_system_protection_request.UpdateFileSystemProtectionRequest]",
    ) -> OperationResponse[
        "capo_efs.types.file_system_protection_description.FileSystemProtectionDescription"
    ]:
        import capo_efs._operations.magnolio_api_service_v20150201.update_file_system_protection

        output, http_response = (
            capo_efs._operations.magnolio_api_service_v20150201.update_file_system_protection.update_file_system_protection(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("UpdateFileSystemProtection")
    )
    input_: capo_efs.types.update_file_system_protection_request.UpdateFileSystemProtectionRequest = {
        "file_system_id": file_system_id
    }
    if replication_overwrite_protection is not None:
        input_["replication_overwrite_protection"] = (
            replication_overwrite_protection
        )

    response = execute_pipeline(
        OperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    response.response.close()
    return response.output