Skip to content

Dynamic keys in json set using variable causes scan to take extremely long time and flooding debug log. #7080

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
madhusudangohil opened this issue Apr 2, 2025 · 0 comments
Labels
checks Check additions or changes

Comments

@madhusudangohil
Copy link

Describe the issue
When using array of Json which has dynamic keys (key are set from variables., hence dynamic)
and using it in the resource / module to set the attributes via for_each checkov scan takes extremely long time, if i replace the dynamic key with static keys it works fine, but this is our customers terraform and asking them to use static keys is not a solution.

This started happening since version 3.2.305, the scan that would take couple minutes is now taking more than 25 minutes. The prior version works perfectly fine taking only couple minutes to scan the entire IaC.

Examples
Please share an example code sample (in the IaC of your choice) + the expected outcomes.
The below is just a sample, our code uses this approach for several resources that gets created in the IaC, several such list in different locals for different modules, approx > 100 elements
locals{
dynamodb = {
"${var.ddb_profdata}" : {

},
"${var.ddb_userdata}":{
},
"${
}
}

Version (please complete the following information):

Additional context
We are seeing lot of noise in output, the debug log size which generally is under 20 Mb is now 500 mb
Failed updating attribute for key: {key} and value {attribute_value} for

@madhusudangohil madhusudangohil added the checks Check additions or changes label Apr 2, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
checks Check additions or changes
Projects
None yet
Development

No branches or pull requests

1 participant