AWS SDK Version 3 for .NET
API Reference

AWS services or capabilities described in AWS Documentation may vary by region/location. Click Getting Started with Amazon AWS to see specific differences applicable to the China (Beijing) Region.

Forces a failover for a DB cluster.

For an Aurora DB cluster, failover for a DB cluster promotes one of the Aurora Replicas (read-only instances) in the DB cluster to be the primary DB instance (the cluster writer).

For a Multi-AZ DB cluster, after RDS terminates the primary DB instance, the internal monitoring system detects that the primary DB instance is unhealthy and promotes a readable standby (read-only instances) in the DB cluster to be the primary DB instance (the cluster writer). Failover times are typically less than 35 seconds.

An Amazon Aurora DB cluster automatically fails over to an Aurora Replica, if one exists, when the primary DB instance fails. A Multi-AZ DB cluster automatically fails over to a readable standby DB instance when the primary DB instance fails.

To simulate a failure of a primary instance for testing, you can force a failover. Because each instance in a DB cluster has its own endpoint address, make sure to clean up and re-establish any existing connections that use those endpoint addresses when the failover is complete.

For more information on Amazon Aurora DB clusters, see What is Amazon Aurora? in the Amazon Aurora User Guide.

For more information on Multi-AZ DB clusters, see Multi-AZ DB cluster deployments in the Amazon RDS User Guide.

Note:

This is an asynchronous operation using the standard naming convention for .NET 4.5 or higher. For .NET 3.5 the operation is implemented as a pair of methods using the standard naming convention of BeginFailoverDBCluster and EndFailoverDBCluster.

Namespace: Amazon.RDS
Assembly: AWSSDK.RDS.dll
Version: 3.x.y.z

Syntax

C#
public abstract Task<FailoverDBClusterResponse> FailoverDBClusterAsync(
         FailoverDBClusterRequest request,
         CancellationToken cancellationToken
)

Parameters

request
Type: Amazon.RDS.Model.FailoverDBClusterRequest

Container for the necessary parameters to execute the FailoverDBCluster service method.

cancellationToken
Type: System.Threading.CancellationToken

A cancellation token that can be used by other objects or threads to receive notice of cancellation.

Return Value


The response from the FailoverDBCluster service method, as returned by RDS.

Exceptions

ExceptionCondition
DBClusterNotFoundException DBClusterIdentifier doesn't refer to an existing DB cluster.
InvalidDBClusterStateException The requested operation can't be performed while the cluster is in this state.
InvalidDBInstanceStateException The DB instance isn't in a valid state.

Version Information

.NET Core App:
Supported in: 3.1

.NET Standard:
Supported in: 2.0

.NET Framework:
Supported in: 4.5

See Also