aws-cdk-lib.aws_cloudwatch.ConcreteWidget

class ConcreteWidget

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

Implements IWidget

Implemented by AlarmStatusWidget, AlarmWidget, CustomWidget, GaugeWidget, GraphWidget, LogQueryWidget, SingleValueWidget, TextWidget

A real CloudWatch widget that has its own fixed size and remembers its position.

This is in contrast to other widgets which exist for layout purposes.

Initializer

new ConcreteWidget(width: number, height: number)

Parameters

  • width number — The amount of horizontal grid units the widget will take up.
  • height number — The amount of vertical grid units the widget will take up.

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.
x?number
y?number

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.


x?

Type: number (optional)


y?

Type: number (optional)

Methods

NameDescription
position(x, y)Place the widget at a given position.
toJson()Return the widget JSON for use in the dashboard.
protected copyMetricWarnings(...ms)Copy the warnings from the given metric.

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.


protected copyMetricWarnings(...ms)

protected copyMetricWarnings(...ms: IMetric[]): void

Parameters

  • ms IMetric

Copy the warnings from the given metric.