Method: Aws::RDS::Client#failover_global_cluster

Defined in:
lib/aws-sdk-rds/client.rb

#failover_global_cluster(params = {}) ⇒ Types::FailoverGlobalClusterResult

Promotes the specified secondary DB cluster to be the primary DB cluster in the global database cluster to fail over or switch over a global database. Switchover operations were previously called “managed planned failovers.”

<note markdown=“1”> Although this operation can be used either to fail over or to switch over a global database cluster, its intended use is for global database failover. To switch over a global database cluster, we recommend that you use the SwitchoverGlobalCluster operation instead.

</note>

How you use this operation depends on whether you are failing over or switching over your global database cluster:

  • Failing over - Specify the ‘AllowDataLoss` parameter and don’t specify the ‘Switchover` parameter.

  • Switching over - Specify the ‘Switchover` parameter or omit it, but don’t specify the ‘AllowDataLoss` parameter.

**About failing over and switching over**

While failing over and switching over a global database cluster both change the primary DB cluster, you use these operations for different reasons:

  • *Failing over* - Use this operation to respond to an unplanned event, such as a Regional disaster in the primary Region. Failing over can result in a loss of write transaction data that wasn’t replicated to the chosen secondary before the failover event occurred. However, the recovery process that promotes a DB instance on the chosen seconday DB cluster to be the primary writer DB instance guarantees that the data is in a transactionally consistent state.

    For more information about failing over an Amazon Aurora global database, see [Performing managed failovers for Aurora global databases] in the *Amazon Aurora User Guide*.

  • *Switching over* - Use this operation on a healthy global database cluster for planned events, such as Regional rotation or to fail back to the original primary DB cluster after a failover operation. With this operation, there is no data loss.

    For more information about switching over an Amazon Aurora global database, see [Performing switchovers for Aurora global databases] in the *Amazon Aurora User Guide*.

[1]: docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/aurora-global-database-disaster-recovery.html#aurora-global-database-failover.managed-unplanned [2]: docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/aurora-global-database-disaster-recovery.html#aurora-global-database-disaster-recovery.managed-failover

Examples:

Request syntax with placeholder values


resp = client.failover_global_cluster({
  global_cluster_identifier: "GlobalClusterIdentifier", # required
  target_db_cluster_identifier: "DBClusterIdentifier", # required
  allow_data_loss: false,
  switchover: false,
})

Response structure


resp.global_cluster.global_cluster_identifier #=> String
resp.global_cluster.global_cluster_resource_id #=> String
resp.global_cluster.global_cluster_arn #=> String
resp.global_cluster.status #=> String
resp.global_cluster.engine #=> String
resp.global_cluster.engine_version #=> String
resp.global_cluster.database_name #=> String
resp.global_cluster.storage_encrypted #=> Boolean
resp.global_cluster.deletion_protection #=> Boolean
resp.global_cluster.global_cluster_members #=> Array
resp.global_cluster.global_cluster_members[0].db_cluster_arn #=> String
resp.global_cluster.global_cluster_members[0].readers #=> Array
resp.global_cluster.global_cluster_members[0].readers[0] #=> String
resp.global_cluster.global_cluster_members[0].is_writer #=> Boolean
resp.global_cluster.global_cluster_members[0].global_write_forwarding_status #=> String, one of "enabled", "disabled", "enabling", "disabling", "unknown"
resp.global_cluster.global_cluster_members[0].synchronization_status #=> String, one of "connected", "pending-resync"
resp.global_cluster.failover_state.status #=> String, one of "pending", "failing-over", "cancelling"
resp.global_cluster.failover_state.from_db_cluster_arn #=> String
resp.global_cluster.failover_state.to_db_cluster_arn #=> String
resp.global_cluster.failover_state.is_data_loss_allowed #=> Boolean

Options Hash (params):

  • :global_cluster_identifier (required, String)

    The identifier of the global database cluster (Aurora global database) this operation should apply to. The identifier is the unique key assigned by the user when the Aurora global database is created. In other words, it’s the name of the Aurora global database.

    Constraints:

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

    ^

  • :target_db_cluster_identifier (required, String)

    The identifier of the secondary Aurora DB cluster that you want to promote to the 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.

  • :allow_data_loss (Boolean)

    Specifies whether to allow data loss for this global database cluster operation. Allowing data loss triggers a global failover operation.

    If you don’t specify ‘AllowDataLoss`, the global database cluster operation defaults to a switchover.

    Constraints:

    • Can’t be specified together with the ‘Switchover` parameter.

    ^

  • :switchover (Boolean)

    Specifies whether to switch over this global database cluster.

    Constraints:

    • Can’t be specified together with the ‘AllowDataLoss` parameter.

    ^

See Also:



16110
16111
16112
16113
# File 'lib/aws-sdk-rds/client.rb', line 16110

def failover_global_cluster(params = {}, options = {})
  req = build_request(:failover_global_cluster, params)
  req.send_request(options)
end