aws-cdk-lib.aws_cloudwatch.SingleValueWidget

class SingleValueWidget

LanguageType name
.NETAmazon.CDK.AWS.CloudWatch.SingleValueWidget
Gogithub.com/aws/aws-cdk-go/awscdk/v2/awscloudwatch#SingleValueWidget
Javasoftware.amazon.awscdk.services.cloudwatch.SingleValueWidget
Pythonaws_cdk.aws_cloudwatch.SingleValueWidget
TypeScript (source)aws-cdk-lib » aws_cloudwatch » SingleValueWidget

Implements IWidget

Extends ConcreteWidget

A dashboard widget that displays the most recent value for every metric.

Example

declare const dashboard: cloudwatch.Dashboard;

dashboard.addWidgets(new cloudwatch.SingleValueWidget({
  metrics: [ /* ... */ ],

  fullPrecision: true,
}));

Initializer

new SingleValueWidget(props: SingleValueWidgetProps)

Parameters

  • props SingleValueWidgetProps

Properties

NameTypeDescription
heightnumberThe amount of vertical grid units the widget will take up.
widthnumberThe amount of horizontal grid units the widget will take up.
warnings?string[]Any warnings that are produced as a result of putting together this widget.

height

Type: number

The amount of vertical grid units the widget will take up.


width

Type: number

The amount of horizontal grid units the widget will take up.


warnings?

Type: string[] (optional)

Any warnings that are produced as a result of putting together this widget.

Methods

NameDescription
position(x, y)Place the widget at a given position.
toJson()Return the widget JSON for use in the dashboard.

position(x, y)

public position(x: number, y: number): void

Parameters

  • x number
  • y number

Place the widget at a given position.


toJson()

public toJson(): any[]

Returns

  • any[]

Return the widget JSON for use in the dashboard.