title: Using Fn::ImportValue in Dashboard Cloudwatch
body: <p>I'm trying to setup a Dashboard in Cloudformation and want to use an Exported Value to make it dynamic: but it fails saying: </p>
  
  <p><strong>The dashboard body is invalid, there are 1 validation errors: [ { "message": "Invalid metric field type, only \"String\" type is allowed", "dataPath": "/widgets/0/properties/metrics/0/3" } ] (Service: AmazonCloudWatch; Status Code: 400; Error Code: InvalidParameterInput; Request ID: 01f3ebfa-d856-11e8-a2dc-dd8c90ad1109)</strong></p>
  
  <p>the code is:</p>
  
  <pre><code>Resources:
   NATDashboard:
   Type: AWS::CloudWatch::Dashboard
   Properties:
    DashboardName: NAT-Dashboard
    DashboardBody: !Sub |
      {
          "widgets": [
              {
                  "type": "metric",
                  "x": 0,
                  "y": 0,
                  "width": 3,
                  "height": 9,
                  "properties": {
                      "metrics": [
                          [ "AWS/NATGateway", "ActiveConnectionCount", "NatGatewayId", {"Fn::ImportValue": {"Fn::Sub": "${EnvironmentName}-NATGateway1Id"}}, { "stat": "Maximum" } ],
                          [ "...", "nat-057236a417c993781", { "stat": "Maximum" } ],
                          [ "...", "nat-09b8d012addc7e0fe", { "stat": "Maximum" } ]
                      ],
                      "view": "singleValue",
                      "region": "${AWS::Region}"
                  }
              },
  </code></pre>
  
  <p>it works until I introduce Fn::ImportValue; is there a chance to use Exported Values here?</p>
  
  <p>Merci A</p>