Deleting a Global datastore is a two-step process:
-
First, you must DisassociateGlobalReplicationGroup to remove the secondary clusters in the Global datastore.
-
Once the Global datastore contains only the primary cluster, you can use the DeleteGlobalReplicationGroup API to delete the Global datastore while retainining the primary cluster using RetainPrimaryReplicationGroup=true.
Since the Global Datastore has only a primary cluster, you can delete the Global Datastore while retaining the primary by setting RetainPrimaryReplicationGroup=true. The primary cluster is never deleted when deleting a Global Datastore. It can only be deleted when it no longer is associated with any Global Datastore.
When you receive a successful response from this operation, Amazon ElastiCache immediately begins deleting the selected resources; you cannot cancel or revert this operation.
Parameters:
-
global_replication_group_id
(Optional[String], default:
None
)
–
The name of the Global datastore
-
retain_primary_replication_group
(Optional[Boolean], default:
None
)
–
The primary replication group is retained as a standalone replication group.
Raises:
Source code in docs_src/capo_elasticache/_services/elasti_cache.py
| def delete_global_replication_group(
self,
*,
config_overrides: Optional[ElastiCacheClientConfig] = None,
global_replication_group_id: Optional[
"capo_elasticache.types.string.String"
] = None,
retain_primary_replication_group: Optional[
"capo_elasticache.types.boolean.Boolean"
] = None,
) -> "capo_elasticache.types.delete_global_replication_group_result.DeleteGlobalReplicationGroupResult":
"""<p>Deleting a Global datastore is a two-step process: </p> <ul> <li> <p>First, you must <a>DisassociateGlobalReplicationGroup</a> to remove the secondary clusters in the Global datastore.</p> </li> <li> <p>Once the Global datastore contains only the primary cluster, you can use the <code>DeleteGlobalReplicationGroup</code> API to delete the Global datastore while retainining the primary cluster using <code>RetainPrimaryReplicationGroup=true</code>.</p> </li> </ul> <p>Since the Global Datastore has only a primary cluster, you can delete the Global Datastore while retaining the primary by setting <code>RetainPrimaryReplicationGroup=true</code>. The primary cluster is never deleted when deleting a Global Datastore. It can only be deleted when it no longer is associated with any Global Datastore.</p> <p>When you receive a successful response from this operation, Amazon ElastiCache immediately begins deleting the selected resources; you cannot cancel or revert this operation.</p>
Args:
global_replication_group_id: <p>The name of the Global datastore</p>
retain_primary_replication_group: <p>The primary replication group is retained as a standalone replication group. </p>
Raises:
capo_elasticache.errors.global_replication_group_not_found_fault.GlobalReplicationGroupNotFoundFault: <p>The Global datastore does not exist</p>
capo_elasticache.errors.invalid_global_replication_group_state_fault.InvalidGlobalReplicationGroupStateFault: <p>The Global datastore is not available or in primary-only state.</p>
capo_elasticache.errors.invalid_parameter_value_exception.InvalidParameterValueException: <p>The value for a parameter is invalid.</p>
capo_elasticache.errors.UnknownServiceError: The service returned an error code this client does not model.
"""
def _handler(
req: "OperationRequest[capo_elasticache.types.delete_global_replication_group_message.DeleteGlobalReplicationGroupMessage]",
) -> OperationResponse[
"capo_elasticache.types.delete_global_replication_group_result.DeleteGlobalReplicationGroupResult"
]:
import capo_elasticache._operations.amazon_elasti_cache_v9.delete_global_replication_group
output, http_response = (
capo_elasticache._operations.amazon_elasti_cache_v9.delete_global_replication_group.delete_global_replication_group(
req.options, req.input
)
)
return OperationResponse(output=output, response=http_response)
interceptors_, options_ = self.operation_options(
config_overrides, OperationLogging("DeleteGlobalReplicationGroup")
)
input_: capo_elasticache.types.delete_global_replication_group_message.DeleteGlobalReplicationGroupMessage = {}
if global_replication_group_id is not None:
input_["global_replication_group_id"] = global_replication_group_id
if retain_primary_replication_group is not None:
input_["retain_primary_replication_group"] = (
retain_primary_replication_group
)
response = execute_pipeline(
OperationRequest(input=input_, options=options_),
handler=_handler,
interceptors=list(interceptors_),
)
response.response.close()
return response.output
|