Module cloudwatch

@pulumi/awsx > cloudwatch

class AlarmAnnotation

implements WidgetAnnotation

Adds an alarm annotation to a [MetricWidget], allowing a metric alarm to be displayed in a Dashboard.

constructor

new AlarmAnnotation(alarmArn: pulumi.Input<string>)

method addWidgetJson

public addWidgetJson(annotations: wjson.MetricWidgetAnnotationsJson): void

For internal use only.

class ColumnWidget

extends FlowWidget
implements Widget

Represents a vertical sequence of [Widget]s in the [Dashboard]. There is no limit on how long this sequence will be.

The final width of this widget will be the width of the largest item in the column. The final height of this widget will be the sum of all the heights of all the widgets in the column.

constructor

new ColumnWidget(widgets: Widget[])

method addWidget

public addWidget(widget: Widget): void

method addWidgetJson

public addWidgetJson(widgetJsons: WidgetJson[], xOffset: number, yOffset: number): void

For internal use only.

method getWidgetRelativePositions

protected getWidgetRelativePositions(): Map<Widget, WidgetRelativePosition>

method height

public height(): number

method width

public width(): number

property widgets

protected widgets: Widget[] =  [];

class Dashboard

extends Dashboard

[Dashboard]s are represented by a grid of columns 24 wide, with an unlimited number of rows.

Each [Widget] in the [Dashboard] have a specific width/height in terms of grid units.

A [Dashboard] can include up to 100 widgets. See https://docs.aws.amazon.com/AmazonCloudWatch/latest/APIReference/CloudWatch-Dashboard-Body-Structure.html#CloudWatch-Dashboard-Properties-Rendering-Object-Format for more details.

constructor

new Dashboard(name: string, args: DashboardArgs, opts?: pulumi.CustomResourceOptions)

Constructs a [DashboardGrid] out of [Widget]s. If any of these Widgets are [RowWidget]s. then these will be treated as a sequence of rows to add to the grid. Otherwise, this will be treated as a single row to add to the grid.

method get

static get(name: string, id: pulumi.Input<pulumi.ID>, state?: DashboardState, opts?: pulumi.CustomResourceOptions): Dashboard

Get an existing Dashboard resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

method getProvider

getProvider(moduleMember: string): ProviderResource | undefined

method isInstance

static isInstance(obj: any): boolean

Returns true if the given object is an instance of CustomResource. This is designed to work even when multiple copies of the Pulumi SDK have been loaded into the same process.

property dashboardArn

dashboardArn: pulumi.Output<string>;

The Amazon Resource Name (ARN) of the dashboard.

property dashboardBody

dashboardBody: pulumi.Output<string>;

The detailed information about the dashboard, including what widgets are included and their location on the dashboard. You can read more about the body structure in the documentation.

property dashboardName

dashboardName: pulumi.Output<string>;

The name of the dashboard.

property id

id: Output<ID>;

id is the provider-assigned unique ID for this managed resource. It is set during deployments and may be missing (undefined) during planning phases.

property urn

urn: Output<URN>;

urn is the stable logical URN used to distinctly address a resource, both before and after deployments.

class ExpressionWidgetMetric

implements WidgetMetric

Used to pass math or search expressions to a [MetricWidget].

See https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/using-metric-math.html and https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/using-search-expressions.html for more details.

constructor

new ExpressionWidgetMetric(expression: pulumi.Input<string>, label?: pulumi.Input<string>, id?: pulumi.Input<string>)
  • expression The math expression or search expression.
  • label The label to display in the graph to represent this time series.
  • id The id of this time series. This id can be used as part of a math expression.

method addWidgetJson

addWidgetJson(metrics: wjson.MetricJson[]): void

For internal use only.

class FlowWidget

implements Widget

A sequence of widgets flowing either horizontally or vertically. Widgets flowing horizontally must wrap after 24 grid columns. There is no effective vertical limit on widgets flowing vertically.

constructor

new FlowWidget(widgets: Widget[])

method addWidget

public addWidget(widget: Widget): void

method addWidgetJson

public addWidgetJson(widgetJsons: WidgetJson[], xOffset: number, yOffset: number): void

For internal use only.

method getWidgetRelativePositions

protected getWidgetRelativePositions(): Map<Widget, WidgetRelativePosition>

Determines the relative positions of all the child widgets in this [FlowWidget]. ‘Relative Position’ tells us where the widget should be placed relative to the upper-left point of this FlowWidget.

method height

public height(): number

method width

public width(): number

property widgets

protected widgets: Widget[] =  [];

class GraphMetricWidget

extends MetricWidget
implements Widget

Base type for widets that display metrics as a graph (either a line or stacked graph).

See https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/graph_metrics.html for more details.

constructor

new GraphMetricWidget(graphArgs: GraphMetricWidgetArgs)

method addWidgetJson

