terraform-google-modules/terraform-google-cloud-storage

simple_bucket is missing some lifecycle rules options

jawnsy opened this issue · 1 comments

TL;DR

The main module supports several lifecycle rules that the simple bucket submodule does not

Expected behavior

I expected both to support the same lifecycle rules

Observed behavior

The simple_bucket submodule is missing several lifecycle rules.

The primary module has the "days_since_noncurrent_time" lifecycle rule (there are 9 rules in total):

dynamic "lifecycle_rule" {
for_each = var.lifecycle_rules
content {
action {
type = lifecycle_rule.value.action.type
storage_class = lookup(lifecycle_rule.value.action, "storage_class", null)
}
condition {
age = lookup(lifecycle_rule.value.condition, "age", null)
created_before = lookup(lifecycle_rule.value.condition, "created_before", null)
with_state = lookup(lifecycle_rule.value.condition, "with_state", lookup(lifecycle_rule.value.condition, "is_live", false) ? "LIVE" : null)
matches_storage_class = contains(keys(lifecycle_rule.value.condition), "matches_storage_class") ? split(",", lifecycle_rule.value.condition["matches_storage_class"]) : null
num_newer_versions = lookup(lifecycle_rule.value.condition, "num_newer_versions", null)
custom_time_before = lookup(lifecycle_rule.value.condition, "custom_time_before", null)
days_since_custom_time = lookup(lifecycle_rule.value.condition, "days_since_custom_time", null)
days_since_noncurrent_time = lookup(lifecycle_rule.value.condition, "days_since_noncurrent_time", null)
noncurrent_time_before = lookup(lifecycle_rule.value.condition, "noncurrent_time_before", null)
}
}
}

However, the simple_bucket submodule does not have that rule (there are 5 rules in total):

dynamic "lifecycle_rule" {
for_each = var.lifecycle_rules
content {
action {
type = lifecycle_rule.value.action.type
storage_class = lookup(lifecycle_rule.value.action, "storage_class", null)
}
condition {
age = lookup(lifecycle_rule.value.condition, "age", null)
created_before = lookup(lifecycle_rule.value.condition, "created_before", null)
with_state = lookup(lifecycle_rule.value.condition, "with_state", lookup(lifecycle_rule.value.condition, "is_live", false) ? "LIVE" : null)
matches_storage_class = lookup(lifecycle_rule.value.condition, "matches_storage_class", null)
num_newer_versions = lookup(lifecycle_rule.value.condition, "num_newer_versions", null)
}
}
}

Terraform Configuration

n/a

Terraform Version

$ terragrunt version
Terraform v1.0.11
on linux_amd64
+ provider registry.terraform.io/hashicorp/google v3.89.0
+ provider registry.terraform.io/hashicorp/google-beta v3.89.0
+ provider registry.terraform.io/hashicorp/random v3.1.0
+ provider registry.terraform.io/integrations/github v4.18.0

Additional information

No response

This is not a bug. it is a feature request. Recategorizing as an enhancement.

We are unlikely to fix this soon. You are welcome to file a pull request and we will review it.