I am setting up lifecycle policies for some of my buckets via terraform.
I have this strategy:
standard > nearline > deletion.
The thing is, I am not sure if the AGE property of a file in the bucket resets when the storage class changes.
And that is important because I'm just keeping my files in nearline for the minimum amount of time (30 days) and then deleting them. If the age counter is not resetting, then I would be getting charged for the days until that file would have been for 30 days in nearline.
This is my rule in terraform:
lifecycle_rule {
condition {
age = 7
matches_prefix = ["production/"]
matches_suffix = [".csv"]
matches_storage_class = ["STANDARD"]
}
action {
type = "SetStorageClass"
storage_class = "NEARLINE"
}
}
lifecycle_rule {
condition {
age = 30
matches_prefix = ["production/"]
matches_suffix = [".csv"]
matches_storage_class = ["NEARLINE"]
}
action {
type = "Delete"
}
}
Would the deletion rule work as intended or do I need to set the age to be 37 instead of 30?