public addWidgetJson(widgetJsons: wjson.WidgetJson[], xOffset: number, yOffset: number): void

For internal use only.

method computeProperties

protected computeProperties(): MetricWidgetPropertiesJson | Promise<MetricWidgetPropertiesJson> | OutputInstance<MetricWidgetPropertiesJson>

method computeType

protected computeType(): "metric" | Promise<"metric"> | OutputInstance<"metric">

method computeView

protected computeView(): undefined | "timeSeries" | "singleValue" | Promise<undefined | "timeSeries" | "singleValue"> | OutputInstance<undefined | "timeSeries" | "singleValue">

method computeYAxis

protected computeYAxis(): undefined | YAxis | Promise<YAxis> | OutputInstance<YAxis>

method computedStacked

protected computedStacked(): undefined | false | true | Promise<undefined | false | true> | OutputInstance<undefined | false | true>

method height

public height(): number

method width

public width(): number

class HorizontalAnnotation

implements WidgetAnnotation

Horizontal annotations have several options for fill shading, including shading above the annotation line, shading below the annotation line, and “band” shading that appears between two linked annotation lines as part of a single band annotation

constructor

new HorizontalAnnotation(args: HorizontalAnnotationArgs)
new HorizontalAnnotation(args: HorizontalAlarmAnnotationArgs)

method addWidgetJson

public addWidgetJson(annotations: wjson.MetricWidgetAnnotationsJson): void

For internal use only.

class LineGraphMetricWidget

extends GraphMetricWidget
implements Widget

Displays a set of metrics as a line graph.

constructor

new LineGraphMetricWidget(args: GraphMetricWidgetArgs)

method addWidgetJson

public addWidgetJson(widgetJsons: wjson.WidgetJson[], xOffset: number, yOffset: number): void

For internal use only.

method computeProperties

protected computeProperties(): MetricWidgetPropertiesJson | Promise<MetricWidgetPropertiesJson> | OutputInstance<MetricWidgetPropertiesJson>

method computeType

protected computeType(): "metric" | Promise<"metric"> | OutputInstance<"metric">

method computeView

protected computeView(): undefined | "timeSeries" | "singleValue" | Promise<undefined | "timeSeries" | "singleValue"> | OutputInstance<undefined | "timeSeries" | "singleValue">

method computeYAxis

protected computeYAxis(): undefined | YAxis | Promise<YAxis> | OutputInstance<YAxis>

method computedStacked

protected computedStacked(): boolean

method height

public height(): number

method width

public width(): number

class Metric

Metrics are the fundamental concept in CloudWatch. A metric represents a time-ordered set of data points that are published to CloudWatch. Think of a metric as a variable to monitor, and the data points as representing the values of that variable over time. For example, the CPU usage of a particular EC2 instance is one metric provided by Amazon EC2. The data points themselves can come from any application or business activity from which you collect data.

AWS services send metrics to CloudWatch, and you can send your own custom metrics to CloudWatch. You can add the data points in any order, and at any rate you choose. You can retrieve statistics about those data points as an ordered set of time-series data.

Metrics exist only in the region in which they are created. Metrics cannot be deleted, but they automatically expire after 15 months if no new data is published to them. Data points older than 15 months expire on a rolling basis; as new data points come in, data older than 15 months is dropped.

Metrics are uniquely defined by a name, a namespace, and zero or more dimensions. Each data point in a metric has a time stamp, and (optionally) a unit of measure. You can retrieve statistics from CloudWatch for any metric.

see https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/cloudwatch_concepts.html#Metric for more details.

constructor

new Metric(args: MetricArgs, resource?: pulumi.Resource)
  • resource Optional resource this is a metric for. This is only used for parenting purposes. i.e. if an [Alarm] is created from this [Metric], then [resource] will be used as the parent of the alarm by default.

method addWidgetJson

public addWidgetJson(metrics: wjson.MetricJson[]): void

For internal use only.

method createAlarm

public createAlarm(name: string, args: AlarmArgs, opts: pulumi.CustomResourceOptions): MetricAlarm

method with

public with(change: MetricChange | undefined): Metric

method withColor

public withColor(color: pulumi.Input<string> | undefined): Metric

method withDimensions

public withDimensions(dimensions: pulumi.Input<Record<string, any>> | undefined): Metric

Produces a new [Metric] instances with the specific [dimensions] of this instance overwritten with the [dimensions] pass in as arguments. Because this is a merging, to unset a particular dimension, pass in an explicit value of { name: undefined }. To clear all dimensions, pass in undefined for the entire argument.

method withExtendedStatistic

public withExtendedStatistic(extendedStatistic: pulumi.Input<number> | undefined): Metric

method withLabel

public withLabel(label: pulumi.Input<string> | undefined): Metric

method withPeriod

public withPeriod(period: pulumi.Input<number> | undefined): Metric

