failover_global_cluster
async
¶
failover_global_cluster(
*,
config_overrides: Optional[AsyncDocDBClientConfig] = None,
global_cluster_identifier: Optional[GlobalClusterIdentifier] = None,
target_db_cluster_identifier: Optional[DBClusterIdentifier] = None,
allow_data_loss: Optional[BooleanOptional] = None,
switchover: Optional[BooleanOptional] = None,
) -> FailoverGlobalClusterResult
Promotes the specified secondary DB cluster to be the primary DB cluster in the global cluster when failing over a global cluster occurs.
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.
Parameters:
-
global_cluster_identifier(Optional[GlobalClusterIdentifier], default:None) –The identifier of the Amazon DocumentDB global cluster to apply this operation. The identifier is the unique key assigned by the user when the cluster is created. In other words, it's the name of the global cluster.
Constraints:
-
Must match the identifier of an existing global cluster.
-
Minimum length of 1. Maximum length of 255.
Pattern:
[A-Za-z][0-9A-Za-z-:._]* -
-
target_db_cluster_identifier(Optional[DBClusterIdentifier], default:None) –The identifier of the secondary Amazon DocumentDB cluster that you want to promote to the primary for the global cluster. Use the Amazon Resource Name (ARN) for the identifier so that Amazon DocumentDB can locate the cluster in its Amazon Web Services region.
Constraints:
-
Must match the identifier of an existing secondary cluster.
-
Minimum length of 1. Maximum length of 255.
Pattern:
[A-Za-z][0-9A-Za-z-:._]* -
-
allow_data_loss(Optional[BooleanOptional], default:None) –Specifies whether to allow data loss for this global cluster operation. Allowing data loss triggers a global failover operation.
If you don't specify
AllowDataLoss, the global cluster operation defaults to a switchover.Constraints:
-
Can't be specified together with the
Switchoverparameter.
-
-
switchover(Optional[BooleanOptional], default:None) –Specifies whether to switch over this global database cluster.
Constraints:
-
Can't be specified together with the
AllowDataLossparameter.
-
Raises:
-
DBClusterNotFoundFault–DBClusterIdentifierdoesn't refer to an existing cluster. -
GlobalClusterNotFoundFault–The
GlobalClusterIdentifierdoesn't refer to an existing global cluster. -
InvalidDBClusterStateFault–The cluster isn't in a valid state.
-
InvalidGlobalClusterStateFault–The requested operation can't be performed while the cluster is in this state.
-
UnknownServiceError–The service returned an error code this client does not model.
Source code in docs_src/capo_docdb/_services/async_doc_db.py
3065 3066 3067 3068 3069 3070 3071 3072 3073 3074 3075 3076 3077 3078 3079 3080 3081 3082 3083 3084 3085 3086 3087 3088 3089 3090 3091 3092 3093 3094 3095 3096 3097 3098 3099 3100 3101 3102 3103 3104 3105 3106 3107 3108 3109 3110 3111 3112 3113 3114 3115 3116 3117 3118 3119 3120 3121 3122 3123 3124 3125 3126 3127 3128 3129 3130 3131 3132 | |