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

Only log BLOCK requests #122

Closed
asininemonkey opened this issue Sep 14, 2023 · 3 comments
Closed

Only log BLOCK requests #122

asininemonkey opened this issue Sep 14, 2023 · 3 comments

Comments

@asininemonkey
Copy link

Is your feature request related to a problem? Please describe.
Enabling logging logs all requests

Describe the solution you'd like
Option to log only BLOCK requests

Describe alternatives you've considered
No other option beyond declaring the entire WAF resource myself

Additional context
N/A

@rdadlani
Copy link

You could declare your own aws_wafv2_web_acl_logging_configuration and set the logging filter, like so:

  logging_filter {
    default_behavior = "KEEP"

    filter {
      behavior = "DROP"

      condition {
        action_condition {
          action = "ALLOW"
        }
      }
      requirement = "MEETS_ALL"
    }
  }

This has been my workaround for a while now using this module

@asininemonkey
Copy link
Author

asininemonkey commented Sep 26, 2023

While that is a brilliant solution, having just tried it myself I see that my resource gets reverted by the module's own aws_wafv2_web_acl_logging_configuration.main[0] resource. Running apply numerous times just results in a ping ping replacement of one resource over the other.

Being able to control the module's own logging filter still appears to be the best solution unless the ping pong issue I've just described can also be solved.

@rdadlani
Copy link

It's hard to say more without first seeing your plan. My best guess without looking is that you may need/want to do some terraform state maneuvering.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants