-
Notifications
You must be signed in to change notification settings - Fork 110
[BUG] eval_conflict_error: object keys must be unique when evaluating terraform plan file #256
Comments
@james1miller93 Thanks for the detailed info! I had a quick try at reproducing this but haven't had luck so far. We'll keep investigating, in the meantime, these are two things that could be helpful to us to narrow this down further:
jq '.configuration.root_module | del(.outputs) | del(.resources) | walk(if type == "object" and .module.resources then del(.module.resources) | del(.module.outputs) | del(.expressions) | del(.module.variables) | del(.source) else . end)' <plan.json |
@jaspervdj-luminal - Thanks for the pointers and for looking into this for me.
Let me know if you need any further details, or if you need me to run any additional tests. |
@jaspervdj-luminal - Have you had a chance to look into this issue? |
@james1miller93 Apologies, priorities got shuffled around a bit and then the holidays hit. I will be looking into this today. |
@james1miller93 I think I was able to reproduce the issue using the redacted plan. Thanks a lot for providing that! If this is at all possible, could you give the fix/RM-6363/module-ambiguity branch a try? I believe it could fix the issue. |
@jaspervdj-luminal - Thank you for working on this. The issue appears to be fixed in the branch you've created. Do you have any idea when this will be published in an official release? |
@james1miller93 I'll add a test and get this merged into master, that way it should be in the release next Thursday. |
We've found an issue in master and will have to delay the release until Monday, my apologies. |
Hi @jaspervdj-luminal I haven't seen any progress since last couple of weeks. Could you please update and let us know when this issue can be fixed. We are blocked on our migration work due to this issue. Will be appreciated if we prioritise this issue and get this fixed ASAP. |
@mishrasanjeev224 Hey, this fix was included in the 2.4.0 release. Please let us know if this works for your case? |
Describe the bug
We're hitting the
eval_conflict_error: object keys must be unique
error when evaluating a large terraform plan file.This is a legacy project which we're migrating to a new process which includes regula policy evaluation. The projects state already contains a large number of resources and nested modules.
It looks like a bug in the module parser here is causing the error.
We're running the regula library and policies via conftest, but I've also reproduced the error when running the config through the regula binary.
I've also tested this with a plan generated by multiple versions of terraform (including latest) and the behaviour is the same.
How you're running Regula
Please include versions of all relevant tools. Some examples:
Operating System
macOS Monterey 12.0.1
x86_64
IaC Configuration
Unfortunately, I cannot share the full terraform configuration. However, I may be able to share the output of
terraform state list
if required.Additional context
The state in this project does contain over 1500 resources, so the plan file we're evaluating is large.
The text was updated successfully, but these errors were encountered: