CloudWatch: dimension_values templating fix (#21401)

* Handle dimension value if passed as array

* Break out dimension value loading into its own func
This commit is contained in:
Erik Sundell
2020-01-08 12:24:10 +01:00
committed by GitHub
parent d22e53bba8
commit cf2dd51827
2 changed files with 23 additions and 7 deletions

View File

@@ -419,6 +419,13 @@ func (e *CloudWatchExecutor) handleGetDimensionValues(ctx context.Context, param
Name: aws.String(k),
Value: aws.String(vv),
})
} else if vv, ok := v.([]interface{}); ok {
for _, v := range vv {
dimensions = append(dimensions, &cloudwatch.DimensionFilter{
Name: aws.String(k),
Value: aws.String(v.(string)),
})
}
}
}