terraform-aws-vpc icon indicating copy to clipboard operation
terraform-aws-vpc copied to clipboard

Fix: flow log warning issue

Open pooriaghaedi opened this issue 7 months ago • 7 comments
trafficstars

Description: This PR addresses the warning related to an invalid attribute combination in the aws_s3_bucket_lifecycle_configuration resource within the flow_logs module. The warning states that no attribute has been specified, while one (and only one) of [rule[0].prefix.<.filter] is required.

Changes Made: • Updated the aws_s3_bucket_lifecycle_configuration resource in flow log's main.tf to explicitly define the required attribute (prefix or filter).

Fixes: #166

pooriaghaedi avatar Mar 20 '25 11:03 pooriaghaedi

Hello thank you for raising issue #167 and for providing a suggested fix. For now I think we will hold and monitor. I believe this was caused by an unintended issue in the provider and will be fixed: https://github.com/hashicorp/terraform-provider-aws/pull/41917/files

For now if this is causing you issues i believe you can pin to an earlier version of the provider

it could be that we need to provide a new argument that allows users to provider a filter prefix. However, no one has ever asked for one and justified it

drewmullen avatar Mar 20 '25 12:03 drewmullen

@drewmullen Thanks for the reply. The main issue comes from the Cloud WAN module, which warns us all the time while we are not using the flow logs at all. I think following PR is related to the same issue: PR

pooriaghaedi avatar Mar 24 '25 05:03 pooriaghaedi

We're running into the same issue, and proposed fix seems to resolve the warning message.

paulkud avatar Apr 15 '25 17:04 paulkud

please try upgrading to provider version 5.94 - should resolve the warning.

heres the commit: https://github.com/hashicorp/terraform-provider-aws/pull/42036/files#diff-b5e5d3506909407d95c0073f24454f37a6f989673e6822b31f64b718d94aea2d

drewmullen avatar Apr 15 '25 17:04 drewmullen

please try upgrading to provider version 5.94 - should resolve the warning.

heres the commit: https://github.com/hashicorp/terraform-provider-aws/pull/42036/files#diff-b5e5d3506909407d95c0073f24454f37a6f989673e6822b31f64b718d94aea2d

We're using provider version 5.94.1, and still encountering this warning

paulkud avatar Apr 15 '25 17:04 paulkud

Thanks for confirming the version.

I found the problem… It looks like i version pinned, which should probably be removed

https://github.com/aws-ia/terraform-aws-vpc/blob/da49a30fbfeb3890076b783be0abf8639f96f431/modules/flow_logs/modules/s3_log_bucket/providers.tf#L6

hopefully, I or someone can get to this somewhat quickly… Will need to run the terraform test suite to confirm we don’t introduce any new regressions

drewmullen avatar Apr 15 '25 17:04 drewmullen

Update: Did some testing today. Removing the pinned provider still does not remove the warning. I need to dig into the PR - I dont believe the prefix should be required. that seems like a bug in the provider

drewmullen avatar Apr 22 '25 16:04 drewmullen

Hi! I merged this PR - https://github.com/aws-ia/terraform-aws-vpc/pull/168 - that it is already fixing this issue. Sorry for this, I got notified to review the other one and now I see this by checking the open PRs.

Thanks for your time! Please check v4.4.5 in case you see any other issue we need to fix.

pablo19sc avatar Jun 23 '25 12:06 pablo19sc