From a65cddf77379087e7cecf772ea75299459c13244 Mon Sep 17 00:00:00 2001 From: "k.goto" <24818752+go-to-k@users.noreply.github.com> Date: Fri, 1 Sep 2023 22:57:55 +0900 Subject: [PATCH] docs(cloudwatch): Both `defaultInterval` and `start` for dashboard cannot 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* --- packages/aws-cdk-lib/aws-cloudwatch/lib/dashboard.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/packages/aws-cdk-lib/aws-cloudwatch/lib/dashboard.ts b/packages/aws-cdk-lib/aws-cloudwatch/lib/dashboard.ts index 2cf844c734ca3..bf11d4b055d55 100644 --- a/packages/aws-cdk-lib/aws-cloudwatch/lib/dashboard.ts +++ b/packages/aws-cdk-lib/aws-cloudwatch/lib/dashboard.ts @@ -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. @@ -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;