hashicorp / terraform-cdk

Define infrastructure resources using programming constructs and provision them using HashiCorp Terraform
https://www.terraform.io/cdktf
Mozilla Public License 2.0
4.87k stars 455 forks source link

Wafv2WebAcl: Extraneous JSON object property "managedRuleGroupStatement" #3458

Closed xxjt123xx closed 9 months ago

xxjt123xx commented 9 months ago

Expected Behavior

This was working a few weeks ago and now is giving a build error with no code changes. https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/wafv2_web_acl?lang=typescript#managedRuleGroupStatement

Actual Behavior

Build should be working

Steps to Reproduce

  1. Add Wafv2WebAcl
  2. Add a rule with managedRuleGroupStatement

Versions

language = typescript cdktf = ^0.20.1 cdktf-cli = ^0.20.1 @cdktf/provider-aws = 19.2.0

Providers

AWS

Gist

No response

Possible Solutions

No response

Workarounds

No response

Anything Else?

No response

References

No response

Help Wanted

Community Note

ansgarm commented 9 months ago

Hi @xxjt123xx 👋

There has been a small performance related change to that resource in CDKTF 0.20.1 (changelog, PR) which removes generated types for some attributes of this resource.

To fix the error you are encountering, change the casing of all keys in the rule > statement block to snake case. It should then look like this: https://github.com/hashicorp/terraform-cdk/blob/c60b321b6bc832eb21c23f5b895f78def7d55f19/examples/typescript/aws-cloudfront-proxy/main.ts#L52-L68

Sorry for the trouble this change caused! We'd have liked to solve it in another way but there sadly was no sensible alternative.

github-actions[bot] commented 8 months ago

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.