Using C# CDK create a WAF CfnWebACL that uses a AWS managed ruleset. #31908
Unanswered
adam-clauss
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I am attempting to create a web acl (WAFv2). It includes some manual/custom rule definitions that work/create fine. However, when I tried to add an AWS managed rule to the mix, I started getting errors upon deployment.
If I comment out the OverrideAction, I get:
Resource handler returned message: "Error reason: A reference in your rule statement is not valid., field: RULE, parameter: Statement (Service: Wafv2, Status Code: 400, Request ID: 434fa12f-e04b-46e6-8032-c73ff13c9e5a)" (RequestToken: 37d7ad12-84da-42d0-20bc-05f4c90b6c12, HandlerErrorCode: InvalidRequest)
If I have that OverideAction, I get an error during synthesis:
Unhandled exception. System.ArgumentException: Could not infer JSII type for .NET type 'Object' (Parameter 'type')
I saw some references online and from ChatGPT that None is supposed to be initialized to a "NoneActionProperty":
However, no such type seems to exist currently. It would make sense though, as there IS a CountActionProperty for the Count version (instead of none).
This is the JSON for the equivalent rule I am trying to create when created through the AWS console itself:
Am I missing something?
Beta Was this translation helpful? Give feedback.
All reactions