question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

wafv2.py - Issue with WebACL Rules attribute and ManagedRuleGroupStatement

See original GitHub issue
  1. When using the WebACL, the only way I could get it to work was by changing the ‘Rules’ attribute from ‘(Rules, False)’ to ‘([Rule], False)’.

  2. When adding a rule to WebACL.Rules[], and adding a statement of type ManagedRuleGroupStatement, Cloudformation seems to require an OverrideAction; though, an Action is optional. I attempted to assign an OverrideAction of None=wafv2.NoneAction(), but without success. I modified the ‘None’ prop of OverrideAction to ‘none’, and Cloudformation was happy. Is there a better way to handle a prop which has the same name as a Python reserved word? Thanks for your help. JS

Modified wafv2.py

class OverrideAction(AWSProperty):
    props = {
        'Count': (CountAction, False),
        'none': (NoneAction, False),
    }

Example

                    OverrideAction=wafv2.OverrideAction(
                        none=wafv2.NoneAction(),
                    ),

Issue Analytics

  • State:open
  • Created 4 years ago
  • Comments:6 (5 by maintainers)

github_iconTop GitHub Comments

4reactions
nkrummcommented, May 29, 2020

As a workaround for the None problem, you can do this:

...
OverrideAction=OverrideAction(**{"None":NoneAction()})
...
0reactions
tnielsen2commented, Jan 11, 2022

This appears fixed in the latest update of Troposphere as I no longer have to use this workaround.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Developers - wafv2.py - Issue with WebACL Rules attribute and ...
wafv2.py - Issue with WebACL Rules attribute and ManagedRuleGroupStatement ... 1) When using the WebACL, the only way I could get it to...
Read more >
AWS::WAFv2::WebACL ManagedRuleGroupStatement
A rule statement used to run the rules that are defined in a managed rule group. To use this, provide the vendor name...
Read more >
WAFV2 — Boto3 Docs 1.26.32 documentation - AWS
If you used WAF prior to this release, you can't use this WAFV2 API to access ... You can define a web ACL...
Read more >
Python Error: Cannot extract data from dictionary
UPDATE :- In case anyone else comes up against this problem, I fixed this by ... WebACL.Rules[0].Statement.ManagedRuleGroupStatement.Name.
Read more >
aws-babylon_wafv2_web_acl | Resources - Terraform Registry
Creates a WAFv2 Web ACL resource. ... See Managed Rule Group Statement below for details. not_statement - (Optional) A logical rule statement used...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found