Skip to content

Suppression Comments for resources using for_each or count do not evaluate to SKIP #7315

@rkuhlke

Description

@rkuhlke

Describe the issue
Suppression comments for Resource blocks that use for_each or count are not evaluated and will show as failed not skipped. This is for Terraform Plan frameworks with the --repo-root-for-plan-enrichment enabled.

Examples
locals {
hosted_zone_names = [
"example.com",
"example2.eu",

]
}

resource "aws_route53_zone" "example" {
for_each = toset(local.hosted_zone_names)

checkov:skip=CKV2_AWS_38

name = each.value
}

Expected aws_route53_zone.example["example2.eu"] and aws_route53_zone.example["example.com"] to be SKIPPED and got FAILED

Version (please complete the following information):

  • Checkov Version 3.2.472

Additional context

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions