# DashboardProps

Properties for defining a CloudWatch Dashboard.

Extends: DashboardProps
Used as props by: Dashboard

- Source: [`aws-cloudwatch/lib/dashboard.ts`](https://github.com/aws/aws-cdk/blob/v2.275.0/packages/aws-cdk-lib/aws-cloudwatch/lib/dashboard.ts#L32)
- Type last changed: v2.88.0 · 20 Jul 2023

## Example

```ts
import * as cw from 'aws-cdk-lib/aws-cloudwatch';

const dashboard = new cw.Dashboard(this, 'Dash', {
  defaultInterval: Duration.days(7),
  variables: [new cw.DashboardVariable({
    id: 'region2',
    type: cw.VariableType.PATTERN,
    label: 'RegionPattern',
    inputType: cw.VariableInputType.INPUT,
    value: 'us-east-1',
    defaultValue: cw.DefaultValue.value('us-east-1'),
    visible: true,
  })],
});
```

## Properties

- `dashboardName`: string — Name of the dashboard.

  **Default:** automatically generated name

  If set, must only contain alphanumerics, dash (-) and underscore (_)

- `defaultInterval`: [Duration](/cdk/api/v2/docs/aws-cdk-lib.Duration.html) — Interval duration for metrics. You can specify defaultInterval with the relative time (e.g. cdk.Duration.days(7)).

  **Default:** When the dashboard loads, the defaultInterval time will be the default time range.

  Both properties `defaultInterval` and `start` cannot be set at once.

- `end`: string — The end of the time range to use for each widget on the dashboard when the dashboard loads.

  **Default:** When the dashboard loads, the end date will be the current time.

  If you specify a value for end, you must also specify a value for start.
  Specify an absolute time in the ISO 8601 format. For example, 2018-12-17T06:00:00.000Z.

- `periodOverride`: [PeriodOverride](/cdk/api/v2/docs/aws-cdk-lib.aws_cloudwatch.PeriodOverride.html) = Auto — Use this field to specify the period for the graphs when the dashboard loads.

  Specifying `Auto` causes the period of all graphs on the dashboard to automatically adapt to the time range of the dashboard.
  Specifying `Inherit` ensures that the period set for each graph is always obeyed.

- `start`: string — The start of the time range to use for each widget on the dashboard.

  **Default:** When the dashboard loads, the start time will be the default time range.

  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 -P, and you can use M, H, D, W and M as abbreviations for
  minutes, hours, days, weeks and months. For example, -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.

  Both properties `defaultInterval` and `start` cannot be set at once.

- `variables`: [IVariable](/cdk/api/v2/docs/aws-cdk-lib.aws_cloudwatch.IVariable.html)[] — A list of dashboard variables.

  **Default:** No variables

- `widgets`: [IWidget](/cdk/api/v2/docs/aws-cdk-lib.aws_cloudwatch.IWidget.html)[][] — Initial set of widgets on the dashboard.

  **Default:** No widgets

  One array represents a row of widgets.
