Q:

Terraform aws_cloudwatch_metric_alarm An error occurred contacting the server

I'm creating CloudWatch alarm with Terraform, e.g.:
resource "aws_cloudwatch_metric_alarm" "terraform_cloudwatch_metric_alarm_CPUUtilization" {
alarm_name = "terraform_cloudwatch_metric_alarm_CPUUtilization"
alarm_description = "terraform_cloudwatch_metric_alarm_CPUUtilization"
comparison_operator = "GreaterThanOrEqualToThreshold"
evaluation_periods = "1"
metric_name = "CPUUtilization"
namespace = "AWS/EC2"
period = "300"
statistic = "Average"
threshold = "90"
dimensions = {
    "Instance­Id" = "${aws_instance.terraform_instance.id}"
}

}
But I'm getting An error occurred contacting the server:
 
When I'm creating the same from console it works fine:

Any ideas why and how to fix it?
PS Temporary workaround is to add local-exec to aws_instance:

  provisioner "local-exec" {
    command = <<-EOF
    aws cloudwatch put-metric-alarm \
    --alarm-name "cloudwatch_metric_alarm_CPUUtilization" \
    --alarm-description "cloudwatch_metric_alarm_CPUUtilization" \
    --no-actions-enabled \
    --metric-name "CPUUtilization" \
    --namespace "AWS/EC2" \
    --statistic "Average" \
    --dimensions "Name=InstanceId,Value=${aws_instance.terraform_instance.id}" \
    --period "300" \
    --unit "Percent" \
    --evaluation-periods "1" \
    --threshold "90" \
    --comparison-operator "GreaterThanOrEqualToThreshold" \
    --treat-missing-data "missing"
    EOF
  }

A:

The problem was in SOFT HYPHEN present in dimension name, both VSCode and Sublime 3 showed code normally:

only Vim/nano were showing correctly:
 

