Open Abhishek-singhcoupa opened 1 year ago
Thanks for reporting this bug! I could reproduce it in 0.15
. I could get around it by using an escape hatch:
wrg.add_override('rule.0.statement', {
"size_constraint_statement": {
"field_to_match": {
"body": {}
},
"comparison_operator": "GT",
"size": 8192,
"text_transformation": [
{
"priority": 0,
"type": "NONE"
}
]
}
})
Community Note
cdktf & Language Versions
language: python cdktf-cli: 0.13.3 node: v18.12.1 cdktf: 0.13.3 constructs: 10.1.188 jsii: 1.72.0 terraform: 1.1.9 arch: x64 os: darwin 22.2.0 python: Python 3.10.8 pip: pip 22.3.1 from /usr/local/lib/python3.10/site-packages/pip (python 3.10) pipenv: pipenv, version 2022.9.24
Affected Resource(s)
wafv2 RuleGroup , Rules
Debug Output
deploy fails with error -
[ERROR] default - β· β Error: creating WAFv2 RuleGroup (test-cdk): WAFInvalidParameterException: Error reason: EXACTLY_ONE_CONDITIONREQUIRED, field: STATEMENT, parameter: Statement β { β RespMetadata: { β StatusCode: 400, β RequestID: "7beaebeb-dc61-460d-9c47-10a9188b56eb" β }, β Field: "STATEMENT", β Message: "Error reason: EXACTLY_ONE_CONDITION_REQUIRED, field: STATEMENT, parameter: Statement", β Parameter: "Statement", β Reason: "You have used none or multiple values for a field that requires exactly one value." β } β β with aws_wafv2_rule_group.test-rg-cdk, β on cdk.tf .json line 69, in resource.aws _wafv2_rule_group.test-rg-cdk: β 69: }
Expected Behavior
The rule statement should be present.
Actual Behavior
statement is blank, making the deploy fail.
Steps to Reproduce
Use cdktf python , main.py definition -
Run cdktf deploy
Refer the below cdk.tf.json output file -- showing blank statement line-39-