Skip to content

create_replication_configuration async

create_replication_configuration(
    source_file_system_id: FileSystemId,
    destinations: DestinationsToCreate,
    *,
    config_overrides: Optional[AsyncEFSClientConfig] = None,
) -> ReplicationConfigurationDescription

Creates a replication configuration to either a new or existing EFS file system. For more information, see Amazon EFS replication in the Amazon EFS User Guide. The replication configuration specifies the following:

  • Source file system – The EFS file system that you want to replicate.

  • Destination file system – The destination file system to which the source file system is replicated. There can only be one destination file system in a replication configuration.

    A file system can be part of only one replication configuration.

    The destination parameters for the replication configuration depend on whether you are replicating to a new file system or to an existing file system, and if you are replicating across Amazon Web Services accounts. See DestinationToCreate for more information.

This operation requires permissions for the elasticfilesystem:CreateReplicationConfiguration action. Additionally, other permissions are required depending on how you are replicating file systems. For more information, see Required permissions for replication in the Amazon EFS User Guide.

Parameters:

  • source_file_system_id (FileSystemId) –

    Specifies the Amazon EFS file system that you want to replicate. This file system cannot already be a source or destination file system in another replication configuration.

  • destinations (DestinationsToCreate) –

    An array of destination configuration objects. Only one destination configuration object is supported.

Raises:

  • BadRequest –

    Returned if the request is malformed or contains an error such as an invalid parameter value or a missing required parameter.

  • ConflictException –

    Returned if the source file system in a replication is encrypted but the destination file system is unencrypted.

  • FileSystemLimitExceeded –

    Returned if the Amazon Web Services account has already created the maximum number of file systems allowed per account.

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

  • ReplicationNotFound –

    Returned if the specified file system does not have 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.

  • UnsupportedAvailabilityZone –

    Returned if the requested Amazon EFS functionality is not available in the specified Availability Zone.

  • ValidationException –

    Returned if the Backup service is not available in the Amazon Web Services Region in which the request was made.

  • UnknownServiceError –

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

Source code in docs_src/capo_efs/_services/async_efs.py
async def create_replication_configuration(
    self,
    source_file_system_id: "capo_efs.types.file_system_id.FileSystemId",
    destinations: "capo_efs.types.destinations_to_create.DestinationsToCreate",
    *,
    config_overrides: Optional[AsyncEFSClientConfig] = None,
) -> "capo_efs.types.replication_configuration_description.ReplicationConfigurationDescription":
    """<p>Creates a replication configuration to either a new or existing EFS file system. For more information, see <a href="https://docs.aws.amazon.com/efs/latest/ug/efs-replication.html">Amazon EFS replication</a> in the <i>Amazon EFS User Guide</i>. The replication configuration specifies the following:</p> <ul> <li> <p> <b>Source file system</b> – The EFS file system that you want to replicate. </p> </li> <li> <p> <b>Destination file system</b> – The destination file system to which the source file system is replicated. There can only be one destination file system in a replication configuration. </p> <note> <p>A file system can be part of only one replication configuration. </p> </note> <p>The destination parameters for the replication configuration depend on whether you are replicating to a new file system or to an existing file system, and if you are replicating across Amazon Web Services accounts. See <a>DestinationToCreate</a> for more information.</p> </li> </ul> <p>This operation requires permissions for the <code>elasticfilesystem:CreateReplicationConfiguration</code> action. Additionally, other permissions are required depending on how you are replicating file systems. For more information, see <a href="https://docs.aws.amazon.com/efs/latest/ug/efs-replication.html#efs-replication-permissions">Required permissions for replication</a> in the <i>Amazon EFS User Guide</i>.</p>

    Args:
        source_file_system_id: <p>Specifies the Amazon EFS file system that you want to replicate. This file system cannot already be a source or destination file system in another replication configuration.</p>
        destinations: <p>An array of destination configuration objects. Only one destination configuration object is supported.</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.conflict_exception.ConflictException: <p>Returned if the source file system in a replication is encrypted but the destination file system is unencrypted.</p>
        capo_efs.errors.file_system_limit_exceeded.FileSystemLimitExceeded: <p>Returned if the Amazon Web Services account has already created the maximum number of file systems allowed per account.</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_not_found.ReplicationNotFound: <p>Returned if the specified file system does not have 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.unsupported_availability_zone.UnsupportedAvailabilityZone: <p>Returned if the requested Amazon EFS functionality is not available in the specified Availability Zone.</p>
        capo_efs.errors.validation_exception.ValidationException: <p>Returned if the Backup service is not available in the Amazon Web Services Region in which the request was made.</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_replication_configuration_request.CreateReplicationConfigurationRequest]",
    ) -> AsyncOperationResponse[
        "capo_efs.types.replication_configuration_description.ReplicationConfigurationDescription"
    ]:
        import capo_efs._operations.magnolio_api_service_v20150201.create_replication_configuration

        (
            output,
            http_response,
        ) = await capo_efs._operations.magnolio_api_service_v20150201.create_replication_configuration.async_create_replication_configuration(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("CreateReplicationConfiguration")
    )
    input_: capo_efs.types.create_replication_configuration_request.CreateReplicationConfigurationRequest = {
        "source_file_system_id": source_file_system_id,
        "destinations": destinations,
    }

    response = await aexecute_pipeline(
        AsyncOperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    await response.response.aclose()
    return response.output