title: Terraform variable error : The given value is not valid
body: <p>I am trying to create a monitoring alert policy using terraform. But in the plan stage i am getting the below error on the variable. Has anyone faced a similar issue in the past ? I am new to terraform and i can trying to create a iterable resource for monitoring alert policy in gcp.</p>
  <pre><code>  Error: Invalid value for input variable
  │ 
  │   on terraform.tfvars line 149:
  │  149: alert_policies =  {
  │  150:   &quot;composer_alert&quot; = {
  │  151:     combiner     = &quot;OR&quot;
  │  152:     display_name = &quot;Alert Strategy&quot;
  │  153:     enabled      = &quot;true&quot;
  │  154:     conditions = [
  │  155:     {display_name         = &quot;Bytes used condition&quot;
  │  156:     conditions_threshold = {
  │  157:          &quot;1&quot;               = {
  │  158:       comparison           = &quot;COMPARISON_GT&quot;
  │  159:       duration             = &quot;0s&quot;
  │  160:       filter               = &quot;resource.type = \&quot;cloud_composer_environment\&quot; AND resource.labels.project_id = \&quot;prj-comp-01\&quot; AND metric.type = \&quot;composer.googleapis.com/environment/database/disk/bytes_used\&quot;&quot;
  │  161:       threshold_value      = 1600000000
  │  162:       alignment_period     = &quot;300s&quot;
  │  163:       cross_series_reducer = &quot;REDUCE_NONE&quot;
  │  164:       group_by_fields =       [&quot;project_id&quot;]
  │  165:       per_series_aligner   = &quot;ALIGN_MEAN&quot;
  │  166:       trigger_count        = 1
  │  167:       trigger_percent      = 100 
  │  168:           }
  │  169:         }
  │  170:       }
  │  171:     ]
  │  172:     notification_channels = [
  │  173:     &quot;projects/prj-test-01/notificationChannels/2276385315451985010&quot;
  │  174:     ]
  │  175:   }
  │  176:   }
  │ 
  │ The given value is not valid for variable &quot;alert_policies&quot;: a number is
  │ required.
  ╵
  ╷
  │ Error: Incorrect variable type
  │ 
  │   on variables.tf line 392:
  │  392: variable &quot;alert_policies&quot; {
  │ 
  │ The resolved value of variable &quot;alert_policies&quot; is not appropriate: a
  │ number is required.
  </code></pre>
  <p><strong><strong><strong>Variables.tf</strong></strong></strong>****</p>
  <pre><code>variable &quot;alert_policies&quot; {
    type = map(object({
      combiner     = optional(string)
      display_name = optional(string)
      enabled      = optional(bool)
      uptime_checks = optional(map(object({
        duration          = number
        uptime_check_name = string
        ssl_expiry_checks = optional(list(object({
          days_left = number
        })))
      })))
      conditions = list(object({
        display_name         = string
        conditions_threshold = map(object({
        comparison           = string
        duration             = number
        filter               = string
        threshold_value      = number
        alignment_period     = number
        cross_series_reducer = string
        group_by_fields      = list(string)
        per_series_aligner   = string
        trigger_count        = number
        trigger_percent      = number
      }))
      notification_channels = optional(list(string))
    }))
  }))
  }
  </code></pre>
  <p>╵</p>