Skip to content

Commit

Permalink
Expiration will be 0 when the S3 lifecycle rule is disabled (#301)
Browse files Browse the repository at this point in the history
  • Loading branch information
javsanbel2 authored Feb 26, 2025
1 parent 66c550e commit d6486d4
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@ All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).

## [7.9.6] - 2025-02-26
### Fixed
- Expiration will be 0 when the S3 lifecycle rule is disabled.

## [7.9.5] - 2025-02-26
### Added
- Add option to provision glue databases using terraform instead of metastore startup.
Expand Down
4 changes: 2 additions & 2 deletions s3.tf
Original file line number Diff line number Diff line change
Expand Up @@ -96,13 +96,13 @@ resource "aws_s3_bucket_lifecycle_configuration" "apiary_data_bucket_versioning_
storage_class = each.value["s3_storage_class"]
}
}
# Rule s3 object expiration
# Rule s3 object expiration - days cannot be negative
rule {
id = "cost_optimization_expiration"
status = each.value["s3_object_expiration_days_num"] != "-1" ? "Enabled" : "Disabled"

expiration {
days = each.value["s3_object_expiration_days_num"]
days = each.value["s3_object_expiration_days_num"] != "-1" ? each.value["s3_object_expiration_days_num"] : "0"
}
}
}
Expand Down

0 comments on commit d6486d4

Please sign in to comment.