method withStatistic

public withStatistic(statistic: pulumi.Input<MetricStatistic> | undefined): Metric

method withUnit

public withUnit(unit: pulumi.Input<MetricUnit> | undefined): Metric

method withVisible

public withVisible(visible: pulumi.Input<boolean> | undefined): Metric

method withYAxis

public withYAxis(yAxis: pulumi.Input<"left" | "right"> | undefined): Metric

property color

public color: pulumi.Output<string | undefined>;

The six-digit HTML hex color code to be used for this metric.

Only used if this metric is displayed in a [Dashboard] with a [MetricWidget].

property dimensions

public dimensions: pulumi.Output<Record<string, any> | undefined>;

The dimensions for this metric. For the list of available dimensions see the AWS documentation here.

property extendedStatistic

public extendedStatistic: pulumi.Output<number | undefined>;

The percentile statistic for the metric associated with the alarm. Specify a value between [0.0] and [100].

property label

public label: pulumi.Output<string | undefined>;

The label to display for this metric in the graph legend. If this is not specified, the metric is given an autogenerated label that distinguishes it from the other metrics in the widget.

Only used if this metric is displayed in a [Dashboard] with a [MetricWidget].

property name

public name: pulumi.Output<string>;

The name for this metric. See docs for supported metrics.

property namespace

public namespace: pulumi.Output<string>;

The namespace for this metric. See docs for the list of namespaces. See docs for supported metrics.

property period

public period: pulumi.Output<number>;

The period in seconds over which the specified [statistic] is applied. Must be in multiples of 60. Periods are defined in numbers of seconds, and valid values for period are 1, 5, 10, 30, or any multiple of 60. For example, to specify a period of six minutes, use 360 as the period value. You can adjust how the data is aggregated by varying the length of the period. A period can be as short as one second or as long as one day (86,400 seconds). The default value is 60 seconds.

See https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/cloudwatch_concepts.html for more details.

property resource

public resource: pulumi.Resource | undefined;

Optional resource this is a metric for. Used only for parenting purposes when making new alarms.

property statistic

public statistic: pulumi.Output<MetricStatistic>;

The statistic to apply to the alarm’s associated metric. Either of the following is supported: SampleCount, Average, Sum, Minimum, Maximum.

Defaults to [Average] if [statistic] and [extendedStatistic] is unspecified.

property unit

public unit: pulumi.Output<MetricUnit | undefined>;

The unit for this metric.

See https://docs.aws.amazon.com/AmazonCloudWatch/latest/APIReference/API_MetricDatum.html

property visible

public visible: pulumi.Output<boolean>;

Set this to true to have the metric appear in the graph, or false to have it be hidden. The default is true.

Only used if this metric is displayed in a [Dashboard] with a [MetricWidget].

property yAxis

public yAxis: pulumi.Output<"left" | "right">;

Where on the graph to display the y-axis for this metric. The default is left.

Only used if this metric is displayed in a [Dashboard] with a [MetricWidget].

class MetricWidget

extends SimpleWidget
implements Widget

Base type for widgets that display data from a set of [Metric]s. See [LineGraphMetricWidget], [StackedAreaGraphMetricWidget] and [SingleNumberMetricWidget] as concrete [Widget] instances for displaying [Metric]s.

constructor

new MetricWidget(metricArgs: MetricWidgetArgs)

method addWidgetJson

public addWidgetJson(widgetJsons: wjson.WidgetJson[], xOffset: number, yOffset: number): void

For internal use only.

method computeProperties

protected computeProperties(): MetricWidgetPropertiesJson | Promise<MetricWidgetPropertiesJson> | OutputInstance<MetricWidgetPropertiesJson>

method computeType

protected computeType(): "metric" | Promise<"metric"> | OutputInstance<"metric">

method computeView

protected computeView(): undefined | "timeSeries" | "singleValue" | Promise<undefined | "timeSeries" | "singleValue"> | OutputInstance<undefined | "timeSeries" | "singleValue">

method computeYAxis

protected computeYAxis(): undefined | YAxis | Promise<YAxis> | OutputInstance<YAxis>

method computedStacked

protected computedStacked(): undefined | false | true | Promise<undefined | false | true> | OutputInstance<undefined | false | true>

method height

public height(): number

method width

public width(): number

class RowWidget

extends FlowWidget
implements Widget

Represents a horizontal sequence of [Widget]s in the [Dashboard]. Widgets are laid out horizontally in the grid until it would go past the max width of 24 columns. When that happens, the widgets will wrap to the next available grid row.

Rows must start in the leftmost grid column.

The final width of this widget will be the furthest column that a widget is placed at prior to wrapping. The final height of this widget will be the bottommost row that a widget is placed at.

constructor

new RowWidget(widgets: Widget[])

method addWidget

public addWidget(widget: Widget): void

method addWidgetJson

public addWidgetJson(widgetJsons: WidgetJson[], xOffset: number, yOffset: number): void

For internal use only.

method getWidgetRelativePositions

protected getWidgetRelativePositions(): Map<Widget, WidgetRelativePosition>

method height

public height(): number

method width

public width(): number

property widgets

protected widgets: Widget[] =  [];

class SimpleWidget

implements Widget

Base type of all non-flow Widgets to place in a DashboardGrid.

constructor

new SimpleWidget(args: SimpleWidgetArgs)

method addWidgetJson

public addWidgetJson(widgetJsons: wjson.WidgetJson[], xOffset: number, yOffset: number): void

For internal use only.

method computeProperties

method computeType

method height

public height(): number

method width

public width(): number

class SingleNumberMetricWidget

extends MetricWidget
implements Widget

Displays a set of metrics as a single number.

constructor

new SingleNumberMetricWidget(args: MetricWidgetArgs)

method addWidgetJson

public addWidgetJson(widgetJsons: wjson.WidgetJson[], xOffset: number, yOffset: number): void

For internal use only.

method computeProperties

protected computeProperties(): MetricWidgetPropertiesJson | Promise<MetricWidgetPropertiesJson> | OutputInstance<MetricWidgetPropertiesJson>

method computeType

protected computeType(): "metric" | Promise<"metric"> | OutputInstance<"metric">

method computeView

protected computeView(): undefined | "timeSeries" | "singleValue" | Promise<undefined | "timeSeries" | "singleValue"> | OutputInstance<undefined | "timeSeries" | "singleValue">

method computeYAxis

protected computeYAxis(): undefined | YAxis | Promise<YAxis> | OutputInstance<YAxis>

method computedStacked

protected computedStacked(): boolean

method height

public height(): number

method width

public width(): number

class SpaceWidget

implements Widget

Simple [Widget] that can be used for putting space between other widgets in the [Dashboard].

constructor

new SpaceWidget(width: number, height: number)
new SpaceWidget(args: SimpleWidgetArgs)

method addWidgetJson

public addWidgetJson(widgetJsons: wjson.WidgetJson[], xOffset: number, yOffset: number): void

method height

public height(): number

method width

public width(): number

class StackedAreaGraphMetricWidget

extends GraphMetricWidget
implements Widget

Displays a set of metrics as a stacked area graph.

constructor

new StackedAreaGraphMetricWidget(args: GraphMetricWidgetArgs)

method addWidgetJson

public addWidgetJson(widgetJsons: wjson.WidgetJson[], xOffset: number, yOffset: number): void

For internal use only.

method computeProperties

protected computeProperties(): MetricWidgetPropertiesJson | Promise<MetricWidgetPropertiesJson> | OutputInstance<MetricWidgetPropertiesJson>

method computeType

protected computeType(): "metric" | Promise<"metric"> | OutputInstance<"metric">

method computeView

protected computeView(): undefined | "timeSeries" | "singleValue" | Promise<undefined | "timeSeries" | "singleValue"> | OutputInstance<undefined | "timeSeries" | "singleValue">

method computeYAxis

protected computeYAxis(): undefined | YAxis | Promise<YAxis> | OutputInstance<YAxis>

method computedStacked

protected computedStacked(): boolean

method height

public height(): number

method width

public width(): number

class TextWidget

extends SimpleWidget
implements Widget

Simple widget that displays a piece of text in the dashboard grid.

constructor

new TextWidget(markdown: string)
new TextWidget(args: TextWidgetArgs)

method addWidgetJson

public addWidgetJson(widgetJsons: wjson.WidgetJson[], xOffset: number, yOffset: number): void

For internal use only.

method computeProperties

protected computeProperties(): {
    markdown: pulumi.Input<string>;
} | Promise<{
    markdown: pulumi.Input<string>;
}> | OutputInstance<{
    markdown: pulumi.Input<string>;
}>

method computeType

protected computeType(): "text" | Promise<"text"> | OutputInstance<"text">

method height

public height(): number

method width

public width(): number

class VerticalAnnotation

implements WidgetAnnotation

Vertical annotations have several options for fill shading, including shading before the annotation line, shading after the annotation line, and “band” shading that appears between two linked annotation lines as part of a single band annotation

constructor

new VerticalAnnotation(args: VerticalAnnotationArgs)

method addWidgetJson

public addWidgetJson(annotations: wjson.MetricWidgetAnnotationsJson): void

For internal use only.

function getDashboardBody

function mergeDimensions

function statisticString

interface AlarmArgs

property actionsEnabled

actionsEnabled?: pulumi.Input<boolean>;

Indicates whether or not actions should be executed during any changes to the alarm’s state. Defaults to true.

property alarmActions

alarmActions?: pulumi.Input<pulumi.Input<string | aws.sns.Topic>[]>;

The list of actions to execute when this alarm transitions into an ALARM state from any other state. Each action is specified as an Amazon Resource Name (ARN).

property alarmDescription

alarmDescription?: pulumi.Input<string>;

The description for the alarm.

property comparisonOperator

comparisonOperator?: pulumi.Input<AlarmComparisonOperator>;

The arithmetic operation to use when comparing the specified Statistic and Threshold. The specified Statistic value is used as the first operand. Either of the following is supported: GreaterThanOrEqualToThreshold, GreaterThanThreshold, LessThanThreshold, LessThanOrEqualToThreshold.

Defaults to [GreaterThanOrEqualToThreshold] if unspecified.

property datapointsToAlarm

datapointsToAlarm?: pulumi.Input<number>;

The number of datapoints that must be breaching to trigger the alarm.

property evaluateLowSampleCountPercentiles

evaluateLowSampleCountPercentiles?: pulumi.Input<"ignore" | "evaluate">;

Used only for alarms based on percentiles. If you specify ignore, the alarm state will not change during periods with too few data points to be statistically significant. If you specify evaluate or omit this parameter, the alarm will always be evaluated and possibly change state no matter how many data points are available. The following values are supported: ignore, and evaluate.

property evaluationPeriods

evaluationPeriods: pulumi.Input<number>;

The number of periods over which data is compared to the specified threshold.

property extendedStatistic

extendedStatistic?: pulumi.Input<string>;

The percentile statistic for the metric associated with the alarm. Specify a value between p0.0 and p100.

property insufficientDataActions

insufficientDataActions?: pulumi.Input<pulumi.Input<string | aws.sns.Topic>[]>;

The list of actions to execute when this alarm transitions into an INSUFFICIENT_DATA state from any other state. Each action is specified as an Amazon Resource Name (ARN).

property metricQueries

metricQueries?: pulumi.Input<pulumi.Input<{
    expression: pulumi.Input<string>;
    id: pulumi.Input<string>;
    label: pulumi.Input<string>;
    metric: pulumi.Input<{
        dimensions: pulumi.Input<{[key: string]: any}>;
        metricName: pulumi.Input<string>;
        namespace: pulumi.Input<string>;
        period: pulumi.Input<number>;
        stat: pulumi.Input<string>;
        unit: pulumi.Input<string>;
    }>;
    returnData: pulumi.Input<boolean>;
}>[]>;

Enables you to create an alarm based on a metric math expression. You may specify at most 20.

property name

name?: pulumi.Input<string>;

The descriptive name for the alarm. This name must be unique within the user’s AWS account

property okActions

okActions?: pulumi.Input<pulumi.Input<string | aws.sns.Topic>[]>;

The list of actions to execute when this alarm transitions into an OK state from any other state. Each action is specified as an Amazon Resource Name (ARN).

property threshold

threshold: pulumi.Input<number>;

The value against which the specified statistic is compared.

property treatMissingData

treatMissingData?: pulumi.Input<"missing" | "ignore" | "breaching" | "notBreaching">;

Sets how this alarm is to handle missing data points. The following values are supported: missing, ignore, breaching and notBreaching. Defaults to missing.

interface DashboardArgs

property end

end?: pulumi.Input<string>;

The end of the time range to use for each widget on the dashboard when the dashboard loads. If you specify a value for end, you must also specify a value for start. For each of these values, specify an absolute time in the ISO 8601 format. For example, 2018-12-17T06:00:00.000Z.

property name

name?: pulumi.Input<string>;

The name of the dashboard.

property periodOverride

periodOverride?: pulumi.Input<"auto" | "inherit">;

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.

property start

start?: pulumi.Input<string>;

The start of the time range to use for each widget on the dashboard.

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.

If you omit start, the dashboard shows the default time range when it loads.

property widgets

widgets?: Widget[];

Widgets to initially add to the [DashboardDescription]. If any of these are [RowWidgets] this will be treated as a sequence of rows. If not, then this will be treated as a sequence of widgets to make a single row out of.

interface GraphMetricWidgetArgs

extends MetricWidgetArgs

property alarm

alarm?: pulumi.Input<string> | WidgetAlarm;

Used to show a graph of a single alarm. If, instead, you want to place horizontal lines in graphs to show the trigger point of an alarm, then add the alarm to [annotations] instead.

At least one of [alarm], [annotations] or [metrics] must be supplied.

property annotations

annotations?: WidgetAnnotation | WidgetAnnotation[];

A single metric widget can have up to one alarm, and multiple horizontal and vertical annotations.

An alarm annotation is required only when metrics is not specified. A horizontal or vertical annotation is not required.

Instances of this interface include [aws.cloudwatch.Alarm], [AlarmAnnotation], [HorizontalAnnotation] and [VerticalAnnotation].

At least one of [alarm], [annotations] or [metrics] must be supplied.

property extendedStatistic

