jckuester / awsweeper

A tool for cleaning your AWS account
Mozilla Public License 2.0
468 stars 45 forks source link

Filter by relative date #43

Closed cloudlena closed 4 years ago

cloudlena commented 4 years ago

I would like to filter by a relative date instead of an absolute one. An example might be:

aws_instance:
  - created:
      before: 5d

This would delete all resources that are older than 5 days at the time of running awsweeper. We could use the standard Go terms like 5d, 2h, 2m etc.

jckuester commented 4 years ago

Same idea here as the age filter, I suppose? See: https://github.com/cloudetc/awsweeper/pull/36

cloudlena commented 4 years ago

Yes, it's a duplicate. Sorry for not checking thoroughly enough.

jckuester commented 4 years ago

I reopen this, because I referenced only a PR that someone contributed (without tests unfortunately). It's good to have an actual issue for this :slightly_smiling_face:

I also like your idea, to not introduce a new age filter, but extend the existing created: before/after: semantics with relative dates.

kadaan commented 4 years ago

Completed by #46