terraform-google-cloud-storage
terraform-google-cloud-storage copied to clipboard
add Lifecycle conditions: MatchesPrefix, MatchesSuffix
Support for new Lifecycle conditions: MatchesPrefix, MatchesSuffix
Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).
View this failed invocation of the CLA check for more information.
For the most up to date status, view the checks section at the bottom of the pull request.
Any progress here to merge required feature?
Thanks for the PR @elops-od Can we also add this to the main module? We will need to update the min provider version to 4.31 per https://github.com/hashicorp/terraform-provider-google/blob/main/CHANGELOG.md#4310-aug-1-2022
https://github.com/terraform-google-modules/terraform-google-cloud-storage/blob/80fa9e1fb247e9e86a1326157822687245661aa6/versions.tf#L23
https://github.com/terraform-google-modules/terraform-google-cloud-storage/blob/80fa9e1fb247e9e86a1326157822687245661aa6/modules/simple_bucket/versions.tf#L23
https://github.com/terraform-google-modules/terraform-google-cloud-storage/blob/80fa9e1fb247e9e86a1326157822687245661aa6/main.tf#L112-L131
hi done
hi @bharathkkb could you pls review thank you
Could you add this to the main module too?
https://github.com/terraform-google-modules/terraform-google-cloud-storage/blob/80fa9e1fb247e9e86a1326157822687245661aa6/main.tf#L112-L131
hi done
@bharathkkb any progress with a review on this? The feature is really needed to use the module.
Would love seeing this getting merged! Is there anything that is missing?
@elops-od
Thanks for the PR! π
β
Lint checks have passed.
hi @bharathkkb @muffl0n any updates about merge ?
Hi @elops-od - Thanks for the contribution! It looks like the Integration test is currently failing with:
Returning due to fatal error: FatalError{Underlying: error while running command: exit status 1; β·
β Error: Incorrect attribute value type
β
β on ../../main.tf line 129, in resource "google_storage_bucket" "buckets":
β 129: matches_prefix = lookup(lifecycle_rule.value.condition, "matches_prefix", null)
β
β Inappropriate value for attribute "matches_prefix": list of string
β required.
β΅
``
https://github.com/terraform-google-modules/terraform-google-cloud-storage/pull/183#issuecomment-1307455988 changed to
matches_prefix = lookup(lifecycle_rule.value.condition, "matches_prefix", [])
matches_suffix = lookup(lifecycle_rule.value.condition, "matches_suffix", [])
but still get this error @apeabody what I do wrong
@apeabody @muffl0n @bharathkkb hi guys any updates on this ?
@elops-od, no need to tag me as I'm neither a contributor to this PR nor a maintainer of this project. I'm just someone who would love to see this getting implemented.
@elops-od Thanks for the PR! π Unfortunately it looks like some of our CI checks failed. See the Contributing Guide for details.
- β οΈcheck_tflint Failed TFlint check. More details below.
Checking for tflint
Working in . ...
Failed to load configurations; main.tf:131,9-23: Attribute redefined; The argument "matches_prefix" was already set at main.tf:124,9-23. Each argument may be set only once., and 1 other diagnostic(s):
Error: Attribute redefined
on main.tf line 131, in resource "google_storage_bucket" "buckets":
131: matches_prefix = lookup(lifecycle_rule.value.condition, "matches_prefix", [])
The argument "matches_prefix" was already set at main.tf:124,9-23. Each argument may be set only once.
Error: Attribute redefined
on main.tf line 132, in resource "google_storage_bucket" "buckets":
132: matches_suffix = lookup(lifecycle_rule.value.condition, "matches_suffix", [])
The argument "matches_suffix" was already set at main.tf:125,9-23. Each argument may be set only once.
tflint failed .
Working in ./examples/multiple_buckets ...
tflint passed ./examples/multiple_buckets
Working in ./examples/simple_bucket ...
tflint passed ./examples/simple_bucket
Working in ./modules/simple_bucket ...
Failed to load configurations; main.tf:82,9-23: Attribute redefined; The argument "matches_prefix" was already set at main.tf:75,9-23. Each argument may be set only once., and 1 other diagnostic(s):
Error: Attribute redefined
on main.tf line 82, in resource "google_storage_bucket" "bucket":
82: matches_prefix = lookup(lifecycle_rule.value.condition, "matches_prefix", [])
The argument "matches_prefix" was already set at main.tf:75,9-23. Each argument may be set only once.
Error: Attribute redefined
on main.tf line 83, in resource "google_storage_bucket" "bucket":
83: matches_suffix = lookup(lifecycle_rule.value.condition, "matches_suffix", [])
The argument "matches_suffix" was already set at main.tf:76,9-23. Each argument may be set only once.
tflint failed ./modules/simple_bucket
Skipping ./test/setup
- β οΈcheck_terraform Failed Terraform check. More details below.
Running terraform fmt
β·
β
Error:
Attribute redefined
β
β
on main.tf line 131, in resource "google_storage_bucket" "buckets":
β
131:
matches_prefix
= lookup(lifecycle_rule.value.condition, "matches_prefix", [])
β
β
The argument "matches_prefix" was already set at main.tf:124,9-23. Each
β
argument may be set only once.
β΅
β·
β
Error:
Attribute redefined
β
β
on main.tf line 132, in resource "google_storage_bucket" "buckets":
β
132:
matches_suffix
= lookup(lifecycle_rule.value.condition, "matches_suffix", [])
β
β
The argument "matches_suffix" was already set at main.tf:125,9-23. Each
β
argument may be set only once.
β΅
Error: terraform fmt failed with exit code 2
Check the output for diffs and correct using terraform fmt <dir>
β·
β
Error:
Attribute redefined
β
β
on modules/simple_bucket/main.tf line 82, in resource "google_storage_bucket" "bucket":
β
82:
matches_prefix
= lookup(lifecycle_rule.value.condition, "matches_prefix", [])
β
β
The argument "matches_prefix" was already set at
β
modules/simple_bucket/main.tf:75,9-23. Each argument may be set only once.
β΅
β·
β
Error:
Attribute redefined
β
β
on modules/simple_bucket/main.tf line 83, in resource "google_storage_bucket" "bucket":
β
83:
matches_suffix
= lookup(lifecycle_rule.value.condition, "matches_suffix", [])
β
β
The argument "matches_suffix" was already set at
β
modules/simple_bucket/main.tf:76,9-23. Each argument may be set only once.
β΅
Error: terraform fmt failed with exit code 2
Check the output for diffs and correct using terraform fmt <dir>