extendedStatistic?: pulumi.Input<number>;

The percentile statistic for the metric associated with the alarm. Specify a value between [0.0] and [100].

property height

height?: undefined | number;

The height of the widget in grid units. The default is 6.

Valid Values: 1–1000

property metrics

metrics?: WidgetMetric | WidgetMetric[];

Specify a metrics array to include one or more metrics (without alarms), math expressions, or search expressions. One metrics array can include 0–100 metrics and expressions.

See [ExpressionWidgetMetric] and [Metric] to create instances that can be added to this array.

At least one of [alarm], [annotations] or [metrics] must be supplied.

property period

period?: pulumi.Input<number>;

The default period, in seconds, for all metrics in this widget. The period is the length of time represented by one data point on the graph. This default can be overridden within each metric definition. The default is 300.

property region

region?: pulumi.Input<aws.Region>;

The region of the metric. Defaults to the region of the stack if not specified.

property statistic

statistic?: pulumi.Input<MetricStatistic>;

The default statistic to be displayed for each metric in the array. This default can be overridden within the definition of each individual metric in the metrics array.

property title

title?: pulumi.Input<string>;

The title to be displayed for the graph or number.

property width

width?: undefined | number;

The width of the widget in grid units (in a 24-column grid). The default is 6.

Valid Values: 1–24

property yAxis

yAxis?: pulumi.Input<YAxis>;

Limits for the minimums and maximums of the y-axis. This applies to every metric being graphed, unless specific metrics override it.

interface HorizontalAlarmAnnotationArgs

interface HorizontalAnnotationArgs

property aboveEdge

aboveEdge: HorizontalEdge;

The metric value in the graph where the horizontal annotation line is to appear. If [belowEdge] is also provided, then this will produce a band annotation. In that case [fill] should not be provided.

property belowEdge

belowEdge?: HorizontalEdge;

The lower edge when using band shading.

property color

color?: undefined | string;

The six-digit HTML hex color code to be used for the annotation. This color is used for both the annotation line and the fill shading.

property fill

fill?: "above" | "below";

How to use fill shading with the annotation. Valid values are above for shading above the annotation, below for shading below the annotation. If fill is omitted, there is no shading.

The exception is an annotation with band shading (in which case [lowerEdge] is provided). These annotations always have shading between the two values, and any value for fill is ignored.

property visible

visible?: undefined | false | true;

Set this to true to have the annotation appear in the graph, or false to have it be hidden. The default is true.

property yAxis

yAxis?: "left" | "right";

If the graph includes multiple metrics, specifies whether the numbers in Value refer to the metric associated with the left Y-axis or the right Y-axis, . Valid values are right and left.

interface HorizontalEdge

property label

label?: pulumi.Input<string | undefined>;

A string that appears on the graph next to the annotation.

property value

value: pulumi.Input<number>;

The metric value in the graph where the horizontal annotation line is to appear. On a band shading annotation, the two values for Value define the upper and lower edges of the band.

On a graph with horizontal annotations, the graph is scaled so that all visible horizontal annotations appear on the graph.

interface MetricArgs

property color

color?: pulumi.Input<string | undefined>;

The six-digit HTML hex color code to be used for this metric.

Only used if this metric is displayed in a [Dashboard] with a [MetricWidget].

property dimensions

dimensions?: pulumi.Input<Record<string, any> | undefined>;

The dimensions for this metric. For the list of available dimensions see the AWS documentation here.

property extendedStatistic

extendedStatistic?: pulumi.Input<number | undefined>;

The percentile statistic for the metric associated with the alarm. Specify a value between [0.0] and [100].

property label

label?: pulumi.Input<string | undefined>;

The label to display for this metric in the graph legend. If this is not specified, the metric is given an autogenerated label that distinguishes it from the other metrics in the widget.

Only used if this metric is displayed in a [Dashboard] with a [MetricWidget].

property name

name: pulumi.Input<string>;

The name for this metric. See docs for supported metrics.

property namespace

namespace: pulumi.Input<string>;

The namespace for this metric. See docs for the list of namespaces. See docs for supported metrics.

property period

period?: pulumi.Input<number | undefined>;

The period in seconds over which the specified stat is applied. Must be in multiples of 60. Default to [300] if unspecified.

property statistic

statistic?: pulumi.Input<MetricStatistic | undefined>;

The statistic to apply to the alarm’s associated metric. Either of the following is supported: SampleCount, Average, Sum, Minimum, Maximum

property unit

unit?: pulumi.Input<MetricUnit | undefined>;

The unit for this metric.

See https://docs.aws.amazon.com/AmazonCloudWatch/latest/APIReference/API_MetricDatum.html

property visible

visible?: pulumi.Input<boolean | undefined>;

Set this to true to have the metric appear in the graph, or false to have it be hidden. The default is true.

