Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix elasticache cluster nuking #348

Merged
merged 1 commit into from
Aug 12, 2022
Merged

Fix elasticache cluster nuking #348

merged 1 commit into from
Aug 12, 2022

Conversation

zackproser
Copy link
Contributor

Description

Fixes #341.

  • Look up replication groups separately. Previously we were trying to look up all cache nodes via DescribeCacheClusters, which will return nodes that are members of a ReplicationGroup - but won't signify which need to be passed through the ReplicationGroup code path. Instead, we first look up replication groups via their dedicated method DescribeReplicationGroups then issue a call to DescribeCacheClusters, specifying that the call should only return cache nodes that are not members of a replication group.
  • When then flatten both cache cluster types together, returning both types from the list method
  • When nuking an elasticache cluster - return immediately if the cluster is found to be of type Replication - previously, incorrect fallthrough behavior was causing replication groups to end up in the code path for deleting single cache nodes.

TODOs

Read the Gruntwork contribution guidelines.

  • Update the docs.
  • Run the relevant tests successfully, including pre-commit checks.
  • Ensure any 3rd party code adheres with our license policy or delete this line if its not applicable.
  • Include release notes. If this PR is backward incompatible, include a migration guide.

Release Notes (draft)

Added / Removed / Updated [X].

Migration Guide

- List replication groups and cache clusters
- Only list non-replication groups when enumering clusters
Copy link
Contributor

@yorinasub17 yorinasub17 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Also confirmed test failures are unrelated.

@zackproser
Copy link
Contributor Author

Thanks for review! Going to merge this in now.

@zackproser zackproser merged commit e926aa8 into master Aug 12, 2022
@zackproser zackproser deleted the bug/341 branch August 12, 2022 14:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Issue tearing down Elasticache in CIS-Benchmark Ref Arch
2 participants