Skip to content

Commit

Permalink
Refactor: Remove the Elasticache default cluster configuration (#7622)
Browse files Browse the repository at this point in the history
  • Loading branch information
jfmainville committed Apr 23, 2024
1 parent 476d0b8 commit 9322e49
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 40 deletions.
39 changes: 1 addition & 38 deletions moto/elasticache/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -152,44 +152,7 @@ def __init__(self, region_name: str, account_id: str):
no_password_required=True,
)

# Define the cache_clusters dictionary to detect duplicates
self.cache_clusters = dict()
self.cache_clusters["default"] = CacheCluster(
account_id=self.account_id,
region_name=self.region_name,
cache_cluster_id="default",
replication_group_id=None,
az_mode=None,
preferred_availability_zone=None,
num_cache_nodes=1,
cache_node_type=None,
engine="redis",
engine_version=None,
cache_parameter_group_name=None,
cache_subnet_group_name=None,
transit_encryption_enabled=True,
network_type=None,
ip_discovery=None,
snapshot_name=None,
preferred_maintenance_window=None,
port=6379,
notification_topic_arn=None,
auto_minor_version_upgrade=True,
snapshot_retention_limit=0,
snapshot_window=None,
auth_token=None,
outpost_mode=None,
preferred_outpost_arn=None,
preferred_availability_zones=[],
cache_security_group_names=[],
security_group_ids=[],
tags=[],
snapshot_arns=[],
preferred_outpost_arns=[],
log_delivery_configurations=[],
cache_node_ids_to_remove=[],
cache_node_ids_to_reboot=[],
)
self.cache_clusters: Dict[str, Any] = dict()

def create_user(
self,
Expand Down
2 changes: 0 additions & 2 deletions tests/test_elasticache/test_elasticache.py
Original file line number Diff line number Diff line change
Expand Up @@ -305,8 +305,6 @@ def test_describe_all_cache_clusters():
assert resp["ResponseMetadata"]["HTTPStatusCode"] == 200

cache_clusters = resp["CacheClusters"]
# account for the default cluster created moto/elasticache/models.py line 148
del cache_clusters[0]

for i, cache_cluster in enumerate(cache_clusters):
if cache_cluster["CacheClusterId"] == f"test-cache-cluster-{i}":
Expand Down

0 comments on commit 9322e49

Please sign in to comment.