Only used if this metric is displayed in a [Dashboard] with a [MetricWidget].

property yAxis

yAxis?: pulumi.Input<"left" | "right" | undefined>;

Where on the graph to display the y-axis for this metric. The default is left.

Only used if this metric is displayed in a [Dashboard] with a [MetricWidget].

interface MetricChange

Interface for all the parts of a metric that can be changed.

property color

color?: pulumi.Input<string>;

The six-digit HTML hex color code to be used for this metric.

Only used if this metric is displayed in a [Dashboard] with a [MetricWidget].

property dimensions

dimensions?: pulumi.Input<Record<string, any>>;

The new dimension for this metric. If this object is missing this property, then no change will be made. However, if the property is there by set to [undefined] then the value will be cleared.

property extendedStatistic

extendedStatistic?: pulumi.Input<number>;

The new percentile statistic for the metric associated with the alarm. If this object is missing this property, then no change will be made. However, if the property is there by set to [undefined] then the value will be set to the default.

property label

label?: pulumi.Input<string>;

The label to display for this metric in the graph legend. If this is not specified, the metric is given an autogenerated label that distinguishes it from the other metrics in the widget.

Only used if this metric is displayed in a [Dashboard] with a [MetricWidget].

property period

period?: pulumi.Input<number>;

The new period in seconds over which the specified stat is applied. If this object is missing this property, then no change will be made. However, if the property is there by set to [undefined] then the value will be set to the default (300s).

property statistic

statistic?: pulumi.Input<MetricStatistic>;

The new statistic to apply to the alarm’s associated metric. If this object is missing this property, then no change will be made. However, if the property is there by set to [undefined] then the value will be set to the default.

property unit

unit?: pulumi.Input<MetricUnit>;

The new unit for this metric. If this object is missing this property, then no change will be made. However, if the property is there by set to [undefined] then the value will be set to the default.

property visible

visible?: pulumi.Input<boolean>;

Set this to true to have the metric appear in the graph, or false to have it be hidden. The default is true.

Only used if this metric is displayed in a [Dashboard] with a [MetricWidget].

property yAxis

yAxis?: pulumi.Input<"left" | "right">;

Where on the graph to display the y-axis for this metric. The default is left.

Only used if this metric is displayed in a [Dashboard] with a [MetricWidget].

interface MetricWidgetArgs

extends SimpleWidgetArgs

property alarm

alarm?: pulumi.Input<string> | WidgetAlarm;

Used to show a graph of a single alarm. If, instead, you want to place horizontal lines in graphs to show the trigger point of an alarm, then add the alarm to [annotations] instead.

At least one of [alarm], [annotations] or [metrics] must be supplied.

property annotations

annotations?: WidgetAnnotation | WidgetAnnotation[];

A single metric widget can have up to one alarm, and multiple horizontal and vertical annotations.

An alarm annotation is required only when metrics is not specified. A horizontal or vertical annotation is not required.

Instances of this interface include [aws.cloudwatch.Alarm], [AlarmAnnotation], [HorizontalAnnotation] and [VerticalAnnotation].

At least one of [alarm], [annotations] or [metrics] must be supplied.

property extendedStatistic

extendedStatistic?: pulumi.Input<number>;

The percentile statistic for the metric associated with the alarm. Specify a value between [0.0] and [100].

property height

height?: undefined | number;

The height of the widget in grid units. The default is 6.

Valid Values: 1–1000

property metrics

metrics?: WidgetMetric | WidgetMetric[];

Specify a metrics array to include one or more metrics (without alarms), math expressions, or search expressions. One metrics array can include 0–100 metrics and expressions.

See [ExpressionWidgetMetric] and [Metric] to create instances that can be added to this array.

At least one of [alarm], [annotations] or [metrics] must be supplied.

property period

period?: pulumi.Input<number>;

The default period, in seconds, for all metrics in this widget. The period is the length of time represented by one data point on the graph. This default can be overridden within each metric definition. The default is 300.

property region

region?: pulumi.Input<aws.Region>;

The region of the metric. Defaults to the region of the stack if not specified.

property statistic

statistic?: pulumi.Input<MetricStatistic>;

The default statistic to be displayed for each metric in the array. This default can be overridden within the definition of each individual metric in the metrics array.

property title

title?: pulumi.Input<string>;

The title to be displayed for the graph or number.

property width

width?: undefined | number;

The width of the widget in grid units (in a 24-column grid). The default is 6.

Valid Values: 1–24

interface MinMax

property max

max?: undefined | number;

The maximum value for this Y-axis

property min

min?: undefined | number;

The minimum value for this Y-axis

interface SimpleWidgetArgs

property height

height?: undefined | number;

The height of the widget in grid units. The default is 6.

Valid Values: 1–1000

property width

width?: undefined | number;

The width of the widget in grid units (in a 24-column grid). The default is 6.

