Closed schematis closed 1 year ago
Looks to be caused by an upstream library issue: https://github.com/aws/jsii/issues/2846.
As a workaround you could try adding an override. Something along the lines of:
waf.add_override("rule.0.override_action.none", "{}")
Thanks. I'll keep tabs on the jsii issue and hopefully we'll see a fix soon. Here's what the code ended up looking like for the workaround in case anyone comes looking for it:
for index in range(len(rule_list)):
waf.add_override(f"rule.{index}.override_action.none", {})
Should be fixed by our JSII update, right @ansgarm ?
Yes, it should be. Haven't confirmed it though @DanielMSchmidt
Confirmed this is working in 0.17 (possibly for a long time now :))
I'm going to lock this issue because it has been closed for 30 days. This helps our maintainers find and focus on the active issues. If you've found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.
Community Note
cdktf & Language Versions
terraform - v1.1.5 cdktf - v0.9.0 hashicorp/aws ~> 3.74.0 node - v16.13.2 python - v3.9.10
Affected Resource(s)
Debug Output
https://gist.github.com/schematis/71bf8f8f0b437c6532c68c30b75e33fe
Expected Behavior
I have a chunk of code that iterates over a list of managed rule group properties and outputs a list of Wafv2AclRules:
CDKTF should complete
synth
successfullyActual Behavior
If the override_action contains Wafv2WebAclRuleOverrideActionNone or Wafv2WebAclRuleOverrideActionCount then synth fails with "TypeError: Don't know how to convert object to JSON" error.
I'm lost as to what's going on here. Python code is correct and I'm conforming to the rule spec in the terraform provider docs
https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/wafv2_web_acl#rules