bridgecrewio / checkov

Prevent cloud misconfigurations and find vulnerabilities during build-time in infrastructure as code, container images and open source packages with Checkov by Bridgecrew.
https://www.checkov.io/
Apache License 2.0
7.02k stars 1.1k forks source link

Error parsing grafana_rule_group resource of the Grafana provider when the 'for' argument is present #6461

Open techieforfun opened 3 months ago

techieforfun commented 3 months ago

Describe the issue There is a for argument nested inside the rule argument of the grafana_rule_group resource. When this argument is present in the resource, Checkov will not analyze the file and will throw an error Error parsing file rule_group.tf.

Examples

resource "grafana_rule_group" "main" {
  folder_uid       = var.folder_uid
  interval_seconds = var.interval_seconds
  name             = var.name

  rule {
    name      = var.rule.name
    condition = var.rule.condition

    data {
      datasource_uid = var.rule.data.datasource_uid
      model          = var.rule.data.model
      ref_id         = var.rule.data.ref_id
      relative_time_range {
        from = var.rule.data.relative_time_range.from
        to   = var.rule.data.relative_time_range.to
      }
    }

    for = var.rule.for
  }
}

Expected outcome: The file should be parsed and analyzed.

Version (please complete the following information): 3.2.138

Additional context Actual outcome: Error parsing file rule_group.tf

Saarett commented 3 months ago

Hi @techieforfun , thank you for reaching out. I’ll leave this issue open to see if there are more requests for it. Of course, a contribution would be welcome :)