Skip to content

Commit 45ff85f

Browse files
authored
change clean ec2 resources from 30 days to 5 days (#786)
1 parent 537c379 commit 45ff85f

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

tools/workflow/clean_ec2.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,8 @@ func main() {
3434
}
3535
for _, reservation := range describeInstancesOutput.Reservations {
3636
for _, instance := range reservation.Instances {
37-
//only delete instance if older than 30 days
38-
if time.Now().UTC().Add(-1 * time.Hour * 24 * 30).After(*instance.LaunchTime) {
37+
//only delete instance if older than 5 days
38+
if time.Now().UTC().Add(-1 * time.Hour * 24 * 5).After(*instance.LaunchTime) {
3939
log.Printf("Try to delete instance %s tags %v launch-date %v", *instance.InstanceId, instance.Tags, instance.LaunchTime)
4040
deleteInstanceIds = append(deleteInstanceIds, instance.InstanceId)
4141
}

0 commit comments

Comments
 (0)