Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

simple_bucket is missing some lifecycle rules options #144

Closed
jawnsy opened this issue Nov 17, 2021 · 1 comment · Fixed by #145
Closed

simple_bucket is missing some lifecycle rules options #144

jawnsy opened this issue Nov 17, 2021 · 1 comment · Fixed by #145
Labels
enhancement New feature or request P3 medium priority issues triaged Scoped and ready for work

Comments

@jawnsy
Copy link
Contributor

jawnsy commented Nov 17, 2021

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

@jawnsy jawnsy added the bug Something isn't working label Nov 17, 2021
@morgante
Copy link
Contributor

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.

@morgante morgante added enhancement New feature or request P3 medium priority issues triaged Scoped and ready for work and removed bug Something isn't working labels Nov 17, 2021
jawnsy added a commit to jawnsy/terraform-google-cloud-storage that referenced this issue Nov 18, 2021
Add the following lifecycle rule conditions:

* custom_time_before
* days_since_custom_time
* days_since_noncurrent_time
* noncurrent_time_before

Closes: terraform-google-modules#144
bharathkkb pushed a commit that referenced this issue Nov 18, 2021
Add the following lifecycle rule conditions:

* custom_time_before
* days_since_custom_time
* days_since_noncurrent_time
* noncurrent_time_before

Closes: #144
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request P3 medium priority issues triaged Scoped and ready for work
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants