Skip to content

switchover_global_cluster async

switchover_global_cluster(
    *,
    config_overrides: Optional[AsyncRDSClientConfig] = None,
    global_cluster_identifier: Optional[GlobalClusterIdentifier] = None,
    target_db_cluster_identifier: Optional[DBClusterIdentifier] = None,
) -> SwitchoverGlobalClusterResult

Switches over the specified secondary DB cluster to be the new primary DB cluster in the global database cluster. Switchover operations were previously called "managed planned failovers."

Aurora promotes the specified secondary cluster to assume full read/write capabilities and demotes the current primary cluster to a secondary (read-only) cluster, maintaining the orginal replication topology. All secondary clusters are synchronized with the primary at the beginning of the process so the new primary continues operations for the Aurora global database without losing any data. Your database is unavailable for a short time while the primary and selected secondary clusters are assuming their new roles. For more information about switching over an Aurora global database, see Performing switchovers for Amazon Aurora global databases in the Amazon Aurora User Guide.

This operation is intended for controlled environments, for operations such as "regional rotation" or to fall back to the original primary after a global database failover.

Parameters:

  • global_cluster_identifier (Optional[GlobalClusterIdentifier], default: None ) –

    The identifier of the global database cluster to switch over. This parameter isn't case-sensitive.

    Constraints:

    • Must match the identifier of an existing global database cluster (Aurora global database).

  • target_db_cluster_identifier (Optional[DBClusterIdentifier], default: None ) –

    The identifier of the secondary Aurora DB cluster to promote to the new primary for the global database cluster. Use the Amazon Resource Name (ARN) for the identifier so that Aurora can locate the cluster in its Amazon Web Services Region.

Raises:

Source code in docs_src/capo_rds/_services/async_rds.py
async def switchover_global_cluster(
    self,
    *,
    config_overrides: Optional[AsyncRDSClientConfig] = None,
    global_cluster_identifier: Optional[
        "capo_rds.types.global_cluster_identifier.GlobalClusterIdentifier"
    ] = None,
    target_db_cluster_identifier: Optional[
        "capo_rds.types.db_cluster_identifier.DBClusterIdentifier"
    ] = None,
) -> (
    "capo_rds.types.switchover_global_cluster_result.SwitchoverGlobalClusterResult"
):
    """<p>Switches over the specified secondary DB cluster to be the new primary DB cluster in the global database cluster. Switchover operations were previously called "managed planned failovers."</p> <p>Aurora promotes the specified secondary cluster to assume full read/write capabilities and demotes the current primary cluster to a secondary (read-only) cluster, maintaining the orginal replication topology. All secondary clusters are synchronized with the primary at the beginning of the process so the new primary continues operations for the Aurora global database without losing any data. Your database is unavailable for a short time while the primary and selected secondary clusters are assuming their new roles. For more information about switching over an Aurora global database, see <a href="https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/aurora-global-database-disaster-recovery.html#aurora-global-database-disaster-recovery.managed-failover">Performing switchovers for Amazon Aurora global databases</a> in the <i>Amazon Aurora User Guide</i>.</p> <note> <p>This operation is intended for controlled environments, for operations such as "regional rotation" or to fall back to the original primary after a global database failover.</p> </note>

    Args:
        global_cluster_identifier: <p>The identifier of the global database cluster to switch over. This parameter isn't case-sensitive.</p> <p>Constraints:</p> <ul> <li> <p>Must match the identifier of an existing global database cluster (Aurora global database).</p> </li> </ul>
        target_db_cluster_identifier: <p>The identifier of the secondary Aurora DB cluster to promote to the new primary for the global database cluster. Use the Amazon Resource Name (ARN) for the identifier so that Aurora can locate the cluster in its Amazon Web Services Region.</p>

    Raises:
        capo_rds.errors.db_cluster_not_found_fault.DBClusterNotFoundFault: <p> <code>DBClusterIdentifier</code> doesn't refer to an existing DB cluster.</p>
        capo_rds.errors.global_cluster_not_found_fault.GlobalClusterNotFoundFault: <p>The <code>GlobalClusterIdentifier</code> doesn't refer to an existing global database cluster.</p>
        capo_rds.errors.invalid_db_cluster_state_fault.InvalidDBClusterStateFault: <p>The requested operation can't be performed while the cluster is in this state.</p>
        capo_rds.errors.invalid_global_cluster_state_fault.InvalidGlobalClusterStateFault: <p>The global cluster is in an invalid state and can't perform the requested operation.</p>
        capo_rds.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_rds.types.switchover_global_cluster_message.SwitchoverGlobalClusterMessage]",
    ) -> AsyncOperationResponse[
        "capo_rds.types.switchover_global_cluster_result.SwitchoverGlobalClusterResult"
    ]:
        import capo_rds._operations.amazon_rd_sv19.switchover_global_cluster

        (
            output,
            http_response,
        ) = await capo_rds._operations.amazon_rd_sv19.switchover_global_cluster.async_switchover_global_cluster(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("SwitchoverGlobalCluster")
    )
    input_: capo_rds.types.switchover_global_cluster_message.SwitchoverGlobalClusterMessage = {}
    if global_cluster_identifier is not None:
        input_["global_cluster_identifier"] = global_cluster_identifier
    if target_db_cluster_identifier is not None:
        input_["target_db_cluster_identifier"] = target_db_cluster_identifier

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