failover_global_cluster
¶
failover_global_cluster(
*,
config_overrides: Optional[DocDBClientConfig] = 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/doc_db.py
3029 3030 3031 3032 3033 3034 3035 3036 3037 3038 3039 3040 3041 3042 3043 3044 3045 3046 3047 3048 3049 3050 3051 3052 3053 3054 3055 3056 3057 3058 3059 3060 3061 3062 3063 3064 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 | |