title: Terraform - create cloudwatch scheduled expression based on variable - expected expression but found "*"
body: <p>I'm trying to create AWS Clouwatch event rule via terraform</p>
  
  <pre><code>variable "schedule_expression" {
    default = "cron(5 * * * ? *)"
    description = "the aws cloudwatch event rule scheule expression that specifies when the scheduler runs. Default is 5 minuts past the hour. for debugging use 'rate(5 minutes)'. See https://docs.aws.amazon.com/AmazonCloudWatch/latest/events/ScheduledEvents.html"
  }
  </code></pre>
  
  <p>I want to specify variable instead of 5</p>
  
  <pre><code>variable "AutoStopSchedule" {
     default = "5"
  }
  
  variable "schedule_expression" {
    default = "cron(${var.AutoStopSchedule} * * * ? *)"
    description = "the aws cloudwatch event rule scheule expression that specifies when the scheduler runs. Default is 5 minuts past the hour. for debugging use 'rate(5 minutes)'. See https://docs.aws.amazon.com/AmazonCloudWatch/latest/events/ScheduledEvents.html"
  }
  </code></pre>
  
  <p>but getting:</p>
  
  <pre><code>Error: variable "schedule_expression": default may not contain interpolations
  </code></pre>
  
  <p>main.tf</p>
  
  <pre><code># Cloudwatch event rule
  resource "aws_cloudwatch_event_rule" "check-scheduler-event" {
      name = "check-scheduler-event"
      description = "check-scheduler-event"
      schedule_expression = "${var.schedule_expression}"
      depends_on = ["aws_lambda_function.demo_lambda"]
  }
  </code></pre>
  
  <p>i want to create schedule_expression based on AutoStopSchedule variable, how to do it ?</p>
  
  <p>Tried following:</p>
  
  <pre><code>resource "aws_cloudwatch_event_rule" "check-scheduler-event" {
      name = "check-scheduler-event"
      description = "check-scheduler-event"
  
      #schedule_expression = "cron(15 * * * ? *)"
      schedule_expression = "${var.AutoStopSchedule == "5" ? cron(5 * * * ? *) : cron(15 * * * ? *)}"
      depends_on = ["aws_lambda_function.demo_lambda"]
  }
  </code></pre>
  
  <p>getting <code>expected expression but found "*"</code></p>