如果我将自己的s3
存储桶中的多个生命周期规则应用于重叠,会发生什么?
默认情况下,我希望保留7天的旧版本,但是对于特定的前缀,我希望它有所不同(1天)。
是否可以仅通过在下面添加规则来覆盖子前缀的生命周期规则?
resource "aws_s3_bucket" "my-bucket" {
bucket = "my-bucket"
acl = "private"
versioning {
enabled = true
}
lifecycle_rule {
id = "clean_old_versions"
prefix = ""
enabled = true
noncurrent_version_expiration {
days = 7
}
}
lifecycle_rule {
id = "clean_old_versions_playground"
prefix = "playground/"
enabled = true
noncurrent_version_expiration {
days = 1
}
}