Skip to content
This repository has been archived by the owner on Oct 15, 2024. It is now read-only.

Add CreationTime to elasticache replication groups #678

Closed
wants to merge 1 commit into from

Conversation

rbroemeling
Copy link
Contributor

Add the ability to easily filter for old or expired elasticache replication groups by adding the CreationTime property to them. This allows aws-nuke to easily clear out all "old" resources while leaving recent ones intact.

Note that this functionality requires the updated aws-sdk-go library version, as was PR'ed in #677.

@rbroemeling rbroemeling requested a review from a team as a code owner September 8, 2021 20:03
Add the ability to easily filter for old or expired elasticache replication
groups by adding the `CreationTime` property to them. This allows `aws-nuke`
to easily clear out all "old" resources while leaving recent ones intact.
@rbroemeling rbroemeling force-pushed the elasticache-created-time branch from 1ccc887 to db1054e Compare September 9, 2021 12:09
@rbroemeling
Copy link
Contributor Author

If you would like me to rejig this so that the ElasticacheReplicationGroup struct only pulls in the field necessary (ReplicationGroupCreateTime), I am happy to do so. I was following the way that the cloudformation stack does it (see #676), but in other places it is handled differently as well.

Between the options of "pulling in the entire metadata struct from AWS" and "pulling in only specific fields from the metadata struct from AWS", I think that I like pulling in only specific fields better, but I'm happy to be guided by the standard of aws-nuke here as well.

Let me know!

Comment on lines +51 to +54
properties := types.NewProperties()
if i.replicationGroup.ReplicationGroupCreateTime != nil {
properties.Set("CreationTime", i.replicationGroup.ReplicationGroupCreateTime.Format(time.RFC3339))
}
Copy link
Member

Choose a reason for hiding this comment

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

You could also add more properties like the Group ID or tags if it has some.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants