Duration should be converted into a properly formatted string, and the default range of the dashboard should be set correctly according to CloudWatch api spec in the CloudFormation template:
start
The start of the time range to use for each widget on the dashboard.
You can specify start without specifying end to specify a relative time range that ends with the current time. In this case, the value of start must begin with -PT if you specify a time range in minutes or hours, and must begin with -P if you specify a time range in days, weeks, or months. You can then use M, H, D, W and M as abbreviations for minutes, hours, days, weeks and months. For example, -PT5M shows the last 5 minutes, -PT8H shows the last 8 hours, and -P3M shows the last three months.
You can also use start along with an end field, to specify an absolute time range. When specifying an absolute time range, use the ISO 8601 format. For example, 2018-12-17T06:00:00.000Z.
If you omit start, the dashboard shows the default time range when it loads.
Type: String
Required: No
dashboardConfig.range is restricted to type Duration, and this translates into the cloudformation template, resulting in no default start and the behavior is that it shows 3 hours.
Version
5.0.0
Steps and/or minimal code example to reproduce
Create any MonitoringFacade with dashboardConfigs and DynamicSegments:
Expected behavior
Duration should be converted into a properly formatted string, and the default range of the dashboard should be set correctly according to CloudWatch api spec in the CloudFormation template:
Example:
Actual behavior
In the constructor of DynamicDashboardFactory, this is used in the following way:
dashboardConfig.range is restricted to type
Duration
, and this translates into the cloudformation template, resulting in no default start and the behavior is that it shows 3 hours.Example:
Other details
Maybe let the interface DynamicDashboardConfiguration range property be able to be string? Or fix from
to