Valid Values: 1–24

interface TextWidgetArgs

extends SimpleWidgetArgs

property height

height?: undefined | number;

The height of the widget in grid units. The default is 6.

Valid Values: 1–1000

property markdown

markdown: pulumi.Input<string>;

The text to be displayed by the widget.

property width

width?: undefined | number;

The width of the widget in grid units (in a 24-column grid). The default is 6.

Valid Values: 1–24

interface VerticalAnnotationArgs

For each vertical annotation, you can choose to have fill shading before the annotation, after it, or between two vertical lines that are linked as a single band annotation.

property afterEdge

afterEdge?: VerticalEdge;

The ending edge when using band shading.

property beforeEdge

beforeEdge: VerticalEdge;

The metric value in the graph where the vertical annotation line is to appear. If [endEdge] is also provided, then this will produce a band annotation. In that case [fill] should not be provided.

property color

color?: undefined | string;

The six-digit HTML hex color code to be used for the annotation. This color is used for both the annotation line and the fill shading.

property fill

fill?: "before" | "after";

How to use fill shading with the annotation. Valid values are before for shading before the annotation, after for shading after the annotation. If fill is omitted, there is no shading.

The exception is an annotation with band shading. These annotations always have shading between the two values, and any value for [fill] is ignored.

property visible

visible?: undefined | false | true;

Set this to true to have the annotation appear in the graph, or false to have it be hidden. The default is true.

interface VerticalEdge

property label

label?: undefined | string;

A string that appears on the graph next to the annotation.

property value

value: string;

The date and time in the graph where the vertical annotation line is to appear. On a band shading annotation, the two values for Value define the beginning and ending edges of the band.

On a graph with vertical annotations, the graph is scaled so that all visible vertical annotations appear on the graph.

This is defined as a string in ISO 8601 format. For more information, see ISO 8601.

interface Widget

Base type for all [Widget]s that can be placed in a [DashboardGrid].

  1. [RowWidget] and [ColumnWidget] can be used to easily flow other Widgets in a horizontal or vertical direction.

  2. [TextWidget] can be used to add text labels easily to the grid.

  3. [SingleNumberMetricWidget] can be used to make a widget that displays information about a [Metric] as a single number.

  4. [LineGraphMetricWidget] and [StackedAreaGraphMetricWidget] can be used to display a series of metric values as a graph.

method addWidgetJson

addWidgetJson(widgetJsons: WidgetJson[], xOffset: number, yOffset: number): void

Converts this widget to an appropriate JSON pojo. The [xOffset] and [yOffset] parameters specify where in the final [Dashboard] grid this [Widget] should be placed.

For internal use only.

method height

height(): number

The height of the widget in grid units. The default is 6.

Valid Values: 1–1000

method width

width(): number

The width of the widget in grid units (in a 24-column grid). The default is 6.

Valid Values: 1–24

Type: Integer

interface WidgetAlarm

interface WidgetAnnotation

Base interface for values that can be placed inside [MetricWidgetArgs.annotations]. Instances of this interface include [aws.cloudwatch.Alarm], [AlarmAnnotation], [HorizontalAnnotation] and [VerticalAnnotation].

method addWidgetJson

addWidgetJson(annotations: wjson.MetricWidgetAnnotationsJson): void

For internal use only. Only intended to be called by [MetricWidget].

interface WidgetMetric

Base type for all objects that can be placed in the [metrics] array of [MetricWidgetArgs].

See [ExpressionWidgetMetric] and [Metric] to create instances that can be added to [MetricWidgetArgs.metrics].

method addWidgetJson

addWidgetJson(metrics: wjson.MetricJson[]): void

For internal use only. Only intended to be called by [MetricWidget].

interface YAxis

property left

left?: MinMax;

Optional min and max settings for the left Y-axis.

property right

right?: MinMax;

Optional min and max settings for the right Y-axis.

module metrics

type AlarmComparisonOperator

type AlarmComparisonOperator = "GreaterThanOrEqualToThreshold" | "GreaterThanThreshold" | "LessThanThreshold" | "LessThanOrEqualToThreshold";

type MetricStatistic

type MetricStatistic = "SampleCount" | "Average" | "Sum" | "Minimum" | "Maximum";

type MetricUnit

type MetricUnit = "Seconds" | "Microseconds" | "Milliseconds" | "Bytes" | "Kilobytes" | "Megabytes" | "Gigabytes" | "Terabytes" | "Bits" | "Kilobits" | "Megabits" | "Gigabits" | "Terabits" | "Percent" | "Count" | "Bytes/Second" | "Kilobytes/Second" | "Megabytes/Second" | "Gigabytes/Second" | "Terabytes/Second" | "Bits/Second" | "Kilobits/Second" | "Megabits/Second" | "Gigabits/Second" | "Terabits/Second" | "Count/Second" | "None";