Skip to content

Commit

Permalink
docs(cloudwatch): Both defaultInterval and start for dashboard ca…
Browse files Browse the repository at this point in the history
…nnot be set at once (#26971)

This PR adds comments that both defaultInterval and start for dashboard cannot be set at once.

The following is a validation code for them.

https://github.com/go-to-k/aws-cdk/blob/05d1c524e356f0e3cbd4799c6f7d233a44301954/packages/aws-cdk-lib/aws-cloudwatch/lib/dashboard.ts#L135-L137

----

*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
  • Loading branch information
go-to-k authored Sep 1, 2023
1 parent 0a0b37c commit a65cddf
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion packages/aws-cdk-lib/aws-cloudwatch/lib/dashboard.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,11 @@ export interface DashboardProps {
* Interval duration for metrics.
* You can specify defaultInterval with the relative time(eg. cdk.Duration.days(7)).
*
* Both properties `defaultInterval` and `start` cannot be set at once.
*
* @default When the dashboard loads, the defaultInterval time will be the default time range.
*/
readonly defaultInterval?: Duration
readonly defaultInterval?: Duration;

/**
* The start of the time range to use for each widget on the dashboard.
Expand All @@ -49,6 +51,8 @@ export interface DashboardProps {
* 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.
*
* Both properties `defaultInterval` and `start` cannot be set at once.
*
* @default When the dashboard loads, the start time will be the default time range.
*/
readonly start?: string;
Expand Down

0 comments on commit a65cddf

Please sign in to comment.