Skip to main content
 首页 » 编程设计

python之如何使用 boto3 删除 aws elasticache redis 类型的集群

2024年11月01日9lonelyxmas

我想使用 boto3 删除 aws elasticache redis 集群。

我期望的语法是:

response = client.delete_cache_cluster( 
    CacheClusterId='string' 
) 

但它不起作用。事实上,文档指出:

This operation is not valid for:

  • Redis (cluster mode enabled) clusters

我找不到如何删除 redis 集群...

请您参考如下方法:

有一个 Redis 专用命令,delete_replication_group。参见 This .


找到文档后。对于 create_replication_group,然后它说

Creates a Redis (cluster mode disabled) or a Redis (cluster mode enabled) replication group.

对于 delete_replication_group,

Deletes an existing replication group. By default, this operation deletes the entire replication group, including the primary/primaries and all of the read replicas. If the replication group has only one primary, you can optionally delete only the read replicas, while retaining the primary by setting RetainPrimaryCluster=true .