mlevit / aws-auto-cleanup

Programmatically delete AWS resources based on an allowlist and time to live (TTL) settings
MIT License
495 stars 54 forks source link

Question/Feature Request #18

Closed s0undt3ch closed 3 years ago

s0undt3ch commented 5 years ago

The documentation suggests that the type for ttl is an integer for the number of days.

The question is, can it be a float to represent the number of hours in a day?

If not, the feature request would be to either switch ttl to be the number of hours or for it to accept floats for fractions of days.

The reason behind this question/feature request is because we'd like to configure this for our CI infrastructure where we want to limit the resources to exists for way less than a day.

ghost commented 5 years ago

Hey @s0undt3ch. The ttl field is a DynamoDB NUMBER type which can store both integers and floating point numbers. However the way Auto Clean calculates the difference is based on datetime minus datetime in days.

This could be changed to hours without too much effort. I'll sit on this for a little to figure out the best way to implement this. It might be as simply as changing the ttl to hours instead of days or setting variable to inform Auto Cleanup whether it's days or hours etc

How does that sounds?

s0undt3ch commented 5 years ago

Whatever suites best for the project.