terraform-provider-google
terraform-provider-google copied to clipboard
GCS Lifecycle Rules: Adding Unexpected Condition
Community Note
- Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request.
- Please do not leave +1 or me too comments, they generate extra noise for issue followers and do not help prioritize the request.
- If you are interested in working on this issue or have submitted a pull request, please leave a comment.
- If an issue is assigned to a user, that user is claiming responsibility for the issue.
- Customers working with a Google Technical Account Manager or Customer Engineer can ask them to reach out internally to expedite investigation and resolution of this issue.
Terraform Version
TERRAFORM_VERSION: 1.4.6 TERRAGRUNT_VERSION: 0.45.11
Affected Resource(s)
Terraform Configuration
lifecycle_rule {
action {
type = "Delete"
}
condition {
no_age = true
days_since_custom_time = 0
days_since_noncurrent_time = 30
matches_prefix = []
matches_storage_class = []
matches_suffix = []
num_newer_versions = 0
with_state = "ANY"
}
Debug Output
No response
Expected Behavior
0+ days since object was created
should not appear as a condition
Actual Behavior
0+ days since object was created
is being added
Steps to reproduce
No response
Important Factoids
No response
References
https://github.com/hashicorp/terraform-provider-google/issues/14044
b/324558844
@lrivela-uala what provider version are you using?
With below config, I do see 0+ days since object was created
showing up on the console
resource "google_storage_bucket" "test" {
name = "issue17219"
location = "US"
force_destroy = true
public_access_prevention = "enforced"
lifecycle_rule {
condition {
with_state = "ARCHIVED"
}
action {
type = "Delete"
}
}
}
@lrivela-uala what provider version are you using?
Hi! 5.15.0
Correct, that rule shouldn't appear, I referenced an issue where this was mentioned. Apparently it was fixed on 5.9.0 but the problem persists.
With below config, I do see
0+ days since object was created
showing up on the consoleresource "google_storage_bucket" "test" { name = "issue17219" location = "US" force_destroy = true public_access_prevention = "enforced" lifecycle_rule { condition { with_state = "ARCHIVED" } action { type = "Delete" } } }
Here no_age
= true is missing in the lifecycle rule condition. That is the reason for getting 0+ days since object was created
lifecycle rule.
Hi @lrivela-uala, I tried reproducing issue with my local setup but It seems that everything is working as expected. I used same configuration as you provided and I am not getting any unnecessary lifecycle rule being created. Can you please confirm whether this issue is still happening or not? There is one possibility that this rule is created before provider version upgrade, In that case one terraform apply
will solve the issue as it will take no_age
= true and remove the rule related to age
.