awscloudwatch

package
v2.139.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 24, 2024 License: Apache-2.0 Imports: 8 Imported by: 51

README

Amazon CloudWatch Construct Library

Metric objects

Metric objects represent a metric that is emitted by AWS services or your own application, such as CPUUsage, FailureCount or Bandwidth.

Metric objects can be constructed directly or are exposed by resources as attributes. Resources that expose metrics will have functions that look like metricXxx() which will return a Metric object, initialized with defaults that make sense.

For example, lambda.Function objects have the fn.metricErrors() method, which represents the amount of errors reported by that Lambda function:

var fn function


errors := fn.metricErrors()

Metric objects can be account and region aware. You can specify account and region as properties of the metric, or use the metric.attachTo(Construct) method. metric.attachTo() will automatically copy the region and account fields of the Construct, which can come from anywhere in the Construct tree.

You can also instantiate Metric objects to reference any published metric that's not exposed using a convenience method on the CDK construct. For example:

hostedZone := route53.NewHostedZone(this, jsii.String("MyHostedZone"), &HostedZoneProps{
	ZoneName: jsii.String("example.org"),
})
metric := cloudwatch.NewMetric(&MetricProps{
	Namespace: jsii.String("AWS/Route53"),
	MetricName: jsii.String("DNSQueries"),
	DimensionsMap: map[string]*string{
		"HostedZoneId": hostedZone.hostedZoneId,
	},
})
Instantiating a new Metric object

If you want to reference a metric that is not yet exposed by an existing construct, you can instantiate a Metric object to represent it. For example:

metric := cloudwatch.NewMetric(&MetricProps{
	Namespace: jsii.String("MyNamespace"),
	MetricName: jsii.String("MyMetric"),
	DimensionsMap: map[string]*string{
		"ProcessingStep": jsii.String("Download"),
	},
})
Metric Math

Math expressions are supported by instantiating the MathExpression class. For example, a math expression that sums two other metrics looks like this:

var fn function


allProblems := cloudwatch.NewMathExpression(&MathExpressionProps{
	Expression: jsii.String("errors + throttles"),
	UsingMetrics: map[string]iMetric{
		"errors": fn.metricErrors(),
		"throttles": fn.metricThrottles(),
	},
})

You can use MathExpression objects like any other metric, including using them in other math expressions:

var fn function
var allProblems mathExpression


problemPercentage := cloudwatch.NewMathExpression(&MathExpressionProps{
	Expression: jsii.String("(problems / invocations) * 100"),
	UsingMetrics: map[string]iMetric{
		"problems": allProblems,
		"invocations": fn.metricInvocations(),
	},
})
Search Expressions

Math expressions also support search expressions. For example, the following search expression returns all CPUUtilization metrics that it finds, with the graph showing the Average statistic with an aggregation period of 5 minutes:

cpuUtilization := cloudwatch.NewMathExpression(&MathExpressionProps{
	Expression: jsii.String("SEARCH('{AWS/EC2,InstanceId} MetricName=\"CPUUtilization\"', 'Average', 300)"),

	// Specifying '' as the label suppresses the default behavior
	// of using the expression as metric label. This is especially appropriate
	// when using expressions that return multiple time series (like SEARCH()
	// or METRICS()), to show the labels of the retrieved metrics only.
	Label: jsii.String(""),
})

Cross-account and cross-region search expressions are also supported. Use the searchAccount and searchRegion properties to specify the account and/or region to evaluate the search expression against.

Aggregation

To graph or alarm on metrics you must aggregate them first, using a function like Average or a percentile function like P99. By default, most Metric objects returned by CDK libraries will be configured as Average over 300 seconds (5 minutes). The exception is if the metric represents a count of discrete events, such as failures. In that case, the Metric object will be configured as Sum over 300 seconds, i.e. it represents the number of times that event occurred over the time period.

If you want to change the default aggregation of the Metric object (for example, the function or the period), you can do so by passing additional parameters to the metric function call:

var fn function


minuteErrorRate := fn.metricErrors(&MetricOptions{
	Statistic: cloudwatch.Stats_AVERAGE(),
	Period: awscdk.Duration_Minutes(jsii.Number(1)),
	Label: jsii.String("Lambda failure rate"),
})

The statistic field accepts a string; the cloudwatch.Stats object has a number of predefined factory functions that help you constructs strings that are appropriate for CloudWatch. The metricErrors function also allows changing the metric label or color, which will be useful when embedding them in graphs (see below).

Rates versus Sums

The reason for using Sum to count discrete events is that some events are emitted as either 0 or 1 (for example Errors for a Lambda) and some are only emitted as 1 (for example NumberOfMessagesPublished for an SNS topic).

In case 0-metrics are emitted, it makes sense to take the Average of this metric: the result will be the fraction of errors over all executions.

If 0-metrics are not emitted, the Average will always be equal to 1, and not be very useful.

In order to simplify the mental model of Metric objects, we default to aggregating using Sum, which will be the same for both metrics types. If you happen to know the Metric you want to alarm on makes sense as a rate (Average) you can always choose to change the statistic.

Available Aggregation Statistics

For your metrics aggregation, you can use the following statistics:

Statistic Short format Long format Factory name
SampleCount (n) Stats.SAMPLE_COUNT
Average (avg) Stats.AVERAGE
Sum Stats.SUM
Minimum (min) Stats.MINIMUM
Maximum (max) Stats.MAXIMUM
Interquartile mean (IQM) Stats.IQM
Percentile (p) p99 Stats.p(99)
Winsorized mean (WM) wm99 = WM(:99%) WM(x:y) | WM(x%:y%) | WM(x%:) | WM(:y%) Stats.wm(10, 90)
Trimmed count (TC) tc99 = TC(:99%) TC(x:y) | TC(x%:y%) | TC(x%:) | TC(:y%) Stats.tc(10, 90)
Trimmed sum (TS) ts99 = TS(:99%) TS(x:y) | TS(x%:y%) | TS(x%:) | TS(:y%) Stats.ts(10, 90)
Percentile rank (PR) PR(x:y) | PR(x:) | PR(:y) Stats.pr(10, 5000)

The most common values are provided in the cloudwatch.Stats class. You can provide any string if your statistic is not in the class.

Read more at CloudWatch statistics definitions.

var hostedZone hostedZone


cloudwatch.NewMetric(&MetricProps{
	Namespace: jsii.String("AWS/Route53"),
	MetricName: jsii.String("DNSQueries"),
	DimensionsMap: map[string]*string{
		"HostedZoneId": hostedZone.hostedZoneId,
	},
	Statistic: cloudwatch.Stats_SAMPLE_COUNT(),
	Period: awscdk.Duration_Minutes(jsii.Number(5)),
})

cloudwatch.NewMetric(&MetricProps{
	Namespace: jsii.String("AWS/Route53"),
	MetricName: jsii.String("DNSQueries"),
	DimensionsMap: map[string]*string{
		"HostedZoneId": hostedZone.hostedZoneId,
	},
	Statistic: cloudwatch.Stats_P(jsii.Number(99)),
	Period: awscdk.Duration_*Minutes(jsii.Number(5)),
})

cloudwatch.NewMetric(&MetricProps{
	Namespace: jsii.String("AWS/Route53"),
	MetricName: jsii.String("DNSQueries"),
	DimensionsMap: map[string]*string{
		"HostedZoneId": hostedZone.hostedZoneId,
	},
	Statistic: jsii.String("TS(7.5%:90%)"),
	Period: awscdk.Duration_*Minutes(jsii.Number(5)),
})
Labels

Metric labels are displayed in the legend of graphs that include the metrics.

You can use dynamic labels to show summary information about the displayed time series in the legend. For example, if you use:

var fn function


minuteErrorRate := fn.metricErrors(&MetricOptions{
	Statistic: cloudwatch.Stats_SUM(),
	Period: awscdk.Duration_Hours(jsii.Number(1)),

	// Show the maximum hourly error count in the legend
	Label: jsii.String("[max: ${MAX}] Lambda failure rate"),
})

As the metric label, the maximum value in the visible range will be shown next to the time series name in the graph's legend.

If the metric is a math expression producing more than one time series, the maximum will be individually calculated and shown for each time series produce by the math expression.

Alarms

Alarms can be created on metrics in one of two ways. Either create an Alarm object, passing the Metric object to set the alarm on:

var fn function


cloudwatch.NewAlarm(this, jsii.String("Alarm"), &AlarmProps{
	Metric: fn.metricErrors(),
	Threshold: jsii.Number(100),
	EvaluationPeriods: jsii.Number(2),
})

Alternatively, you can call metric.createAlarm():

var fn function


fn.metricErrors().CreateAlarm(this, jsii.String("Alarm"), &CreateAlarmOptions{
	Threshold: jsii.Number(100),
	EvaluationPeriods: jsii.Number(2),
})

The most important properties to set while creating an Alarms are:

  • threshold: the value to compare the metric against.
  • comparisonOperator: the comparison operation to use, defaults to metric >= threshold.
  • evaluationPeriods: how many consecutive periods the metric has to be breaching the threshold for the alarm to trigger.

To create a cross-account alarm, make sure you have enabled cross-account functionality in CloudWatch. Then, set the account property in the Metric object either manually or via the metric.attachTo() method.

Please note that it is not possible to:

Alarm Actions

To add actions to an alarm, use the integration classes from the aws-cdk-lib/aws-cloudwatch-actions package. For example, to post a message to an SNS topic when an alarm breaches, do the following:

import cw_actions "github.com/aws/aws-cdk-go/awscdk"
var alarm alarm


topic := sns.NewTopic(this, jsii.String("Topic"))
alarm.AddAlarmAction(cw_actions.NewSnsAction(topic))
Notification formats

Alarms can be created in one of two "formats":

  • With "top-level parameters" (these are the classic style of CloudWatch Alarms).
  • With a list of metrics specifications (these are the modern style of CloudWatch Alarms).

For backwards compatibility, CDK will try to create classic, top-level CloudWatch alarms as much as possible, unless you are using features that cannot be expressed in that format. Features that require the new-style alarm format are:

  • Metric math
  • Cross-account metrics
  • Labels

The difference between these two does not impact the functionality of the alarm in any way, except that the format of the notifications the Alarm generates is different between them. This affects both the notifications sent out over SNS, as well as the EventBridge events generated by this Alarm. If you are writing code to consume these notifications, be sure to handle both formats.

Composite Alarms

Composite Alarms can be created from existing Alarm resources.

var alarm1 alarm
var alarm2 alarm
var alarm3 alarm
var alarm4 alarm


alarmRule := cloudwatch.AlarmRule_AnyOf(cloudwatch.AlarmRule_AllOf(cloudwatch.AlarmRule_AnyOf(alarm1, cloudwatch.AlarmRule_FromAlarm(alarm2, cloudwatch.AlarmState_OK), alarm3), cloudwatch.AlarmRule_Not(cloudwatch.AlarmRule_FromAlarm(alarm4, cloudwatch.AlarmState_INSUFFICIENT_DATA))), cloudwatch.AlarmRule_FromBoolean(jsii.Boolean(false)))

cloudwatch.NewCompositeAlarm(this, jsii.String("MyAwesomeCompositeAlarm"), &CompositeAlarmProps{
	AlarmRule: AlarmRule,
})
Actions Suppressor

If you want to disable actions of a Composite Alarm based on a certain condition, you can use Actions Suppression.

var alarm1 alarm
var alarm2 alarm
var onAlarmAction iAlarmAction
var onOkAction iAlarmAction
var actionsSuppressor alarm


alarmRule := cloudwatch.AlarmRule_AnyOf(alarm1, alarm2)

myCompositeAlarm := cloudwatch.NewCompositeAlarm(this, jsii.String("MyAwesomeCompositeAlarm"), &CompositeAlarmProps{
	AlarmRule: AlarmRule,
	ActionsSuppressor: ActionsSuppressor,
})
myCompositeAlarm.AddAlarmAction(onAlarmAction)
myCompositeAlarm.AddOkAction(onOkAction)

In the provided example, if actionsSuppressor is in ALARM state, onAlarmAction won't be triggered even if myCompositeAlarm goes into ALARM state. Similar, if actionsSuppressor is in ALARM state and myCompositeAlarm goes from ALARM into OK state, onOkAction won't be triggered.

A note on units

In CloudWatch, Metrics datums are emitted with units, such as seconds or bytes. When Metric objects are given a unit attribute, it will be used to filter the stream of metric datums for datums emitted using the same unit attribute.

In particular, the unit field is not used to rescale datums or alarm threshold values (for example, it cannot be used to specify an alarm threshold in Megabytes if the metric stream is being emitted as bytes).

You almost certainly don't want to specify the unit property when creating Metric objects (which will retrieve all datums regardless of their unit), unless you have very specific requirements. Note that in any case, CloudWatch only supports filtering by unit for Alarms, not in Dashboard graphs.

Please see the following GitHub issue for a discussion on real unit calculations in CDK: https://github.com/aws/aws-cdk/issues/5595

Dashboards

Dashboards are set of Widgets stored server-side which can be accessed quickly from the AWS console. Available widgets are graphs of a metric over time, the current value of a metric, or a static piece of Markdown which explains what the graphs mean.

The following widgets are available:

  • GraphWidget -- shows any number of metrics on both the left and right vertical axes.
  • AlarmWidget -- shows the graph and alarm line for a single alarm.
  • SingleValueWidget -- shows the current value of a set of metrics.
  • TextWidget -- shows some static Markdown.
  • AlarmStatusWidget -- shows the status of your alarms in a grid view.
Graph widget

A graph widget can display any number of metrics on either the left or right vertical axis:

var dashboard dashboard
var executionCountMetric metric
var errorCountMetric metric


dashboard.AddWidgets(cloudwatch.NewGraphWidget(&GraphWidgetProps{
	Title: jsii.String("Executions vs error rate"),

	Left: []iMetric{
		executionCountMetric,
	},

	Right: []*iMetric{
		errorCountMetric.With(&MetricOptions{
			Statistic: cloudwatch.Stats_AVERAGE(),
			Label: jsii.String("Error rate"),
			Color: cloudwatch.Color_GREEN(),
		}),
	},
}))

Using the methods addLeftMetric() and addRightMetric() you can add metrics to a graph widget later on.

Graph widgets can also display annotations attached to the left or right y-axis or the x-axis.

var dashboard dashboard


dashboard.AddWidgets(cloudwatch.NewGraphWidget(&GraphWidgetProps{
	// ...

	LeftAnnotations: []horizontalAnnotation{
		&horizontalAnnotation{
			Value: jsii.Number(1800),
			Label: awscdk.Duration_Minutes(jsii.Number(30)).ToHumanString(),
			Color: cloudwatch.Color_RED(),
		},
		&horizontalAnnotation{
			Value: jsii.Number(3600),
			Label: jsii.String("1 hour"),
			Color: jsii.String("#2ca02c"),
		},
	},
	VerticalAnnotations: []verticalAnnotation{
		&verticalAnnotation{
			Date: jsii.String("2022-10-19T00:00:00Z"),
			Label: jsii.String("Deployment"),
			Color: cloudwatch.Color_RED(),
		},
	},
}))

The graph legend can be adjusted from the default position at bottom of the widget.

var dashboard dashboard


dashboard.AddWidgets(cloudwatch.NewGraphWidget(&GraphWidgetProps{
	// ...

	LegendPosition: cloudwatch.LegendPosition_RIGHT,
}))

The graph can publish live data within the last minute that has not been fully aggregated.

var dashboard dashboard


dashboard.AddWidgets(cloudwatch.NewGraphWidget(&GraphWidgetProps{
	// ...

	LiveData: jsii.Boolean(true),
}))

The graph view can be changed from default 'timeSeries' to 'bar' or 'pie'.

var dashboard dashboard


dashboard.AddWidgets(cloudwatch.NewGraphWidget(&GraphWidgetProps{
	// ...

	View: cloudwatch.GraphWidgetView_BAR,
}))

The start and end properties can be used to specify the time range for each graph widget independently from those of the dashboard. The parameters can be specified at GraphWidget, GaugeWidget, and SingleValueWidget.

var dashboard dashboard


dashboard.AddWidgets(cloudwatch.NewGraphWidget(&GraphWidgetProps{
	// ...

	Start: jsii.String("-P7D"),
	End: jsii.String("2018-12-17T06:00:00.000Z"),
}))
Table Widget

A TableWidget can display any number of metrics in tabular form.

var dashboard dashboard
var executionCountMetric metric


dashboard.AddWidgets(cloudwatch.NewTableWidget(&TableWidgetProps{
	Title: jsii.String("Executions"),
	Metrics: []iMetric{
		executionCountMetric,
	},
}))

The layout property can be used to invert the rows and columns of the table. The default cloudwatch.TableLayout.HORIZONTAL means that metrics are shown in rows and datapoints in columns. cloudwatch.TableLayout.VERTICAL means that metrics are shown in columns and datapoints in rows.

var dashboard dashboard


dashboard.AddWidgets(cloudwatch.NewTableWidget(&TableWidgetProps{
	// ...

	Layout: cloudwatch.TableLayout_VERTICAL,
}))

The summary property allows customizing the table to show summary columns (columns sub property), whether to make the summary columns sticky remaining in view while scrolling (sticky sub property), and to optionally only present summary columns (hideNonSummaryColumns sub property).

var dashboard dashboard


dashboard.AddWidgets(cloudwatch.NewTableWidget(&TableWidgetProps{
	// ...

	Summary: &TableSummaryProps{
		Columns: []tableSummaryColumn{
			cloudwatch.*tableSummaryColumn_AVERAGE,
		},
		HideNonSummaryColumns: jsii.Boolean(true),
		Sticky: jsii.Boolean(true),
	},
}))

The thresholds property can be used to highlight cells with a color when the datapoint value falls within the threshold.

var dashboard dashboard


dashboard.AddWidgets(cloudwatch.NewTableWidget(&TableWidgetProps{
	// ...

	Thresholds: []tableThreshold{
		cloudwatch.*tableThreshold_Above(jsii.Number(1000), cloudwatch.Color_RED()),
		cloudwatch.*tableThreshold_Between(jsii.Number(500), jsii.Number(1000), cloudwatch.Color_ORANGE()),
		cloudwatch.*tableThreshold_Below(jsii.Number(500), cloudwatch.Color_GREEN()),
	},
}))

The showUnitsInLabel property can be used to display what unit is associated with a metric in the label column.

var dashboard dashboard


dashboard.AddWidgets(cloudwatch.NewTableWidget(&TableWidgetProps{
	// ...

	ShowUnitsInLabel: jsii.Boolean(true),
}))

The fullPrecision property can be used to show as many digits as can fit in a cell, before rounding.

var dashboard dashboard


dashboard.AddWidgets(cloudwatch.NewTableWidget(&TableWidgetProps{
	// ...

	FullPrecision: jsii.Boolean(true),
}))
Gauge widget

Gauge graph requires the max and min value of the left Y axis, if no value is informed the limits will be from 0 to 100.

var dashboard dashboard
var errorAlarm alarm
var gaugeMetric metric


dashboard.AddWidgets(cloudwatch.NewGaugeWidget(&GaugeWidgetProps{
	Metrics: []iMetric{
		gaugeMetric,
	},
	LeftYAxis: &YAxisProps{
		Min: jsii.Number(0),
		Max: jsii.Number(1000),
	},
}))
Alarm widget

An alarm widget shows the graph and the alarm line of a single alarm:

var dashboard dashboard
var errorAlarm alarm


dashboard.AddWidgets(cloudwatch.NewAlarmWidget(&AlarmWidgetProps{
	Title: jsii.String("Errors"),
	Alarm: errorAlarm,
}))
Single value widget

A single-value widget shows the latest value of a set of metrics (as opposed to a graph of the value over time):

var dashboard dashboard
var visitorCount metric
var purchaseCount metric


dashboard.AddWidgets(cloudwatch.NewSingleValueWidget(&SingleValueWidgetProps{
	Metrics: []iMetric{
		visitorCount,
		purchaseCount,
	},
}))

Show as many digits as can fit, before rounding.

var dashboard dashboard


dashboard.AddWidgets(cloudwatch.NewSingleValueWidget(&SingleValueWidgetProps{
	Metrics: []iMetric{
	},

	FullPrecision: jsii.Boolean(true),
}))

Sparkline allows you to glance the trend of a metric by displaying a simplified linegraph below the value. You can't use sparkline: true together with setPeriodToTimeRange: true

var dashboard dashboard


dashboard.AddWidgets(cloudwatch.NewSingleValueWidget(&SingleValueWidgetProps{
	Metrics: []iMetric{
	},

	Sparkline: jsii.Boolean(true),
}))

Period allows you to set the default period for the widget:

var dashboard dashboard


dashboard.AddWidgets(cloudwatch.NewSingleValueWidget(&SingleValueWidgetProps{
	Metrics: []iMetric{
	},

	Period: awscdk.Duration_Minutes(jsii.Number(15)),
}))
Text widget

A text widget shows an arbitrary piece of MarkDown. Use this to add explanations to your dashboard:

var dashboard dashboard


dashboard.AddWidgets(cloudwatch.NewTextWidget(&TextWidgetProps{
	Markdown: jsii.String("# Key Performance Indicators"),
}))

Optionally set the TextWidget background to be transparent

var dashboard dashboard


dashboard.AddWidgets(cloudwatch.NewTextWidget(&TextWidgetProps{
	Markdown: jsii.String("# Key Performance Indicators"),
	Background: cloudwatch.TextWidgetBackground_TRANSPARENT,
}))
Alarm Status widget

An alarm status widget displays instantly the status of any type of alarms and gives the ability to aggregate one or more alarms together in a small surface.

var dashboard dashboard
var errorAlarm alarm


dashboard.AddWidgets(
cloudwatch.NewAlarmStatusWidget(&AlarmStatusWidgetProps{
	Alarms: []iAlarm{
		errorAlarm,
	},
}))

An alarm status widget only showing firing alarms, sorted by state and timestamp:

var dashboard dashboard
var errorAlarm alarm


dashboard.AddWidgets(cloudwatch.NewAlarmStatusWidget(&AlarmStatusWidgetProps{
	Title: jsii.String("Errors"),
	Alarms: []iAlarm{
		errorAlarm,
	},
	SortBy: cloudwatch.AlarmStatusWidgetSortBy_STATE_UPDATED_TIMESTAMP,
	States: []alarmState{
		cloudwatch.*alarmState_ALARM,
	},
}))
Query results widget

A LogQueryWidget shows the results of a query from Logs Insights:

var dashboard dashboard


dashboard.AddWidgets(cloudwatch.NewLogQueryWidget(&LogQueryWidgetProps{
	LogGroupNames: []*string{
		jsii.String("my-log-group"),
	},
	View: cloudwatch.LogQueryVisualizationType_TABLE,
	// The lines will be automatically combined using '\n|'.
	QueryLines: []*string{
		jsii.String("fields @message"),
		jsii.String("filter @message like /Error/"),
	},
}))
Custom widget

A CustomWidget shows the result of an AWS Lambda function:

var dashboard dashboard


// Import or create a lambda function
fn := lambda.Function_FromFunctionArn(dashboard, jsii.String("Function"), jsii.String("arn:aws:lambda:us-east-1:123456789012:function:MyFn"))

dashboard.AddWidgets(cloudwatch.NewCustomWidget(&CustomWidgetProps{
	FunctionArn: fn.FunctionArn,
	Title: jsii.String("My lambda baked widget"),
}))

You can learn more about custom widgets in the Amazon Cloudwatch User Guide.

Dashboard Layout

The widgets on a dashboard are visually laid out in a grid that is 24 columns wide. Normally you specify X and Y coordinates for the widgets on a Dashboard, but because this is inconvenient to do manually, the library contains a simple layout system to help you lay out your dashboards the way you want them to.

Widgets have a width and height property, and they will be automatically laid out either horizontally or vertically stacked to fill out the available space.

Widgets are added to a Dashboard by calling add(widget1, widget2, ...). Widgets given in the same call will be laid out horizontally. Widgets given in different calls will be laid out vertically. To make more complex layouts, you can use the following widgets to pack widgets together in different ways:

  • Column: stack two or more widgets vertically.
  • Row: lay out two or more widgets horizontally.
  • Spacer: take up empty space
Column widget

A column widget contains other widgets and they will be laid out in a vertical column. Widgets will be put one after another in order.

var widgetA iWidget
var widgetB iWidget


cloudwatch.NewColumn(widgetA, widgetB)

You can add a widget after object instantiation with the method addWidget(). Each new widget will be put at the bottom of the column.

Row widget

A row widget contains other widgets and they will be laid out in a horizontal row. Widgets will be put one after another in order. If the total width of the row exceeds the max width of the grid of 24 columns, the row will wrap automatically and adapt its height.

var widgetA iWidget
var widgetB iWidget


cloudwatch.NewRow(widgetA, widgetB)

You can add a widget after object instantiation with the method addWidget().

Interval duration for dashboard

Interval duration for metrics in dashboard. You can specify defaultInterval with the relative time(eg. 7 days) as Duration.days(7).

import cw "github.com/aws/aws-cdk-go/awscdk"


dashboard := cw.NewDashboard(this, jsii.String("Dash"), &DashboardProps{
	DefaultInterval: awscdk.Duration_Days(jsii.Number(7)),
})

Here, the dashboard would show the metrics for the last 7 days.

Dashboard variables

Dashboard variables are a convenient way to create flexible dashboards that display different content depending on the value of an input field within a dashboard. They create a dashboard on which it's possible to quickly switch between different Lambda functions, Amazon EC2 instances, etc.

You can learn more about Dashboard variables in the Amazon Cloudwatch User Guide

There are two types of dashboard variables available: a property variable and a pattern variable.

  • Property variables can change any JSON property in the JSON source of a dashboard like region. It can also change the dimension name for a metric.
  • Pattern variables use a regular expression pattern to change all or part of a JSON property.

A use case of a property variable is a dashboard with the ability to toggle the region property to see the same dashboard in different regions:

import "github.com/aws/aws-cdk-go/awscdk"


dashboard := cw.NewDashboard(this, jsii.String("Dash"), &DashboardProps{
	DefaultInterval: awscdk.Duration_Days(jsii.Number(7)),
	Variables: []iVariable{
		cw.NewDashboardVariable(&DashboardVariableOptions{
			Id: jsii.String("region"),
			Type: cw.VariableType_PROPERTY,
			Label: jsii.String("Region"),
			InputType: cw.VariableInputType_RADIO,
			Value: jsii.String("region"),
			Values: cw.Values_FromValues(&VariableValue{
				Label: jsii.String("IAD"),
				Value: jsii.String("us-east-1"),
			}, &VariableValue{
				Label: jsii.String("DUB"),
				Value: jsii.String("us-west-2"),
			}),
			DefaultValue: cw.DefaultValue_Value(jsii.String("us-east-1")),
			Visible: jsii.Boolean(true),
		}),
	},
})

This example shows how to change region everywhere, assuming the current dashboard is showing region us-east-1 already, by using pattern variable

import "github.com/aws/aws-cdk-go/awscdk"


dashboard := cw.NewDashboard(this, jsii.String("Dash"), &DashboardProps{
	DefaultInterval: awscdk.Duration_Days(jsii.Number(7)),
	Variables: []iVariable{
		cw.NewDashboardVariable(&DashboardVariableOptions{
			Id: jsii.String("region2"),
			Type: cw.VariableType_PATTERN,
			Label: jsii.String("RegionPattern"),
			InputType: cw.VariableInputType_INPUT,
			Value: jsii.String("us-east-1"),
			DefaultValue: cw.DefaultValue_Value(jsii.String("us-east-1")),
			Visible: jsii.Boolean(true),
		}),
	},
})

The following example generates a Lambda function variable, with a radio button for each function. Functions are discovered by a metric query search. The values with cw.Values.fromSearchComponents indicates that the values will be populated from FunctionName values retrieved from the search expression {AWS/Lambda,FunctionName} MetricName=\"Duration\". The defaultValue with cw.DefaultValue.FIRST indicates that the default value will be the first value returned from the search.

import "github.com/aws/aws-cdk-go/awscdk"


dashboard := cw.NewDashboard(this, jsii.String("Dash"), &DashboardProps{
	DefaultInterval: awscdk.Duration_Days(jsii.Number(7)),
	Variables: []iVariable{
		cw.NewDashboardVariable(&DashboardVariableOptions{
			Id: jsii.String("functionName"),
			Type: cw.VariableType_PATTERN,
			Label: jsii.String("Function"),
			InputType: cw.VariableInputType_RADIO,
			Value: jsii.String("originalFuncNameInDashboard"),
			// equivalent to cw.Values.fromSearch('{AWS/Lambda,FunctionName} MetricName=\"Duration\"', 'FunctionName')
			Values: cw.Values_FromSearchComponents(&SearchComponents{
				Namespace: jsii.String("AWS/Lambda"),
				Dimensions: []*string{
					jsii.String("FunctionName"),
				},
				MetricName: jsii.String("Duration"),
				PopulateFrom: jsii.String("FunctionName"),
			}),
			DefaultValue: cw.DefaultValue_FIRST(),
			Visible: jsii.Boolean(true),
		}),
	},
})

You can add a variable after object instantiation with the method dashboard.addVariable().

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AlarmBase_IsConstruct

func AlarmBase_IsConstruct(x interface{}) *bool

Checks if `x` is a construct.

Use this method instead of `instanceof` to properly detect `Construct` instances, even when the construct library is symlinked.

Explanation: in JavaScript, multiple copies of the `constructs` library on disk are seen as independent, completely different libraries. As a consequence, the class `Construct` in each copy of the `constructs` library is seen as a different class, and an instance of one class will not test as `instanceof` the other class. `npm install` will not create installations like this, but users may manually symlink construct libraries together or use a monorepo tool: in those cases, multiple copies of the `constructs` library can be accidentally installed, and `instanceof` will behave unpredictably. It is safest to avoid using `instanceof`, and using this type-testing method instead.

Returns: true if `x` is an object created from a class which extends `Construct`.

func AlarmBase_IsOwnedResource added in v2.32.0

func AlarmBase_IsOwnedResource(construct constructs.IConstruct) *bool

Returns true if the construct was created by CDK, and false otherwise.

func AlarmBase_IsResource

func AlarmBase_IsResource(construct constructs.IConstruct) *bool

Check whether the given construct is a Resource.

func Alarm_IsConstruct

func Alarm_IsConstruct(x interface{}) *bool

Checks if `x` is a construct.

Use this method instead of `instanceof` to properly detect `Construct` instances, even when the construct library is symlinked.

Explanation: in JavaScript, multiple copies of the `constructs` library on disk are seen as independent, completely different libraries. As a consequence, the class `Construct` in each copy of the `constructs` library is seen as a different class, and an instance of one class will not test as `instanceof` the other class. `npm install` will not create installations like this, but users may manually symlink construct libraries together or use a monorepo tool: in those cases, multiple copies of the `constructs` library can be accidentally installed, and `instanceof` will behave unpredictably. It is safest to avoid using `instanceof`, and using this type-testing method instead.

Returns: true if `x` is an object created from a class which extends `Construct`.

func Alarm_IsOwnedResource added in v2.32.0

func Alarm_IsOwnedResource(construct constructs.IConstruct) *bool

Returns true if the construct was created by CDK, and false otherwise.

func Alarm_IsResource

func Alarm_IsResource(construct constructs.IConstruct) *bool

Check whether the given construct is a Resource.

func CfnAlarm_CFN_RESOURCE_TYPE_NAME

func CfnAlarm_CFN_RESOURCE_TYPE_NAME() *string

func CfnAlarm_IsCfnElement

func CfnAlarm_IsCfnElement(x interface{}) *bool

Returns `true` if a construct is a stack element (i.e. part of the synthesized cloudformation template).

Uses duck-typing instead of `instanceof` to allow stack elements from different versions of this library to be included in the same stack.

Returns: The construct as a stack element or undefined if it is not a stack element.

func CfnAlarm_IsCfnResource

func CfnAlarm_IsCfnResource(x interface{}) *bool

Check whether the given object is a CfnResource.

func CfnAlarm_IsConstruct

func CfnAlarm_IsConstruct(x interface{}) *bool

Checks if `x` is a construct.

Use this method instead of `instanceof` to properly detect `Construct` instances, even when the construct library is symlinked.

Explanation: in JavaScript, multiple copies of the `constructs` library on disk are seen as independent, completely different libraries. As a consequence, the class `Construct` in each copy of the `constructs` library is seen as a different class, and an instance of one class will not test as `instanceof` the other class. `npm install` will not create installations like this, but users may manually symlink construct libraries together or use a monorepo tool: in those cases, multiple copies of the `constructs` library can be accidentally installed, and `instanceof` will behave unpredictably. It is safest to avoid using `instanceof`, and using this type-testing method instead.

Returns: true if `x` is an object created from a class which extends `Construct`.

func CfnAnomalyDetector_CFN_RESOURCE_TYPE_NAME

func CfnAnomalyDetector_CFN_RESOURCE_TYPE_NAME() *string

func CfnAnomalyDetector_IsCfnElement

func CfnAnomalyDetector_IsCfnElement(x interface{}) *bool

Returns `true` if a construct is a stack element (i.e. part of the synthesized cloudformation template).

Uses duck-typing instead of `instanceof` to allow stack elements from different versions of this library to be included in the same stack.

Returns: The construct as a stack element or undefined if it is not a stack element.

func CfnAnomalyDetector_IsCfnResource

func CfnAnomalyDetector_IsCfnResource(x interface{}) *bool

Check whether the given object is a CfnResource.

func CfnAnomalyDetector_IsConstruct

func CfnAnomalyDetector_IsConstruct(x interface{}) *bool

Checks if `x` is a construct.

Use this method instead of `instanceof` to properly detect `Construct` instances, even when the construct library is symlinked.

Explanation: in JavaScript, multiple copies of the `constructs` library on disk are seen as independent, completely different libraries. As a consequence, the class `Construct` in each copy of the `constructs` library is seen as a different class, and an instance of one class will not test as `instanceof` the other class. `npm install` will not create installations like this, but users may manually symlink construct libraries together or use a monorepo tool: in those cases, multiple copies of the `constructs` library can be accidentally installed, and `instanceof` will behave unpredictably. It is safest to avoid using `instanceof`, and using this type-testing method instead.

Returns: true if `x` is an object created from a class which extends `Construct`.

func CfnCompositeAlarm_CFN_RESOURCE_TYPE_NAME

func CfnCompositeAlarm_CFN_RESOURCE_TYPE_NAME() *string

func CfnCompositeAlarm_IsCfnElement

func CfnCompositeAlarm_IsCfnElement(x interface{}) *bool

Returns `true` if a construct is a stack element (i.e. part of the synthesized cloudformation template).

Uses duck-typing instead of `instanceof` to allow stack elements from different versions of this library to be included in the same stack.

Returns: The construct as a stack element or undefined if it is not a stack element.

func CfnCompositeAlarm_IsCfnResource

func CfnCompositeAlarm_IsCfnResource(x interface{}) *bool

Check whether the given object is a CfnResource.

func CfnCompositeAlarm_IsConstruct

func CfnCompositeAlarm_IsConstruct(x interface{}) *bool

Checks if `x` is a construct.

Use this method instead of `instanceof` to properly detect `Construct` instances, even when the construct library is symlinked.

Explanation: in JavaScript, multiple copies of the `constructs` library on disk are seen as independent, completely different libraries. As a consequence, the class `Construct` in each copy of the `constructs` library is seen as a different class, and an instance of one class will not test as `instanceof` the other class. `npm install` will not create installations like this, but users may manually symlink construct libraries together or use a monorepo tool: in those cases, multiple copies of the `constructs` library can be accidentally installed, and `instanceof` will behave unpredictably. It is safest to avoid using `instanceof`, and using this type-testing method instead.

Returns: true if `x` is an object created from a class which extends `Construct`.

func CfnDashboard_CFN_RESOURCE_TYPE_NAME

func CfnDashboard_CFN_RESOURCE_TYPE_NAME() *string

func CfnDashboard_IsCfnElement

func CfnDashboard_IsCfnElement(x interface{}) *bool

Returns `true` if a construct is a stack element (i.e. part of the synthesized cloudformation template).

Uses duck-typing instead of `instanceof` to allow stack elements from different versions of this library to be included in the same stack.

Returns: The construct as a stack element or undefined if it is not a stack element.

func CfnDashboard_IsCfnResource

func CfnDashboard_IsCfnResource(x interface{}) *bool

Check whether the given object is a CfnResource.

func CfnDashboard_IsConstruct

func CfnDashboard_IsConstruct(x interface{}) *bool

Checks if `x` is a construct.

Use this method instead of `instanceof` to properly detect `Construct` instances, even when the construct library is symlinked.

Explanation: in JavaScript, multiple copies of the `constructs` library on disk are seen as independent, completely different libraries. As a consequence, the class `Construct` in each copy of the `constructs` library is seen as a different class, and an instance of one class will not test as `instanceof` the other class. `npm install` will not create installations like this, but users may manually symlink construct libraries together or use a monorepo tool: in those cases, multiple copies of the `constructs` library can be accidentally installed, and `instanceof` will behave unpredictably. It is safest to avoid using `instanceof`, and using this type-testing method instead.

Returns: true if `x` is an object created from a class which extends `Construct`.

func CfnInsightRule_CFN_RESOURCE_TYPE_NAME

func CfnInsightRule_CFN_RESOURCE_TYPE_NAME() *string

func CfnInsightRule_IsCfnElement

func CfnInsightRule_IsCfnElement(x interface{}) *bool

Returns `true` if a construct is a stack element (i.e. part of the synthesized cloudformation template).

Uses duck-typing instead of `instanceof` to allow stack elements from different versions of this library to be included in the same stack.

Returns: The construct as a stack element or undefined if it is not a stack element.

func CfnInsightRule_IsCfnResource

func CfnInsightRule_IsCfnResource(x interface{}) *bool

Check whether the given object is a CfnResource.

func CfnInsightRule_IsConstruct

func CfnInsightRule_IsConstruct(x interface{}) *bool

Checks if `x` is a construct.

Use this method instead of `instanceof` to properly detect `Construct` instances, even when the construct library is symlinked.

Explanation: in JavaScript, multiple copies of the `constructs` library on disk are seen as independent, completely different libraries. As a consequence, the class `Construct` in each copy of the `constructs` library is seen as a different class, and an instance of one class will not test as `instanceof` the other class. `npm install` will not create installations like this, but users may manually symlink construct libraries together or use a monorepo tool: in those cases, multiple copies of the `constructs` library can be accidentally installed, and `instanceof` will behave unpredictably. It is safest to avoid using `instanceof`, and using this type-testing method instead.

Returns: true if `x` is an object created from a class which extends `Construct`.

func CfnMetricStream_CFN_RESOURCE_TYPE_NAME

func CfnMetricStream_CFN_RESOURCE_TYPE_NAME() *string

func CfnMetricStream_IsCfnElement

func CfnMetricStream_IsCfnElement(x interface{}) *bool

Returns `true` if a construct is a stack element (i.e. part of the synthesized cloudformation template).

Uses duck-typing instead of `instanceof` to allow stack elements from different versions of this library to be included in the same stack.

Returns: The construct as a stack element or undefined if it is not a stack element.

func CfnMetricStream_IsCfnResource

func CfnMetricStream_IsCfnResource(x interface{}) *bool

Check whether the given object is a CfnResource.

func CfnMetricStream_IsConstruct

func CfnMetricStream_IsConstruct(x interface{}) *bool

Checks if `x` is a construct.

Use this method instead of `instanceof` to properly detect `Construct` instances, even when the construct library is symlinked.

Explanation: in JavaScript, multiple copies of the `constructs` library on disk are seen as independent, completely different libraries. As a consequence, the class `Construct` in each copy of the `constructs` library is seen as a different class, and an instance of one class will not test as `instanceof` the other class. `npm install` will not create installations like this, but users may manually symlink construct libraries together or use a monorepo tool: in those cases, multiple copies of the `constructs` library can be accidentally installed, and `instanceof` will behave unpredictably. It is safest to avoid using `instanceof`, and using this type-testing method instead.

Returns: true if `x` is an object created from a class which extends `Construct`.

func Color_BLUE

func Color_BLUE() *string

func Color_BROWN

func Color_BROWN() *string

func Color_GREEN

func Color_GREEN() *string

func Color_GREY

func Color_GREY() *string

func Color_ORANGE

func Color_ORANGE() *string

func Color_PINK

func Color_PINK() *string

func Color_PURPLE

func Color_PURPLE() *string

func Color_RED

func Color_RED() *string

func CompositeAlarm_IsConstruct

func CompositeAlarm_IsConstruct(x interface{}) *bool

Checks if `x` is a construct.

Use this method instead of `instanceof` to properly detect `Construct` instances, even when the construct library is symlinked.

Explanation: in JavaScript, multiple copies of the `constructs` library on disk are seen as independent, completely different libraries. As a consequence, the class `Construct` in each copy of the `constructs` library is seen as a different class, and an instance of one class will not test as `instanceof` the other class. `npm install` will not create installations like this, but users may manually symlink construct libraries together or use a monorepo tool: in those cases, multiple copies of the `constructs` library can be accidentally installed, and `instanceof` will behave unpredictably. It is safest to avoid using `instanceof`, and using this type-testing method instead.

Returns: true if `x` is an object created from a class which extends `Construct`.

func CompositeAlarm_IsOwnedResource added in v2.32.0

func CompositeAlarm_IsOwnedResource(construct constructs.IConstruct) *bool

Returns true if the construct was created by CDK, and false otherwise.

func CompositeAlarm_IsResource

func CompositeAlarm_IsResource(construct constructs.IConstruct) *bool

Check whether the given construct is a Resource.

func Dashboard_IsConstruct

func Dashboard_IsConstruct(x interface{}) *bool

Checks if `x` is a construct.

Use this method instead of `instanceof` to properly detect `Construct` instances, even when the construct library is symlinked.

Explanation: in JavaScript, multiple copies of the `constructs` library on disk are seen as independent, completely different libraries. As a consequence, the class `Construct` in each copy of the `constructs` library is seen as a different class, and an instance of one class will not test as `instanceof` the other class. `npm install` will not create installations like this, but users may manually symlink construct libraries together or use a monorepo tool: in those cases, multiple copies of the `constructs` library can be accidentally installed, and `instanceof` will behave unpredictably. It is safest to avoid using `instanceof`, and using this type-testing method instead.

Returns: true if `x` is an object created from a class which extends `Construct`.

func Dashboard_IsOwnedResource added in v2.32.0

func Dashboard_IsOwnedResource(construct constructs.IConstruct) *bool

Returns true if the construct was created by CDK, and false otherwise.

func Dashboard_IsResource

func Dashboard_IsResource(construct constructs.IConstruct) *bool

Check whether the given construct is a Resource.

func Metric_GrantPutMetricData

func Metric_GrantPutMetricData(grantee awsiam.IGrantable) awsiam.Grant

Grant permissions to the given identity to write metrics.

func NewAlarmBase_Override

func NewAlarmBase_Override(a AlarmBase, scope constructs.Construct, id *string, props *awscdk.ResourceProps)

func NewAlarmRule_Override

func NewAlarmRule_Override(a AlarmRule)

func NewAlarmStatusWidget_Override

func NewAlarmStatusWidget_Override(a AlarmStatusWidget, props *AlarmStatusWidgetProps)

func NewAlarmWidget_Override

func NewAlarmWidget_Override(a AlarmWidget, props *AlarmWidgetProps)

func NewAlarm_Override

func NewAlarm_Override(a Alarm, scope constructs.Construct, id *string, props *AlarmProps)

func NewCfnAlarm_Override

func NewCfnAlarm_Override(c CfnAlarm, scope constructs.Construct, id *string, props *CfnAlarmProps)

func NewCfnAnomalyDetector_Override

func NewCfnAnomalyDetector_Override(c CfnAnomalyDetector, scope constructs.Construct, id *string, props *CfnAnomalyDetectorProps)

func NewCfnCompositeAlarm_Override

func NewCfnCompositeAlarm_Override(c CfnCompositeAlarm, scope constructs.Construct, id *string, props *CfnCompositeAlarmProps)

func NewCfnDashboard_Override

func NewCfnDashboard_Override(c CfnDashboard, scope constructs.Construct, id *string, props *CfnDashboardProps)

func NewCfnInsightRule_Override

func NewCfnInsightRule_Override(c CfnInsightRule, scope constructs.Construct, id *string, props *CfnInsightRuleProps)

func NewCfnMetricStream_Override

func NewCfnMetricStream_Override(c CfnMetricStream, scope constructs.Construct, id *string, props *CfnMetricStreamProps)

func NewColumn_Override

func NewColumn_Override(c Column, widgets ...IWidget)

func NewCompositeAlarm_Override

func NewCompositeAlarm_Override(c CompositeAlarm, scope constructs.Construct, id *string, props *CompositeAlarmProps)

func NewConcreteWidget_Override

func NewConcreteWidget_Override(c ConcreteWidget, width *float64, height *float64)

func NewCustomWidget_Override added in v2.23.0

func NewCustomWidget_Override(c CustomWidget, props *CustomWidgetProps)

func NewDashboardVariable_Override added in v2.88.0

func NewDashboardVariable_Override(d DashboardVariable, options *DashboardVariableOptions)

func NewDashboard_Override

func NewDashboard_Override(d Dashboard, scope constructs.Construct, id *string, props *DashboardProps)

func NewGaugeWidget_Override added in v2.44.0

func NewGaugeWidget_Override(g GaugeWidget, props *GaugeWidgetProps)

func NewGraphWidget_Override

func NewGraphWidget_Override(g GraphWidget, props *GraphWidgetProps)

func NewLogQueryWidget_Override

func NewLogQueryWidget_Override(l LogQueryWidget, props *LogQueryWidgetProps)

func NewMathExpression_Override

func NewMathExpression_Override(m MathExpression, props *MathExpressionProps)

func NewMetric_Override

func NewMetric_Override(m Metric, props *MetricProps)

func NewRow_Override

func NewRow_Override(r Row, widgets ...IWidget)

func NewSingleValueWidget_Override

func NewSingleValueWidget_Override(s SingleValueWidget, props *SingleValueWidgetProps)

func NewSpacer_Override

func NewSpacer_Override(s Spacer, props *SpacerProps)

func NewStats_Override added in v2.54.0

func NewStats_Override(s Stats)

func NewTableWidget_Override added in v2.128.0

func NewTableWidget_Override(t TableWidget, props *TableWidgetProps)

func NewTextWidget_Override

func NewTextWidget_Override(t TextWidget, props *TextWidgetProps)

func NewValues_Override added in v2.88.0

func NewValues_Override(v Values)

func Stats_AVERAGE added in v2.54.0

func Stats_AVERAGE() *string

func Stats_IQM added in v2.54.0

func Stats_IQM() *string

func Stats_MAXIMUM added in v2.54.0

func Stats_MAXIMUM() *string

func Stats_MINIMUM added in v2.54.0

func Stats_MINIMUM() *string

func Stats_P added in v2.54.0

func Stats_P(percentile *float64) *string

A shorter alias for `percentile()`.

func Stats_Percentile added in v2.54.0

func Stats_Percentile(percentile *float64) *string

Percentile indicates the relative standing of a value in a dataset.

Percentiles help you get a better understanding of the distribution of your metric data.

For example, `p(90)` is the 90th percentile and means that 90% of the data within the period is lower than this value and 10% of the data is higher than this value.

func Stats_PercentileRank added in v2.54.0

func Stats_PercentileRank(v1 *float64, v2 *float64) *string

Percentile rank (PR) is the percentage of values that meet a fixed threshold.

  • If two numbers are given, they define the lower and upper bounds in absolute values, respectively.
  • If one number is given, it defines the upper bound (the lower bound is assumed to be 0).

For example, `percentileRank(300)` returns the percentage of data points that have a value of 300 or less. `percentileRank(100, 2000)` returns the percentage of data points that have a value between 100 and 2000.

func Stats_Pr added in v2.54.0

func Stats_Pr(v1 *float64, v2 *float64) *string

Shorter alias for `percentileRank()`.

func Stats_SAMPLE_COUNT added in v2.54.0

func Stats_SAMPLE_COUNT() *string

func Stats_SUM added in v2.54.0

func Stats_SUM() *string

func Stats_Tc added in v2.54.0

func Stats_Tc(p1 *float64, p2 *float64) *string

Shorter alias for `trimmedCount()`.

func Stats_Tm added in v2.54.0

func Stats_Tm(p1 *float64, p2 *float64) *string

A shorter alias for `trimmedMean()`.

func Stats_TrimmedCount added in v2.54.0

func Stats_TrimmedCount(p1 *float64, p2 *float64) *string

Trimmed count (TC) is the number of data points in the chosen range for a trimmed mean statistic.

  • If two numbers are given, they define the lower and upper bounds in percentages, respectively.
  • If one number is given, it defines the upper bound (the lower bound is assumed to be 0).

For example, `tc(90)` returns the number of data points not including any data points that fall in the highest 10% of the values. `tc(10, 90)` returns the number of data points not including any data points that fall in the lowest 10% of the values and the highest 90% of the values.

func Stats_TrimmedMean added in v2.54.0

func Stats_TrimmedMean(p1 *float64, p2 *float64) *string

Trimmed mean (TM) is the mean of all values that are between two specified boundaries.

Values outside of the boundaries are ignored when the mean is calculated. You define the boundaries as one or two numbers between 0 and 100, up to 10 decimal places. The numbers are percentages.

  • If two numbers are given, they define the lower and upper bounds in percentages, respectively.
  • If one number is given, it defines the upper bound (the lower bound is assumed to be 0).

For example, `tm(90)` calculates the average after removing the 10% of data points with the highest values; `tm(10, 90)` calculates the average after removing the 10% with the lowest and 10% with the highest values.

func Stats_TrimmedSum added in v2.54.0

func Stats_TrimmedSum(p1 *float64, p2 *float64) *string

Trimmed sum (TS) is the sum of the values of data points in a chosen range for a trimmed mean statistic.

It is equivalent to `(Trimmed Mean) * (Trimmed count)`.

  • If two numbers are given, they define the lower and upper bounds in percentages, respectively.
  • If one number is given, it defines the upper bound (the lower bound is assumed to be 0).

For example, `ts(90)` returns the sum of the data points not including any data points that fall in the highest 10% of the values. `ts(10, 90)` returns the sum of the data points not including any data points that fall in the lowest 10% of the values and the highest 90% of the values.

func Stats_Ts added in v2.54.0

func Stats_Ts(p1 *float64, p2 *float64) *string

Shorter alias for `trimmedSum()`.

func Stats_WinsorizedMean added in v2.54.0

func Stats_WinsorizedMean(p1 *float64, p2 *float64) *string

Winsorized mean (WM) is similar to trimmed mean.

However, with winsorized mean, the values that are outside the boundary are not ignored, but instead are considered to be equal to the value at the edge of the appropriate boundary. After this normalization, the average is calculated. You define the boundaries as one or two numbers between 0 and 100, up to 10 decimal places.

  • If two numbers are given, they define the lower and upper bounds in percentages, respectively.
  • If one number is given, it defines the upper bound (the lower bound is assumed to be 0).

For example, `tm(90)` calculates the average after removing the 10% of data points with the highest values; `tm(10, 90)` calculates the average after removing the 10% with the lowest and 10% with the highest values.

For example, `wm(90)` calculates the average while treating the 10% of the highest values to be equal to the value at the 90th percentile. `wm(10, 90)` calculates the average while treaing the bottom 10% and the top 10% of values to be equal to the boundary values.

func Stats_Wm added in v2.54.0

func Stats_Wm(p1 *float64, p2 *float64) *string

A shorter alias for `winsorizedMean()`.

Types

type Alarm

type Alarm interface {
	AlarmBase
	AlarmActionArns() *[]*string
	SetAlarmActionArns(val *[]*string)
	// ARN of this alarm.
	AlarmArn() *string
	// Name of this alarm.
	AlarmName() *string
	// The environment this resource belongs to.
	//
	// For resources that are created and managed by the CDK
	// (generally, those created by creating new class instances like Role, Bucket, etc.),
	// this is always the same as the environment of the stack they belong to;
	// however, for imported resources
	// (those obtained from static methods like fromRoleArn, fromBucketName, etc.),
	// that might be different than the stack they were imported into.
	Env() *awscdk.ResourceEnvironment
	InsufficientDataActionArns() *[]*string
	SetInsufficientDataActionArns(val *[]*string)
	// The metric object this alarm was based on.
	Metric() IMetric
	// The tree node.
	Node() constructs.Node
	OkActionArns() *[]*string
	SetOkActionArns(val *[]*string)
	// Returns a string-encoded token that resolves to the physical name that should be passed to the CloudFormation resource.
	//
	// This value will resolve to one of the following:
	// - a concrete value (e.g. `"my-awesome-bucket"`)
	// - `undefined`, when a name should be generated by CloudFormation
	// - a concrete name generated automatically during synthesis, in
	//   cross-environment scenarios.
	PhysicalName() *string
	// The stack in which this resource is defined.
	Stack() awscdk.Stack
	// Trigger this action if the alarm fires.
	//
	// Typically SnsAcion or AutoScalingAction.
	AddAlarmAction(actions ...IAlarmAction)
	// Trigger this action if there is insufficient data to evaluate the alarm.
	//
	// Typically SnsAction or AutoScalingAction.
	AddInsufficientDataAction(actions ...IAlarmAction)
	// Trigger this action if the alarm returns from breaching state into ok state.
	//
	// Typically SnsAction or AutoScalingAction.
	AddOkAction(actions ...IAlarmAction)
	// Apply the given removal policy to this resource.
	//
	// The Removal Policy controls what happens to this resource when it stops
	// being managed by CloudFormation, either because you've removed it from the
	// CDK application or because you've made a change that requires the resource
	// to be replaced.
	//
	// The resource can be deleted (`RemovalPolicy.DESTROY`), or left in your AWS
	// account for data recovery and cleanup later (`RemovalPolicy.RETAIN`).
	ApplyRemovalPolicy(policy awscdk.RemovalPolicy)
	GeneratePhysicalName() *string
	// Returns an environment-sensitive token that should be used for the resource's "ARN" attribute (e.g. `bucket.bucketArn`).
	//
	// Normally, this token will resolve to `arnAttr`, but if the resource is
	// referenced across environments, `arnComponents` will be used to synthesize
	// a concrete ARN with the resource's physical name. Make sure to reference
	// `this.physicalName` in `arnComponents`.
	GetResourceArnAttribute(arnAttr *string, arnComponents *awscdk.ArnComponents) *string
	// Returns an environment-sensitive token that should be used for the resource's "name" attribute (e.g. `bucket.bucketName`).
	//
	// Normally, this token will resolve to `nameAttr`, but if the resource is
	// referenced across environments, it will be resolved to `this.physicalName`,
	// which will be a concrete name.
	GetResourceNameAttribute(nameAttr *string) *string
	// AlarmRule indicating ALARM state for Alarm.
	RenderAlarmRule() *string
	// Turn this alarm into a horizontal annotation.
	//
	// This is useful if you want to represent an Alarm in a non-AlarmWidget.
	// An `AlarmWidget` can directly show an alarm, but it can only show a
	// single alarm and no other metrics. Instead, you can convert the alarm to
	// a HorizontalAnnotation and add it as an annotation to another graph.
	//
	// This might be useful if:
	//
	// - You want to show multiple alarms inside a single graph, for example if
	//   you have both a "small margin/long period" alarm as well as a
	//   "large margin/short period" alarm.
	//
	// - You want to show an Alarm line in a graph with multiple metrics in it.
	ToAnnotation() *HorizontalAnnotation
	// Returns a string representation of this construct.
	ToString() *string
}

An alarm on a CloudWatch metric.

Example:

import "github.com/aws/aws-cdk-go/awscdk"

var alias alias

// or add alarms to an existing group
var blueGreenAlias alias

alarm := cloudwatch.NewAlarm(this, jsii.String("Errors"), &AlarmProps{
	ComparisonOperator: cloudwatch.ComparisonOperator_GREATER_THAN_THRESHOLD,
	Threshold: jsii.Number(1),
	EvaluationPeriods: jsii.Number(1),
	Metric: alias.metricErrors(),
})
deploymentGroup := codedeploy.NewLambdaDeploymentGroup(this, jsii.String("BlueGreenDeployment"), &LambdaDeploymentGroupProps{
	Alias: Alias,
	DeploymentConfig: codedeploy.LambdaDeploymentConfig_LINEAR_10PERCENT_EVERY_1MINUTE(),
	Alarms: []iAlarm{
		alarm,
	},
})
deploymentGroup.AddAlarm(cloudwatch.NewAlarm(this, jsii.String("BlueGreenErrors"), &AlarmProps{
	ComparisonOperator: cloudwatch.ComparisonOperator_GREATER_THAN_THRESHOLD,
	Threshold: jsii.Number(1),
	EvaluationPeriods: jsii.Number(1),
	Metric: blueGreenAlias.metricErrors(),
}))

func NewAlarm

func NewAlarm(scope constructs.Construct, id *string, props *AlarmProps) Alarm

type AlarmActionConfig

type AlarmActionConfig struct {
	// Return the ARN that should be used for a CloudWatch Alarm action.
	AlarmActionArn *string `field:"required" json:"alarmActionArn" yaml:"alarmActionArn"`
}

Properties for an alarm action.

Example:

// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"

alarmActionConfig := &AlarmActionConfig{
	AlarmActionArn: jsii.String("alarmActionArn"),
}

type AlarmBase

type AlarmBase interface {
	awscdk.Resource
	IAlarm
	AlarmActionArns() *[]*string
	SetAlarmActionArns(val *[]*string)
	// Alarm ARN (i.e. arn:aws:cloudwatch:<region>:<account-id>:alarm:Foo).
	AlarmArn() *string
	// Name of the alarm.
	AlarmName() *string
	// The environment this resource belongs to.
	//
	// For resources that are created and managed by the CDK
	// (generally, those created by creating new class instances like Role, Bucket, etc.),
	// this is always the same as the environment of the stack they belong to;
	// however, for imported resources
	// (those obtained from static methods like fromRoleArn, fromBucketName, etc.),
	// that might be different than the stack they were imported into.
	Env() *awscdk.ResourceEnvironment
	InsufficientDataActionArns() *[]*string
	SetInsufficientDataActionArns(val *[]*string)
	// The tree node.
	Node() constructs.Node
	OkActionArns() *[]*string
	SetOkActionArns(val *[]*string)
	// Returns a string-encoded token that resolves to the physical name that should be passed to the CloudFormation resource.
	//
	// This value will resolve to one of the following:
	// - a concrete value (e.g. `"my-awesome-bucket"`)
	// - `undefined`, when a name should be generated by CloudFormation
	// - a concrete name generated automatically during synthesis, in
	//   cross-environment scenarios.
	PhysicalName() *string
	// The stack in which this resource is defined.
	Stack() awscdk.Stack
	// Trigger this action if the alarm fires.
	//
	// Typically SnsAction or AutoScalingAction.
	AddAlarmAction(actions ...IAlarmAction)
	// Trigger this action if there is insufficient data to evaluate the alarm.
	//
	// Typically SnsAction or AutoScalingAction.
	AddInsufficientDataAction(actions ...IAlarmAction)
	// Trigger this action if the alarm returns from breaching state into ok state.
	//
	// Typically SnsAction or AutoScalingAction.
	AddOkAction(actions ...IAlarmAction)
	// Apply the given removal policy to this resource.
	//
	// The Removal Policy controls what happens to this resource when it stops
	// being managed by CloudFormation, either because you've removed it from the
	// CDK application or because you've made a change that requires the resource
	// to be replaced.
	//
	// The resource can be deleted (`RemovalPolicy.DESTROY`), or left in your AWS
	// account for data recovery and cleanup later (`RemovalPolicy.RETAIN`).
	ApplyRemovalPolicy(policy awscdk.RemovalPolicy)
	GeneratePhysicalName() *string
	// Returns an environment-sensitive token that should be used for the resource's "ARN" attribute (e.g. `bucket.bucketArn`).
	//
	// Normally, this token will resolve to `arnAttr`, but if the resource is
	// referenced across environments, `arnComponents` will be used to synthesize
	// a concrete ARN with the resource's physical name. Make sure to reference
	// `this.physicalName` in `arnComponents`.
	GetResourceArnAttribute(arnAttr *string, arnComponents *awscdk.ArnComponents) *string
	// Returns an environment-sensitive token that should be used for the resource's "name" attribute (e.g. `bucket.bucketName`).
	//
	// Normally, this token will resolve to `nameAttr`, but if the resource is
	// referenced across environments, it will be resolved to `this.physicalName`,
	// which will be a concrete name.
	GetResourceNameAttribute(nameAttr *string) *string
	// AlarmRule indicating ALARM state for Alarm.
	RenderAlarmRule() *string
	// Returns a string representation of this construct.
	ToString() *string
}

The base class for Alarm and CompositeAlarm resources.

type AlarmProps

type AlarmProps struct {
	// The number of periods over which data is compared to the specified threshold.
	EvaluationPeriods *float64 `field:"required" json:"evaluationPeriods" yaml:"evaluationPeriods"`
	// The value against which the specified statistic is compared.
	Threshold *float64 `field:"required" json:"threshold" yaml:"threshold"`
	// Whether the actions for this alarm are enabled.
	// Default: true.
	//
	ActionsEnabled *bool `field:"optional" json:"actionsEnabled" yaml:"actionsEnabled"`
	// Description for the alarm.
	// Default: No description.
	//
	AlarmDescription *string `field:"optional" json:"alarmDescription" yaml:"alarmDescription"`
	// Name of the alarm.
	// Default: Automatically generated name.
	//
	AlarmName *string `field:"optional" json:"alarmName" yaml:"alarmName"`
	// Comparison to use to check if metric is breaching.
	// Default: GreaterThanOrEqualToThreshold.
	//
	ComparisonOperator ComparisonOperator `field:"optional" json:"comparisonOperator" yaml:"comparisonOperator"`
	// The number of datapoints that must be breaching to trigger the alarm.
	//
	// This is used only if you are setting an "M
	// out of N" alarm. In that case, this value is the M. For more information, see Evaluating an Alarm in the Amazon
	// CloudWatch User Guide.
	// See: https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/AlarmThatSendsEmail.html#alarm-evaluation
	//
	// Default: “evaluationPeriods“.
	//
	DatapointsToAlarm *float64 `field:"optional" json:"datapointsToAlarm" yaml:"datapointsToAlarm"`
	// Specifies whether to evaluate the data and potentially change the alarm state if there are too few data points to be statistically significant.
	//
	// Used only for alarms that are based on percentiles.
	// Default: - Not configured.
	//
	EvaluateLowSampleCountPercentile *string `field:"optional" json:"evaluateLowSampleCountPercentile" yaml:"evaluateLowSampleCountPercentile"`
	// Sets how this alarm is to handle missing data points.
	// Default: TreatMissingData.Missing
	//
	TreatMissingData TreatMissingData `field:"optional" json:"treatMissingData" yaml:"treatMissingData"`
	// The metric to add the alarm on.
	//
	// Metric objects can be obtained from most resources, or you can construct
	// custom Metric objects by instantiating one.
	Metric IMetric `field:"required" json:"metric" yaml:"metric"`
}

Properties for Alarms.

Example:

import "github.com/aws/aws-cdk-go/awscdk"

var alias alias

// or add alarms to an existing group
var blueGreenAlias alias

alarm := cloudwatch.NewAlarm(this, jsii.String("Errors"), &AlarmProps{
	ComparisonOperator: cloudwatch.ComparisonOperator_GREATER_THAN_THRESHOLD,
	Threshold: jsii.Number(1),
	EvaluationPeriods: jsii.Number(1),
	Metric: alias.metricErrors(),
})
deploymentGroup := codedeploy.NewLambdaDeploymentGroup(this, jsii.String("BlueGreenDeployment"), &LambdaDeploymentGroupProps{
	Alias: Alias,
	DeploymentConfig: codedeploy.LambdaDeploymentConfig_LINEAR_10PERCENT_EVERY_1MINUTE(),
	Alarms: []iAlarm{
		alarm,
	},
})
deploymentGroup.AddAlarm(cloudwatch.NewAlarm(this, jsii.String("BlueGreenErrors"), &AlarmProps{
	ComparisonOperator: cloudwatch.ComparisonOperator_GREATER_THAN_THRESHOLD,
	Threshold: jsii.Number(1),
	EvaluationPeriods: jsii.Number(1),
	Metric: blueGreenAlias.metricErrors(),
}))

type AlarmRule

type AlarmRule interface {
}

Class with static functions to build AlarmRule for Composite Alarms.

Example:

var alarm1 alarm
var alarm2 alarm
var alarm3 alarm
var alarm4 alarm

alarmRule := cloudwatch.AlarmRule_AnyOf(cloudwatch.AlarmRule_AllOf(cloudwatch.AlarmRule_AnyOf(alarm1, cloudwatch.AlarmRule_FromAlarm(alarm2, cloudwatch.AlarmState_OK), alarm3), cloudwatch.AlarmRule_Not(cloudwatch.AlarmRule_FromAlarm(alarm4, cloudwatch.AlarmState_INSUFFICIENT_DATA))), cloudwatch.AlarmRule_FromBoolean(jsii.Boolean(false)))

cloudwatch.NewCompositeAlarm(this, jsii.String("MyAwesomeCompositeAlarm"), &CompositeAlarmProps{
	AlarmRule: AlarmRule,
})

func NewAlarmRule

func NewAlarmRule() AlarmRule

type AlarmState

type AlarmState string

Enumeration indicates state of Alarm used in building Alarm Rule.

Example:

var dashboard dashboard
var errorAlarm alarm

dashboard.AddWidgets(cloudwatch.NewAlarmStatusWidget(&AlarmStatusWidgetProps{
	Title: jsii.String("Errors"),
	Alarms: []iAlarm{
		errorAlarm,
	},
	SortBy: cloudwatch.AlarmStatusWidgetSortBy_STATE_UPDATED_TIMESTAMP,
	States: []alarmState{
		cloudwatch.*alarmState_ALARM,
	},
}))
const (
	// State indicates resource is in ALARM.
	AlarmState_ALARM AlarmState = "ALARM"
	// State indicates resource is not in ALARM.
	AlarmState_OK AlarmState = "OK"
	// State indicates there is not enough data to determine is resource is in ALARM.
	AlarmState_INSUFFICIENT_DATA AlarmState = "INSUFFICIENT_DATA"
)

type AlarmStatusWidget

type AlarmStatusWidget interface {
	ConcreteWidget
	// The amount of vertical grid units the widget will take up.
	Height() *float64
	// Any warnings that are produced as a result of putting together this widget.
	Warnings() *[]*string
	// Any warnings that are produced as a result of putting together this widget.
	WarningsV2() *map[string]*string
	// The amount of horizontal grid units the widget will take up.
	Width() *float64
	X() *float64
	SetX(val *float64)
	Y() *float64
	SetY(val *float64)
	// Copy the warnings from the given metric.
	CopyMetricWarnings(ms ...IMetric)
	// Place the widget at a given position.
	Position(x *float64, y *float64)
	// Return the widget JSON for use in the dashboard.
	ToJson() *[]interface{}
}

A dashboard widget that displays alarms in a grid view.

Example:

var dashboard dashboard
var errorAlarm alarm

dashboard.AddWidgets(
cloudwatch.NewAlarmStatusWidget(&AlarmStatusWidgetProps{
	Alarms: []iAlarm{
		errorAlarm,
	},
}))

func NewAlarmStatusWidget

func NewAlarmStatusWidget(props *AlarmStatusWidgetProps) AlarmStatusWidget

type AlarmStatusWidgetProps

type AlarmStatusWidgetProps struct {
	// CloudWatch Alarms to show in widget.
	Alarms *[]IAlarm `field:"required" json:"alarms" yaml:"alarms"`
	// Height of the widget.
	// Default: 3.
	//
	Height *float64 `field:"optional" json:"height" yaml:"height"`
	// Specifies how to sort the alarms in the widget.
	// Default: - alphabetical order.
	//
	SortBy AlarmStatusWidgetSortBy `field:"optional" json:"sortBy" yaml:"sortBy"`
	// Use this field to filter the list of alarms displayed in the widget to only those alarms currently in the specified states.
	//
	// You can specify one or more alarm states in the value for this field.
	// The alarm states that you can specify are ALARM, INSUFFICIENT_DATA, and OK.
	//
	// If you omit this field or specify an empty array, all the alarms specifed in alarms are displayed.
	// Default: -  all the alarms specified in alarms are displayed.
	//
	States *[]AlarmState `field:"optional" json:"states" yaml:"states"`
	// The title of the widget.
	// Default: 'Alarm Status'.
	//
	Title *string `field:"optional" json:"title" yaml:"title"`
	// Width of the widget, in a grid of 24 units wide.
	// Default: 6.
	//
	Width *float64 `field:"optional" json:"width" yaml:"width"`
}

Properties for an Alarm Status Widget.

Example:

var dashboard dashboard
var errorAlarm alarm

dashboard.AddWidgets(
cloudwatch.NewAlarmStatusWidget(&AlarmStatusWidgetProps{
	Alarms: []iAlarm{
		errorAlarm,
	},
}))

type AlarmStatusWidgetSortBy added in v2.18.0

type AlarmStatusWidgetSortBy string

The sort possibilities for AlarmStatusWidgets.

Example:

var dashboard dashboard
var errorAlarm alarm

dashboard.AddWidgets(cloudwatch.NewAlarmStatusWidget(&AlarmStatusWidgetProps{
	Title: jsii.String("Errors"),
	Alarms: []iAlarm{
		errorAlarm,
	},
	SortBy: cloudwatch.AlarmStatusWidgetSortBy_STATE_UPDATED_TIMESTAMP,
	States: []alarmState{
		cloudwatch.*alarmState_ALARM,
	},
}))
const (
	// Choose DEFAULT to sort them in alphabetical order by alarm name.
	AlarmStatusWidgetSortBy_DEFAULT AlarmStatusWidgetSortBy = "DEFAULT"
	// Choose STATE_UPDATED_TIMESTAMP to sort them first by alarm state, with alarms in ALARM state first, INSUFFICIENT_DATA alarms next, and OK alarms last.
	//
	// Within each group, the alarms are sorted by when they last changed state, with more recent state changes listed first.
	AlarmStatusWidgetSortBy_STATE_UPDATED_TIMESTAMP AlarmStatusWidgetSortBy = "STATE_UPDATED_TIMESTAMP"
	// Choose TIMESTAMP to sort them by the time when the alarms most recently changed state, no matter the current alarm state.
	//
	// The alarm that changed state most recently is listed first.
	AlarmStatusWidgetSortBy_TIMESTAMP AlarmStatusWidgetSortBy = "TIMESTAMP"
)

type AlarmWidget

type AlarmWidget interface {
	ConcreteWidget
	// The amount of vertical grid units the widget will take up.
	Height() *float64
	// Any warnings that are produced as a result of putting together this widget.
	Warnings() *[]*string
	// Any warnings that are produced as a result of putting together this widget.
	WarningsV2() *map[string]*string
	// The amount of horizontal grid units the widget will take up.
	Width() *float64
	X() *float64
	SetX(val *float64)
	Y() *float64
	SetY(val *float64)
	// Copy the warnings from the given metric.
	CopyMetricWarnings(ms ...IMetric)
	// Place the widget at a given position.
	Position(x *float64, y *float64)
	// Return the widget JSON for use in the dashboard.
	ToJson() *[]interface{}
}

Display the metric associated with an alarm, including the alarm line.

Example:

var dashboard dashboard
var errorAlarm alarm

dashboard.AddWidgets(cloudwatch.NewAlarmWidget(&AlarmWidgetProps{
	Title: jsii.String("Errors"),
	Alarm: errorAlarm,
}))

func NewAlarmWidget

func NewAlarmWidget(props *AlarmWidgetProps) AlarmWidget

type AlarmWidgetProps

type AlarmWidgetProps struct {
	// Height of the widget.
	// Default: - 6 for Alarm and Graph widgets.
	// 3 for single value widgets where most recent value of a metric is displayed.
	//
	Height *float64 `field:"optional" json:"height" yaml:"height"`
	// The region the metrics of this graph should be taken from.
	// Default: - Current region.
	//
	Region *string `field:"optional" json:"region" yaml:"region"`
	// Title for the graph.
	// Default: - None.
	//
	Title *string `field:"optional" json:"title" yaml:"title"`
	// Width of the widget, in a grid of 24 units wide.
	// Default: 6.
	//
	Width *float64 `field:"optional" json:"width" yaml:"width"`
	// The alarm to show.
	Alarm IAlarm `field:"required" json:"alarm" yaml:"alarm"`
	// Left Y axis.
	// Default: - No minimum or maximum values for the left Y-axis.
	//
	LeftYAxis *YAxisProps `field:"optional" json:"leftYAxis" yaml:"leftYAxis"`
}

Properties for an AlarmWidget.

Example:

var dashboard dashboard
var errorAlarm alarm

dashboard.AddWidgets(cloudwatch.NewAlarmWidget(&AlarmWidgetProps{
	Title: jsii.String("Errors"),
	Alarm: errorAlarm,
}))

type CfnAlarm

type CfnAlarm interface {
	awscdk.CfnResource
	awscdk.IInspectable
	awscdk.ITaggableV2
	// Indicates whether actions should be executed during any changes to the alarm state.
	ActionsEnabled() interface{}
	SetActionsEnabled(val interface{})
	// The list of actions to execute when this alarm transitions into an ALARM state from any other state.
	AlarmActions() *[]*string
	SetAlarmActions(val *[]*string)
	// The description of the alarm.
	AlarmDescription() *string
	SetAlarmDescription(val *string)
	// The name of the alarm.
	AlarmName() *string
	SetAlarmName(val *string)
	// The ARN of the CloudWatch alarm, such as `arn:aws:cloudwatch:us-west-2:123456789012:alarm:myCloudWatchAlarm-CPUAlarm-UXMMZK36R55Z` .
	AttrArn() *string
	// Tag Manager which manages the tags for this resource.
	CdkTagManager() awscdk.TagManager
	// Options for this resource, such as condition, update policy etc.
	CfnOptions() awscdk.ICfnResourceOptions
	CfnProperties() *map[string]interface{}
	// AWS resource type.
	CfnResourceType() *string
	// The arithmetic operation to use when comparing the specified statistic and threshold.
	ComparisonOperator() *string
	SetComparisonOperator(val *string)
	// Returns: the stack trace of the point where this Resource was created from, sourced
	// from the +metadata+ entry typed +aws:cdk:logicalId+, and with the bottom-most
	// node +internal+ entries filtered.
	CreationStack() *[]*string
	// The number of datapoints that must be breaching to trigger the alarm.
	DatapointsToAlarm() *float64
	SetDatapointsToAlarm(val *float64)
	// The dimensions for the metric associated with the alarm.
	Dimensions() interface{}
	SetDimensions(val interface{})
	// Used only for alarms based on percentiles.
	EvaluateLowSampleCountPercentile() *string
	SetEvaluateLowSampleCountPercentile(val *string)
	// The number of periods over which data is compared to the specified threshold.
	EvaluationPeriods() *float64
	SetEvaluationPeriods(val *float64)
	// The percentile statistic for the metric associated with the alarm.
	//
	// Specify a value between p0.0 and p100.
	ExtendedStatistic() *string
	SetExtendedStatistic(val *string)
	// The actions to execute when this alarm transitions to the `INSUFFICIENT_DATA` state from any other state.
	InsufficientDataActions() *[]*string
	SetInsufficientDataActions(val *[]*string)
	// The logical ID for this CloudFormation stack element.
	//
	// The logical ID of the element
	// is calculated from the path of the resource node in the construct tree.
	//
	// To override this value, use `overrideLogicalId(newLogicalId)`.
	//
	// Returns: the logical ID as a stringified token. This value will only get
	// resolved during synthesis.
	LogicalId() *string
	// The name of the metric associated with the alarm.
	MetricName() *string
	SetMetricName(val *string)
	// An array that enables you to create an alarm based on the result of a metric math expression.
	Metrics() interface{}
	SetMetrics(val interface{})
	// The namespace of the metric associated with the alarm.
	Namespace() *string
	SetNamespace(val *string)
	// The tree node.
	Node() constructs.Node
	// The actions to execute when this alarm transitions to the `OK` state from any other state.
	OkActions() *[]*string
	SetOkActions(val *[]*string)
	// The period, in seconds, over which the statistic is applied.
	Period() *float64
	SetPeriod(val *float64)
	// Return a string that will be resolved to a CloudFormation `{ Ref }` for this element.
	//
	// If, by any chance, the intrinsic reference of a resource is not a string, you could
	// coerce it to an IResolvable through `Lazy.any({ produce: resource.ref })`.
	Ref() *string
	// The stack in which this element is defined.
	//
	// CfnElements must be defined within a stack scope (directly or indirectly).
	Stack() awscdk.Stack
	// The statistic for the metric associated with the alarm, other than percentile.
	//
	// For percentile statistics, use `ExtendedStatistic` .
	Statistic() *string
	SetStatistic(val *string)
	// A list of key-value pairs to associate with the alarm.
	Tags() *[]*awscdk.CfnTag
	SetTags(val *[]*awscdk.CfnTag)
	// The value to compare with the specified statistic.
	Threshold() *float64
	SetThreshold(val *float64)
	// In an alarm based on an anomaly detection model, this is the ID of the `ANOMALY_DETECTION_BAND` function used as the threshold for the alarm.
	ThresholdMetricId() *string
	SetThresholdMetricId(val *string)
	// Sets how this alarm is to handle missing data points.
	TreatMissingData() *string
	SetTreatMissingData(val *string)
	// The unit of the metric associated with the alarm.
	Unit() *string
	SetUnit(val *string)
	// Deprecated.
	// Deprecated: use `updatedProperties`
	//
	// Return properties modified after initiation
	//
	// Resources that expose mutable properties should override this function to
	// collect and return the properties object for this resource.
	UpdatedProperites() *map[string]interface{}
	// Return properties modified after initiation.
	//
	// Resources that expose mutable properties should override this function to
	// collect and return the properties object for this resource.
	UpdatedProperties() *map[string]interface{}
	// Syntactic sugar for `addOverride(path, undefined)`.
	AddDeletionOverride(path *string)
	// Indicates that this resource depends on another resource and cannot be provisioned unless the other resource has been successfully provisioned.
	//
	// This can be used for resources across stacks (or nested stack) boundaries
	// and the dependency will automatically be transferred to the relevant scope.
	AddDependency(target awscdk.CfnResource)
	// Indicates that this resource depends on another resource and cannot be provisioned unless the other resource has been successfully provisioned.
	// Deprecated: use addDependency.
	AddDependsOn(target awscdk.CfnResource)
	// Add a value to the CloudFormation Resource Metadata.
	// See: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/metadata-section-structure.html
	//
	// Note that this is a different set of metadata from CDK node metadata; this
	// metadata ends up in the stack template under the resource, whereas CDK
	// node metadata ends up in the Cloud Assembly.
	//
	AddMetadata(key *string, value interface{})
	// Adds an override to the synthesized CloudFormation resource.
	//
	// To add a
	// property override, either use `addPropertyOverride` or prefix `path` with
	// "Properties." (i.e. `Properties.TopicName`).
	//
	// If the override is nested, separate each nested level using a dot (.) in the path parameter.
	// If there is an array as part of the nesting, specify the index in the path.
	//
	// To include a literal `.` in the property name, prefix with a `\`. In most
	// programming languages you will need to write this as `"\\."` because the
	// `\` itself will need to be escaped.
	//
	// For example,
	// “`typescript
	// cfnResource.addOverride('Properties.GlobalSecondaryIndexes.0.Projection.NonKeyAttributes', ['myattribute']);
	// cfnResource.addOverride('Properties.GlobalSecondaryIndexes.1.ProjectionType', 'INCLUDE');
	// “`
	// would add the overrides
	// “`json
	// "Properties": {
	//   "GlobalSecondaryIndexes": [
	//     {
	//       "Projection": {
	//         "NonKeyAttributes": [ "myattribute" ]
	//         ...
	//       }
	//       ...
	//     },
	//     {
	//       "ProjectionType": "INCLUDE"
	//       ...
	//     },
	//   ]
	//   ...
	// }
	// “`
	//
	// The `value` argument to `addOverride` will not be processed or translated
	// in any way. Pass raw JSON values in here with the correct capitalization
	// for CloudFormation. If you pass CDK classes or structs, they will be
	// rendered with lowercased key names, and CloudFormation will reject the
	// template.
	AddOverride(path *string, value interface{})
	// Adds an override that deletes the value of a property from the resource definition.
	AddPropertyDeletionOverride(propertyPath *string)
	// Adds an override to a resource property.
	//
	// Syntactic sugar for `addOverride("Properties.<...>", value)`.
	AddPropertyOverride(propertyPath *string, value interface{})
	// Sets the deletion policy of the resource based on the removal policy specified.
	//
	// The Removal Policy controls what happens to this resource when it stops
	// being managed by CloudFormation, either because you've removed it from the
	// CDK application or because you've made a change that requires the resource
	// to be replaced.
	//
	// The resource can be deleted (`RemovalPolicy.DESTROY`), or left in your AWS
	// account for data recovery and cleanup later (`RemovalPolicy.RETAIN`). In some
	// cases, a snapshot can be taken of the resource prior to deletion
	// (`RemovalPolicy.SNAPSHOT`). A list of resources that support this policy
	// can be found in the following link:.
	// See: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-deletionpolicy.html#aws-attribute-deletionpolicy-options
	//
	ApplyRemovalPolicy(policy awscdk.RemovalPolicy, options *awscdk.RemovalPolicyOptions)
	// Returns a token for an runtime attribute of this resource.
	//
	// Ideally, use generated attribute accessors (e.g. `resource.arn`), but this can be used for future compatibility
	// in case there is no generated attribute.
	GetAtt(attributeName *string, typeHint awscdk.ResolutionTypeHint) awscdk.Reference
	// Retrieve a value value from the CloudFormation Resource Metadata.
	// See: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/metadata-section-structure.html
	//
	// Note that this is a different set of metadata from CDK node metadata; this
	// metadata ends up in the stack template under the resource, whereas CDK
	// node metadata ends up in the Cloud Assembly.
	//
	GetMetadata(key *string) interface{}
	// Examines the CloudFormation resource and discloses attributes.
	Inspect(inspector awscdk.TreeInspector)
	// Retrieves an array of resources this resource depends on.
	//
	// This assembles dependencies on resources across stacks (including nested stacks)
	// automatically.
	ObtainDependencies() *[]interface{}
	// Get a shallow copy of dependencies between this resource and other resources in the same stack.
	ObtainResourceDependencies() *[]awscdk.CfnResource
	// Overrides the auto-generated logical ID with a specific ID.
	OverrideLogicalId(newLogicalId *string)
	// Indicates that this resource no longer depends on another resource.
	//
	// This can be used for resources across stacks (including nested stacks)
	// and the dependency will automatically be removed from the relevant scope.
	RemoveDependency(target awscdk.CfnResource)
	RenderProperties(props *map[string]interface{}) *map[string]interface{}
	// Replaces one dependency with another.
	ReplaceDependency(target awscdk.CfnResource, newTarget awscdk.CfnResource)
	// Can be overridden by subclasses to determine if this resource will be rendered into the cloudformation template.
	//
	// Returns: `true` if the resource should be included or `false` is the resource
	// should be omitted.
	ShouldSynthesize() *bool
	// Returns a string representation of this construct.
	//
	// Returns: a string representation of this resource.
	ToString() *string
	ValidateProperties(_properties interface{})
}

The `AWS::CloudWatch::Alarm` type specifies an alarm and associates it with the specified metric or metric math expression.

When this operation creates an alarm, the alarm state is immediately set to `INSUFFICIENT_DATA` . The alarm is then evaluated and its state is set appropriately. Any actions associated with the new state are then executed.

When you update an existing alarm, its state is left unchanged, but the update completely overwrites the previous configuration of the alarm.

Example:

// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"

cfnAlarm := awscdk.Aws_cloudwatch.NewCfnAlarm(this, jsii.String("MyCfnAlarm"), &CfnAlarmProps{
	ComparisonOperator: jsii.String("comparisonOperator"),
	EvaluationPeriods: jsii.Number(123),

	// the properties below are optional
	ActionsEnabled: jsii.Boolean(false),
	AlarmActions: []*string{
		jsii.String("alarmActions"),
	},
	AlarmDescription: jsii.String("alarmDescription"),
	AlarmName: jsii.String("alarmName"),
	DatapointsToAlarm: jsii.Number(123),
	Dimensions: []interface{}{
		&DimensionProperty{
			Name: jsii.String("name"),
			Value: jsii.String("value"),
		},
	},
	EvaluateLowSampleCountPercentile: jsii.String("evaluateLowSampleCountPercentile"),
	ExtendedStatistic: jsii.String("extendedStatistic"),
	InsufficientDataActions: []*string{
		jsii.String("insufficientDataActions"),
	},
	MetricName: jsii.String("metricName"),
	Metrics: []interface{}{
		&MetricDataQueryProperty{
			Id: jsii.String("id"),

			// the properties below are optional
			AccountId: jsii.String("accountId"),
			Expression: jsii.String("expression"),
			Label: jsii.String("label"),
			MetricStat: &MetricStatProperty{
				Metric: &MetricProperty{
					Dimensions: []interface{}{
						&DimensionProperty{
							Name: jsii.String("name"),
							Value: jsii.String("value"),
						},
					},
					MetricName: jsii.String("metricName"),
					Namespace: jsii.String("namespace"),
				},
				Period: jsii.Number(123),
				Stat: jsii.String("stat"),

				// the properties below are optional
				Unit: jsii.String("unit"),
			},
			Period: jsii.Number(123),
			ReturnData: jsii.Boolean(false),
		},
	},
	Namespace: jsii.String("namespace"),
	OkActions: []*string{
		jsii.String("okActions"),
	},
	Period: jsii.Number(123),
	Statistic: jsii.String("statistic"),
	Tags: []cfnTag{
		&cfnTag{
			Key: jsii.String("key"),
			Value: jsii.String("value"),
		},
	},
	Threshold: jsii.Number(123),
	ThresholdMetricId: jsii.String("thresholdMetricId"),
	TreatMissingData: jsii.String("treatMissingData"),
	Unit: jsii.String("unit"),
})

See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-cloudwatch-alarm.html

func NewCfnAlarm

func NewCfnAlarm(scope constructs.Construct, id *string, props *CfnAlarmProps) CfnAlarm

type CfnAlarmProps

type CfnAlarmProps struct {
	// The arithmetic operation to use when comparing the specified statistic and threshold.
	//
	// The specified statistic value is used as the first operand.
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-cloudwatch-alarm.html#cfn-cloudwatch-alarm-comparisonoperator
	//
	ComparisonOperator *string `field:"required" json:"comparisonOperator" yaml:"comparisonOperator"`
	// The number of periods over which data is compared to the specified threshold.
	//
	// If you are setting an alarm that requires that a number of consecutive data points be breaching to trigger the alarm, this value specifies that number. If you are setting an "M out of N" alarm, this value is the N, and `DatapointsToAlarm` is the M.
	//
	// For more information, see [Evaluating an Alarm](https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/AlarmThatSendsEmail.html#alarm-evaluation) in the *Amazon CloudWatch User Guide* .
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-cloudwatch-alarm.html#cfn-cloudwatch-alarm-evaluationperiods
	//
	EvaluationPeriods *float64 `field:"required" json:"evaluationPeriods" yaml:"evaluationPeriods"`
	// Indicates whether actions should be executed during any changes to the alarm state.
	//
	// The default is TRUE.
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-cloudwatch-alarm.html#cfn-cloudwatch-alarm-actionsenabled
	//
	// Default: - true.
	//
	ActionsEnabled interface{} `field:"optional" json:"actionsEnabled" yaml:"actionsEnabled"`
	// The list of actions to execute when this alarm transitions into an ALARM state from any other state.
	//
	// Specify each action as an Amazon Resource Name (ARN). For more information about creating alarms and the actions that you can specify, see [PutMetricAlarm](https://docs.aws.amazon.com/AmazonCloudWatch/latest/APIReference/API_PutMetricAlarm.html) in the *Amazon CloudWatch API Reference* .
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-cloudwatch-alarm.html#cfn-cloudwatch-alarm-alarmactions
	//
	AlarmActions *[]*string `field:"optional" json:"alarmActions" yaml:"alarmActions"`
	// The description of the alarm.
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-cloudwatch-alarm.html#cfn-cloudwatch-alarm-alarmdescription
	//
	AlarmDescription *string `field:"optional" json:"alarmDescription" yaml:"alarmDescription"`
	// The name of the alarm.
	//
	// If you don't specify a name, AWS CloudFormation generates a unique physical ID and uses that ID for the alarm name.
	//
	// > If you specify a name, you cannot perform updates that require replacement of this resource. You can perform updates that require no or some interruption. If you must replace the resource, specify a new name.
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-cloudwatch-alarm.html#cfn-cloudwatch-alarm-alarmname
	//
	AlarmName *string `field:"optional" json:"alarmName" yaml:"alarmName"`
	// The number of datapoints that must be breaching to trigger the alarm.
	//
	// This is used only if you are setting an "M out of N" alarm. In that case, this value is the M, and the value that you set for `EvaluationPeriods` is the N value. For more information, see [Evaluating an Alarm](https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/AlarmThatSendsEmail.html#alarm-evaluation) in the *Amazon CloudWatch User Guide* .
	//
	// If you omit this parameter, CloudWatch uses the same value here that you set for `EvaluationPeriods` , and the alarm goes to alarm state if that many consecutive periods are breaching.
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-cloudwatch-alarm.html#cfn-cloudwatch-alarm-datapointstoalarm
	//
	DatapointsToAlarm *float64 `field:"optional" json:"datapointsToAlarm" yaml:"datapointsToAlarm"`
	// The dimensions for the metric associated with the alarm.
	//
	// For an alarm based on a math expression, you can't specify `Dimensions` . Instead, you use `Metrics` .
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-cloudwatch-alarm.html#cfn-cloudwatch-alarm-dimensions
	//
	Dimensions interface{} `field:"optional" json:"dimensions" yaml:"dimensions"`
	// Used only for alarms based on percentiles.
	//
	// If `ignore` , the alarm state does not change during periods with too few data points to be statistically significant. If `evaluate` or this parameter is not used, the alarm is always evaluated and possibly changes state no matter how many data points are available.
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-cloudwatch-alarm.html#cfn-cloudwatch-alarm-evaluatelowsamplecountpercentile
	//
	EvaluateLowSampleCountPercentile *string `field:"optional" json:"evaluateLowSampleCountPercentile" yaml:"evaluateLowSampleCountPercentile"`
	// The percentile statistic for the metric associated with the alarm. Specify a value between p0.0 and p100.
	//
	// For an alarm based on a metric, you must specify either `Statistic` or `ExtendedStatistic` but not both.
	//
	// For an alarm based on a math expression, you can't specify `ExtendedStatistic` . Instead, you use `Metrics` .
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-cloudwatch-alarm.html#cfn-cloudwatch-alarm-extendedstatistic
	//
	ExtendedStatistic *string `field:"optional" json:"extendedStatistic" yaml:"extendedStatistic"`
	// The actions to execute when this alarm transitions to the `INSUFFICIENT_DATA` state from any other state.
	//
	// Each action is specified as an Amazon Resource Name (ARN).
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-cloudwatch-alarm.html#cfn-cloudwatch-alarm-insufficientdataactions
	//
	InsufficientDataActions *[]*string `field:"optional" json:"insufficientDataActions" yaml:"insufficientDataActions"`
	// The name of the metric associated with the alarm.
	//
	// This is required for an alarm based on a metric. For an alarm based on a math expression, you use `Metrics` instead and you can't specify `MetricName` .
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-cloudwatch-alarm.html#cfn-cloudwatch-alarm-metricname
	//
	MetricName *string `field:"optional" json:"metricName" yaml:"metricName"`
	// An array that enables you to create an alarm based on the result of a metric math expression.
	//
	// Each item in the array either retrieves a metric or performs a math expression.
	//
	// If you specify the `Metrics` parameter, you cannot specify `MetricName` , `Dimensions` , `Period` , `Namespace` , `Statistic` , `ExtendedStatistic` , or `Unit` .
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-cloudwatch-alarm.html#cfn-cloudwatch-alarm-metrics
	//
	Metrics interface{} `field:"optional" json:"metrics" yaml:"metrics"`
	// The namespace of the metric associated with the alarm.
	//
	// This is required for an alarm based on a metric. For an alarm based on a math expression, you can't specify `Namespace` and you use `Metrics` instead.
	//
	// For a list of namespaces for metrics from AWS services, see [AWS Services That Publish CloudWatch Metrics.](https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/aws-services-cloudwatch-metrics.html)
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-cloudwatch-alarm.html#cfn-cloudwatch-alarm-namespace
	//
	Namespace *string `field:"optional" json:"namespace" yaml:"namespace"`
	// The actions to execute when this alarm transitions to the `OK` state from any other state.
	//
	// Each action is specified as an Amazon Resource Name (ARN).
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-cloudwatch-alarm.html#cfn-cloudwatch-alarm-okactions
	//
	OkActions *[]*string `field:"optional" json:"okActions" yaml:"okActions"`
	// The period, in seconds, over which the statistic is applied.
	//
	// This is required for an alarm based on a metric. Valid values are 10, 30, 60, and any multiple of 60.
	//
	// For an alarm based on a math expression, you can't specify `Period` , and instead you use the `Metrics` parameter.
	//
	// *Minimum:* 10.
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-cloudwatch-alarm.html#cfn-cloudwatch-alarm-period
	//
	Period *float64 `field:"optional" json:"period" yaml:"period"`
	// The statistic for the metric associated with the alarm, other than percentile. For percentile statistics, use `ExtendedStatistic` .
	//
	// For an alarm based on a metric, you must specify either `Statistic` or `ExtendedStatistic` but not both.
	//
	// For an alarm based on a math expression, you can't specify `Statistic` . Instead, you use `Metrics` .
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-cloudwatch-alarm.html#cfn-cloudwatch-alarm-statistic
	//
	Statistic *string `field:"optional" json:"statistic" yaml:"statistic"`
	// A list of key-value pairs to associate with the alarm.
	//
	// You can associate as many as 50 tags with an alarm. To be able to associate tags with the alarm when you create the alarm, you must have the `cloudwatch:TagResource` permission.
	//
	// Tags can help you organize and categorize your resources. You can also use them to scope user permissions by granting a user permission to access or change only resources with certain tag values.
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-cloudwatch-alarm.html#cfn-cloudwatch-alarm-tags
	//
	Tags *[]*awscdk.CfnTag `field:"optional" json:"tags" yaml:"tags"`
	// The value to compare with the specified statistic.
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-cloudwatch-alarm.html#cfn-cloudwatch-alarm-threshold
	//
	Threshold *float64 `field:"optional" json:"threshold" yaml:"threshold"`
	// In an alarm based on an anomaly detection model, this is the ID of the `ANOMALY_DETECTION_BAND` function used as the threshold for the alarm.
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-cloudwatch-alarm.html#cfn-cloudwatch-alarm-thresholdmetricid
	//
	ThresholdMetricId *string `field:"optional" json:"thresholdMetricId" yaml:"thresholdMetricId"`
	// Sets how this alarm is to handle missing data points.
	//
	// Valid values are `breaching` , `notBreaching` , `ignore` , and `missing` . For more information, see [Configuring How CloudWatch Alarms Treat Missing Data](https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/AlarmThatSendsEmail.html#alarms-and-missing-data) in the *Amazon CloudWatch User Guide* .
	//
	// If you omit this parameter, the default behavior of `missing` is used.
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-cloudwatch-alarm.html#cfn-cloudwatch-alarm-treatmissingdata
	//
	TreatMissingData *string `field:"optional" json:"treatMissingData" yaml:"treatMissingData"`
	// The unit of the metric associated with the alarm.
	//
	// Specify this only if you are creating an alarm based on a single metric. Do not specify this if you are specifying a `Metrics` array.
	//
	// You can specify the following values: 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, or None.
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-cloudwatch-alarm.html#cfn-cloudwatch-alarm-unit
	//
	Unit *string `field:"optional" json:"unit" yaml:"unit"`
}

Properties for defining a `CfnAlarm`.

Example:

// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"

cfnAlarmProps := &CfnAlarmProps{
	ComparisonOperator: jsii.String("comparisonOperator"),
	EvaluationPeriods: jsii.Number(123),

	// the properties below are optional
	ActionsEnabled: jsii.Boolean(false),
	AlarmActions: []*string{
		jsii.String("alarmActions"),
	},
	AlarmDescription: jsii.String("alarmDescription"),
	AlarmName: jsii.String("alarmName"),
	DatapointsToAlarm: jsii.Number(123),
	Dimensions: []interface{}{
		&DimensionProperty{
			Name: jsii.String("name"),
			Value: jsii.String("value"),
		},
	},
	EvaluateLowSampleCountPercentile: jsii.String("evaluateLowSampleCountPercentile"),
	ExtendedStatistic: jsii.String("extendedStatistic"),
	InsufficientDataActions: []*string{
		jsii.String("insufficientDataActions"),
	},
	MetricName: jsii.String("metricName"),
	Metrics: []interface{}{
		&MetricDataQueryProperty{
			Id: jsii.String("id"),

			// the properties below are optional
			AccountId: jsii.String("accountId"),
			Expression: jsii.String("expression"),
			Label: jsii.String("label"),
			MetricStat: &MetricStatProperty{
				Metric: &MetricProperty{
					Dimensions: []interface{}{
						&DimensionProperty{
							Name: jsii.String("name"),
							Value: jsii.String("value"),
						},
					},
					MetricName: jsii.String("metricName"),
					Namespace: jsii.String("namespace"),
				},
				Period: jsii.Number(123),
				Stat: jsii.String("stat"),

				// the properties below are optional
				Unit: jsii.String("unit"),
			},
			Period: jsii.Number(123),
			ReturnData: jsii.Boolean(false),
		},
	},
	Namespace: jsii.String("namespace"),
	OkActions: []*string{
		jsii.String("okActions"),
	},
	Period: jsii.Number(123),
	Statistic: jsii.String("statistic"),
	Tags: []cfnTag{
		&cfnTag{
			Key: jsii.String("key"),
			Value: jsii.String("value"),
		},
	},
	Threshold: jsii.Number(123),
	ThresholdMetricId: jsii.String("thresholdMetricId"),
	TreatMissingData: jsii.String("treatMissingData"),
	Unit: jsii.String("unit"),
}

See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-cloudwatch-alarm.html

type CfnAlarm_DimensionProperty

type CfnAlarm_DimensionProperty struct {
	// The name of the dimension, from 1–255 characters in length.
	//
	// This dimension name must have been included when the metric was published.
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudwatch-alarm-dimension.html#cfn-cloudwatch-alarm-dimension-name
	//
	Name *string `field:"required" json:"name" yaml:"name"`
	// The value for the dimension, from 1–255 characters in length.
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudwatch-alarm-dimension.html#cfn-cloudwatch-alarm-dimension-value
	//
	Value *string `field:"required" json:"value" yaml:"value"`
}

Dimension is an embedded property of the `AWS::CloudWatch::Alarm` type.

Dimensions are name/value pairs that can be associated with a CloudWatch metric. You can specify a maximum of 10 dimensions for a given metric.

Example:

// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"

dimensionProperty := &DimensionProperty{
	Name: jsii.String("name"),
	Value: jsii.String("value"),
}

See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudwatch-alarm-dimension.html

type CfnAlarm_MetricDataQueryProperty

type CfnAlarm_MetricDataQueryProperty struct {
	// A short name used to tie this object to the results in the response.
	//
	// This name must be unique within a single call to `GetMetricData` . If you are performing math expressions on this set of data, this name represents that data and can serve as a variable in the mathematical expression. The valid characters are letters, numbers, and underscore. The first character must be a lowercase letter.
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudwatch-alarm-metricdataquery.html#cfn-cloudwatch-alarm-metricdataquery-id
	//
	Id *string `field:"required" json:"id" yaml:"id"`
	// The ID of the account where the metrics are located, if this is a cross-account alarm.
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudwatch-alarm-metricdataquery.html#cfn-cloudwatch-alarm-metricdataquery-accountid
	//
	AccountId *string `field:"optional" json:"accountId" yaml:"accountId"`
	// The math expression to be performed on the returned data, if this object is performing a math expression.
	//
	// This expression can use the `Id` of the other metrics to refer to those metrics, and can also use the `Id` of other expressions to use the result of those expressions. For more information about metric math expressions, see [Metric Math Syntax and Functions](https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/using-metric-math.html#metric-math-syntax) in the *Amazon CloudWatch User Guide* .
	//
	// Within each MetricDataQuery object, you must specify either `Expression` or `MetricStat` but not both.
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudwatch-alarm-metricdataquery.html#cfn-cloudwatch-alarm-metricdataquery-expression
	//
	Expression *string `field:"optional" json:"expression" yaml:"expression"`
	// A human-readable label for this metric or expression.
	//
	// This is especially useful if this is an expression, so that you know what the value represents. If the metric or expression is shown in a CloudWatch dashboard widget, the label is shown. If `Label` is omitted, CloudWatch generates a default.
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudwatch-alarm-metricdataquery.html#cfn-cloudwatch-alarm-metricdataquery-label
	//
	Label *string `field:"optional" json:"label" yaml:"label"`
	// The metric to be returned, along with statistics, period, and units.
	//
	// Use this parameter only if this object is retrieving a metric and not performing a math expression on returned data.
	//
	// Within one MetricDataQuery object, you must specify either `Expression` or `MetricStat` but not both.
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudwatch-alarm-metricdataquery.html#cfn-cloudwatch-alarm-metricdataquery-metricstat
	//
	MetricStat interface{} `field:"optional" json:"metricStat" yaml:"metricStat"`
	// The granularity, in seconds, of the returned data points.
	//
	// For metrics with regular resolution, a period can be as short as one minute (60 seconds) and must be a multiple of 60. For high-resolution metrics that are collected at intervals of less than one minute, the period can be 1, 5, 10, 30, 60, or any multiple of 60. High-resolution metrics are those metrics stored by a `PutMetricData` operation that includes a `StorageResolution of 1 second` .
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudwatch-alarm-metricdataquery.html#cfn-cloudwatch-alarm-metricdataquery-period
	//
	Period *float64 `field:"optional" json:"period" yaml:"period"`
	// This option indicates whether to return the timestamps and raw data values of this metric.
	//
	// When you create an alarm based on a metric math expression, specify `True` for this value for only the one math expression that the alarm is based on. You must specify `False` for `ReturnData` for all the other metrics and expressions used in the alarm.
	//
	// This field is required.
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudwatch-alarm-metricdataquery.html#cfn-cloudwatch-alarm-metricdataquery-returndata
	//
	ReturnData interface{} `field:"optional" json:"returnData" yaml:"returnData"`
}

The `MetricDataQuery` property type specifies the metric data to return, and whether this call is just retrieving a batch set of data for one metric, or is performing a math expression on metric data.

Any expression used must return a single time series. For more information, see [Metric Math Syntax and Functions](https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/using-metric-math.html#metric-math-syntax) in the *Amazon CloudWatch User Guide* .

Example:

// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"

metricDataQueryProperty := &MetricDataQueryProperty{
	Id: jsii.String("id"),

	// the properties below are optional
	AccountId: jsii.String("accountId"),
	Expression: jsii.String("expression"),
	Label: jsii.String("label"),
	MetricStat: &MetricStatProperty{
		Metric: &MetricProperty{
			Dimensions: []interface{}{
				&DimensionProperty{
					Name: jsii.String("name"),
					Value: jsii.String("value"),
				},
			},
			MetricName: jsii.String("metricName"),
			Namespace: jsii.String("namespace"),
		},
		Period: jsii.Number(123),
		Stat: jsii.String("stat"),

		// the properties below are optional
		Unit: jsii.String("unit"),
	},
	Period: jsii.Number(123),
	ReturnData: jsii.Boolean(false),
}

See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudwatch-alarm-metricdataquery.html

type CfnAlarm_MetricProperty

type CfnAlarm_MetricProperty struct {
	// The metric dimensions that you want to be used for the metric that the alarm will watch.
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudwatch-alarm-metric.html#cfn-cloudwatch-alarm-metric-dimensions
	//
	Dimensions interface{} `field:"optional" json:"dimensions" yaml:"dimensions"`
	// The name of the metric that you want the alarm to watch.
	//
	// This is a required field.
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudwatch-alarm-metric.html#cfn-cloudwatch-alarm-metric-metricname
	//
	MetricName *string `field:"optional" json:"metricName" yaml:"metricName"`
	// The namespace of the metric that the alarm will watch.
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudwatch-alarm-metric.html#cfn-cloudwatch-alarm-metric-namespace
	//
	Namespace *string `field:"optional" json:"namespace" yaml:"namespace"`
}

The `Metric` property type represents a specific metric.

`Metric` is a property of the [MetricStat](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudwatch-alarm-metricstat.html) property type.

Example:

// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"

metricProperty := &MetricProperty{
	Dimensions: []interface{}{
		&DimensionProperty{
			Name: jsii.String("name"),
			Value: jsii.String("value"),
		},
	},
	MetricName: jsii.String("metricName"),
	Namespace: jsii.String("namespace"),
}

See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudwatch-alarm-metric.html

type CfnAlarm_MetricStatProperty

type CfnAlarm_MetricStatProperty struct {
	// The metric to return, including the metric name, namespace, and dimensions.
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudwatch-alarm-metricstat.html#cfn-cloudwatch-alarm-metricstat-metric
	//
	Metric interface{} `field:"required" json:"metric" yaml:"metric"`
	// The granularity, in seconds, of the returned data points.
	//
	// For metrics with regular resolution, a period can be as short as one minute (60 seconds) and must be a multiple of 60. For high-resolution metrics that are collected at intervals of less than one minute, the period can be 1, 5, 10, 30, 60, or any multiple of 60. High-resolution metrics are those metrics stored by a `PutMetricData` call that includes a `StorageResolution` of 1 second.
	//
	// If the `StartTime` parameter specifies a time stamp that is greater than 3 hours ago, you must specify the period as follows or no data points in that time range is returned:
	//
	// - Start time between 3 hours and 15 days ago - Use a multiple of 60 seconds (1 minute).
	// - Start time between 15 and 63 days ago - Use a multiple of 300 seconds (5 minutes).
	// - Start time greater than 63 days ago - Use a multiple of 3600 seconds (1 hour).
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudwatch-alarm-metricstat.html#cfn-cloudwatch-alarm-metricstat-period
	//
	Period *float64 `field:"required" json:"period" yaml:"period"`
	// The statistic to return.
	//
	// It can include any CloudWatch statistic or extended statistic. For a list of valid values, see the table in [Statistics](https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/cloudwatch_concepts.html#Statistic) in the *Amazon CloudWatch User Guide* .
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudwatch-alarm-metricstat.html#cfn-cloudwatch-alarm-metricstat-stat
	//
	Stat *string `field:"required" json:"stat" yaml:"stat"`
	// The unit to use for the returned data points.
	//
	// Valid values are: 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, or None.
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudwatch-alarm-metricstat.html#cfn-cloudwatch-alarm-metricstat-unit
	//
	Unit *string `field:"optional" json:"unit" yaml:"unit"`
}

This structure defines the metric to be returned, along with the statistics, period, and units.

`MetricStat` is a property of the [MetricDataQuery](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudwatch-alarm-metricdataquery.html) property type.

Example:

// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"

metricStatProperty := &MetricStatProperty{
	Metric: &MetricProperty{
		Dimensions: []interface{}{
			&DimensionProperty{
				Name: jsii.String("name"),
				Value: jsii.String("value"),
			},
		},
		MetricName: jsii.String("metricName"),
		Namespace: jsii.String("namespace"),
	},
	Period: jsii.Number(123),
	Stat: jsii.String("stat"),

	// the properties below are optional
	Unit: jsii.String("unit"),
}

See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudwatch-alarm-metricstat.html

type CfnAnomalyDetector

type CfnAnomalyDetector interface {
	awscdk.CfnResource
	awscdk.IInspectable
	AttrId() *string
	// Options for this resource, such as condition, update policy etc.
	CfnOptions() awscdk.ICfnResourceOptions
	CfnProperties() *map[string]interface{}
	// AWS resource type.
	CfnResourceType() *string
	// Specifies details about how the anomaly detection model is to be trained, including time ranges to exclude when training and updating the model.
	Configuration() interface{}
	SetConfiguration(val interface{})
	// Returns: the stack trace of the point where this Resource was created from, sourced
	// from the +metadata+ entry typed +aws:cdk:logicalId+, and with the bottom-most
	// node +internal+ entries filtered.
	CreationStack() *[]*string
	// The dimensions of the metric associated with the anomaly detection band.
	Dimensions() interface{}
	SetDimensions(val interface{})
	// The logical ID for this CloudFormation stack element.
	//
	// The logical ID of the element
	// is calculated from the path of the resource node in the construct tree.
	//
	// To override this value, use `overrideLogicalId(newLogicalId)`.
	//
	// Returns: the logical ID as a stringified token. This value will only get
	// resolved during synthesis.
	LogicalId() *string
	// Use this object to include parameters to provide information about your metric to CloudWatch to help it build more accurate anomaly detection models.
	MetricCharacteristics() interface{}
	SetMetricCharacteristics(val interface{})
	// The CloudWatch metric math expression for this anomaly detector.
	MetricMathAnomalyDetector() interface{}
	SetMetricMathAnomalyDetector(val interface{})
	// The name of the metric associated with the anomaly detection band.
	MetricName() *string
	SetMetricName(val *string)
	// The namespace of the metric associated with the anomaly detection band.
	Namespace() *string
	SetNamespace(val *string)
	// The tree node.
	Node() constructs.Node
	// Return a string that will be resolved to a CloudFormation `{ Ref }` for this element.
	//
	// If, by any chance, the intrinsic reference of a resource is not a string, you could
	// coerce it to an IResolvable through `Lazy.any({ produce: resource.ref })`.
	Ref() *string
	// The CloudWatch metric and statistic for this anomaly detector.
	SingleMetricAnomalyDetector() interface{}
	SetSingleMetricAnomalyDetector(val interface{})
	// The stack in which this element is defined.
	//
	// CfnElements must be defined within a stack scope (directly or indirectly).
	Stack() awscdk.Stack
	// The statistic of the metric associated with the anomaly detection band.
	Stat() *string
	SetStat(val *string)
	// Deprecated.
	// Deprecated: use `updatedProperties`
	//
	// Return properties modified after initiation
	//
	// Resources that expose mutable properties should override this function to
	// collect and return the properties object for this resource.
	UpdatedProperites() *map[string]interface{}
	// Return properties modified after initiation.
	//
	// Resources that expose mutable properties should override this function to
	// collect and return the properties object for this resource.
	UpdatedProperties() *map[string]interface{}
	// Syntactic sugar for `addOverride(path, undefined)`.
	AddDeletionOverride(path *string)
	// Indicates that this resource depends on another resource and cannot be provisioned unless the other resource has been successfully provisioned.
	//
	// This can be used for resources across stacks (or nested stack) boundaries
	// and the dependency will automatically be transferred to the relevant scope.
	AddDependency(target awscdk.CfnResource)
	// Indicates that this resource depends on another resource and cannot be provisioned unless the other resource has been successfully provisioned.
	// Deprecated: use addDependency.
	AddDependsOn(target awscdk.CfnResource)
	// Add a value to the CloudFormation Resource Metadata.
	// See: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/metadata-section-structure.html
	//
	// Note that this is a different set of metadata from CDK node metadata; this
	// metadata ends up in the stack template under the resource, whereas CDK
	// node metadata ends up in the Cloud Assembly.
	//
	AddMetadata(key *string, value interface{})
	// Adds an override to the synthesized CloudFormation resource.
	//
	// To add a
	// property override, either use `addPropertyOverride` or prefix `path` with
	// "Properties." (i.e. `Properties.TopicName`).
	//
	// If the override is nested, separate each nested level using a dot (.) in the path parameter.
	// If there is an array as part of the nesting, specify the index in the path.
	//
	// To include a literal `.` in the property name, prefix with a `\`. In most
	// programming languages you will need to write this as `"\\."` because the
	// `\` itself will need to be escaped.
	//
	// For example,
	// “`typescript
	// cfnResource.addOverride('Properties.GlobalSecondaryIndexes.0.Projection.NonKeyAttributes', ['myattribute']);
	// cfnResource.addOverride('Properties.GlobalSecondaryIndexes.1.ProjectionType', 'INCLUDE');
	// “`
	// would add the overrides
	// “`json
	// "Properties": {
	//   "GlobalSecondaryIndexes": [
	//     {
	//       "Projection": {
	//         "NonKeyAttributes": [ "myattribute" ]
	//         ...
	//       }
	//       ...
	//     },
	//     {
	//       "ProjectionType": "INCLUDE"
	//       ...
	//     },
	//   ]
	//   ...
	// }
	// “`
	//
	// The `value` argument to `addOverride` will not be processed or translated
	// in any way. Pass raw JSON values in here with the correct capitalization
	// for CloudFormation. If you pass CDK classes or structs, they will be
	// rendered with lowercased key names, and CloudFormation will reject the
	// template.
	AddOverride(path *string, value interface{})
	// Adds an override that deletes the value of a property from the resource definition.
	AddPropertyDeletionOverride(propertyPath *string)
	// Adds an override to a resource property.
	//
	// Syntactic sugar for `addOverride("Properties.<...>", value)`.
	AddPropertyOverride(propertyPath *string, value interface{})
	// Sets the deletion policy of the resource based on the removal policy specified.
	//
	// The Removal Policy controls what happens to this resource when it stops
	// being managed by CloudFormation, either because you've removed it from the
	// CDK application or because you've made a change that requires the resource
	// to be replaced.
	//
	// The resource can be deleted (`RemovalPolicy.DESTROY`), or left in your AWS
	// account for data recovery and cleanup later (`RemovalPolicy.RETAIN`). In some
	// cases, a snapshot can be taken of the resource prior to deletion
	// (`RemovalPolicy.SNAPSHOT`). A list of resources that support this policy
	// can be found in the following link:.
	// See: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-deletionpolicy.html#aws-attribute-deletionpolicy-options
	//
	ApplyRemovalPolicy(policy awscdk.RemovalPolicy, options *awscdk.RemovalPolicyOptions)
	// Returns a token for an runtime attribute of this resource.
	//
	// Ideally, use generated attribute accessors (e.g. `resource.arn`), but this can be used for future compatibility
	// in case there is no generated attribute.
	GetAtt(attributeName *string, typeHint awscdk.ResolutionTypeHint) awscdk.Reference
	// Retrieve a value value from the CloudFormation Resource Metadata.
	// See: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/metadata-section-structure.html
	//
	// Note that this is a different set of metadata from CDK node metadata; this
	// metadata ends up in the stack template under the resource, whereas CDK
	// node metadata ends up in the Cloud Assembly.
	//
	GetMetadata(key *string) interface{}
	// Examines the CloudFormation resource and discloses attributes.
	Inspect(inspector awscdk.TreeInspector)
	// Retrieves an array of resources this resource depends on.
	//
	// This assembles dependencies on resources across stacks (including nested stacks)
	// automatically.
	ObtainDependencies() *[]interface{}
	// Get a shallow copy of dependencies between this resource and other resources in the same stack.
	ObtainResourceDependencies() *[]awscdk.CfnResource
	// Overrides the auto-generated logical ID with a specific ID.
	OverrideLogicalId(newLogicalId *string)
	// Indicates that this resource no longer depends on another resource.
	//
	// This can be used for resources across stacks (including nested stacks)
	// and the dependency will automatically be removed from the relevant scope.
	RemoveDependency(target awscdk.CfnResource)
	RenderProperties(props *map[string]interface{}) *map[string]interface{}
	// Replaces one dependency with another.
	ReplaceDependency(target awscdk.CfnResource, newTarget awscdk.CfnResource)
	// Can be overridden by subclasses to determine if this resource will be rendered into the cloudformation template.
	//
	// Returns: `true` if the resource should be included or `false` is the resource
	// should be omitted.
	ShouldSynthesize() *bool
	// Returns a string representation of this construct.
	//
	// Returns: a string representation of this resource.
	ToString() *string
	ValidateProperties(_properties interface{})
}

The `AWS::CloudWatch::AnomalyDetector` type specifies an anomaly detection band for a certain metric and statistic.

The band represents the expected "normal" range for the metric values. Anomaly detection bands can be used for visualization of a metric's expected values, and for alarms.

For more information see [Using CloudWatch anomaly detection.](https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/CloudWatch_Anomaly_Detection.html) .

Example:

// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"

cfnAnomalyDetector := awscdk.Aws_cloudwatch.NewCfnAnomalyDetector(this, jsii.String("MyCfnAnomalyDetector"), &CfnAnomalyDetectorProps{
	Configuration: &ConfigurationProperty{
		ExcludedTimeRanges: []interface{}{
			&RangeProperty{
				EndTime: jsii.String("endTime"),
				StartTime: jsii.String("startTime"),
			},
		},
		MetricTimeZone: jsii.String("metricTimeZone"),
	},
	Dimensions: []interface{}{
		&DimensionProperty{
			Name: jsii.String("name"),
			Value: jsii.String("value"),
		},
	},
	MetricCharacteristics: &MetricCharacteristicsProperty{
		PeriodicSpikes: jsii.Boolean(false),
	},
	MetricMathAnomalyDetector: &MetricMathAnomalyDetectorProperty{
		MetricDataQueries: []interface{}{
			&MetricDataQueryProperty{
				Id: jsii.String("id"),

				// the properties below are optional
				AccountId: jsii.String("accountId"),
				Expression: jsii.String("expression"),
				Label: jsii.String("label"),
				MetricStat: &MetricStatProperty{
					Metric: &MetricProperty{
						MetricName: jsii.String("metricName"),
						Namespace: jsii.String("namespace"),

						// the properties below are optional
						Dimensions: []interface{}{
							&DimensionProperty{
								Name: jsii.String("name"),
								Value: jsii.String("value"),
							},
						},
					},
					Period: jsii.Number(123),
					Stat: jsii.String("stat"),

					// the properties below are optional
					Unit: jsii.String("unit"),
				},
				Period: jsii.Number(123),
				ReturnData: jsii.Boolean(false),
			},
		},
	},
	MetricName: jsii.String("metricName"),
	Namespace: jsii.String("namespace"),
	SingleMetricAnomalyDetector: &SingleMetricAnomalyDetectorProperty{
		AccountId: jsii.String("accountId"),
		Dimensions: []interface{}{
			&DimensionProperty{
				Name: jsii.String("name"),
				Value: jsii.String("value"),
			},
		},
		MetricName: jsii.String("metricName"),
		Namespace: jsii.String("namespace"),
		Stat: jsii.String("stat"),
	},
	Stat: jsii.String("stat"),
})

See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-cloudwatch-anomalydetector.html

func NewCfnAnomalyDetector

func NewCfnAnomalyDetector(scope constructs.Construct, id *string, props *CfnAnomalyDetectorProps) CfnAnomalyDetector

type CfnAnomalyDetectorProps

type CfnAnomalyDetectorProps struct {
	// Specifies details about how the anomaly detection model is to be trained, including time ranges to exclude when training and updating the model.
	//
	// The configuration can also include the time zone to use for the metric.
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-cloudwatch-anomalydetector.html#cfn-cloudwatch-anomalydetector-configuration
	//
	Configuration interface{} `field:"optional" json:"configuration" yaml:"configuration"`
	// The dimensions of the metric associated with the anomaly detection band.
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-cloudwatch-anomalydetector.html#cfn-cloudwatch-anomalydetector-dimensions
	//
	Dimensions interface{} `field:"optional" json:"dimensions" yaml:"dimensions"`
	// Use this object to include parameters to provide information about your metric to CloudWatch to help it build more accurate anomaly detection models.
	//
	// Currently, it includes the `PeriodicSpikes` parameter.
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-cloudwatch-anomalydetector.html#cfn-cloudwatch-anomalydetector-metriccharacteristics
	//
	MetricCharacteristics interface{} `field:"optional" json:"metricCharacteristics" yaml:"metricCharacteristics"`
	// The CloudWatch metric math expression for this anomaly detector.
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-cloudwatch-anomalydetector.html#cfn-cloudwatch-anomalydetector-metricmathanomalydetector
	//
	MetricMathAnomalyDetector interface{} `field:"optional" json:"metricMathAnomalyDetector" yaml:"metricMathAnomalyDetector"`
	// The name of the metric associated with the anomaly detection band.
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-cloudwatch-anomalydetector.html#cfn-cloudwatch-anomalydetector-metricname
	//
	MetricName *string `field:"optional" json:"metricName" yaml:"metricName"`
	// The namespace of the metric associated with the anomaly detection band.
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-cloudwatch-anomalydetector.html#cfn-cloudwatch-anomalydetector-namespace
	//
	Namespace *string `field:"optional" json:"namespace" yaml:"namespace"`
	// The CloudWatch metric and statistic for this anomaly detector.
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-cloudwatch-anomalydetector.html#cfn-cloudwatch-anomalydetector-singlemetricanomalydetector
	//
	SingleMetricAnomalyDetector interface{} `field:"optional" json:"singleMetricAnomalyDetector" yaml:"singleMetricAnomalyDetector"`
	// The statistic of the metric associated with the anomaly detection band.
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-cloudwatch-anomalydetector.html#cfn-cloudwatch-anomalydetector-stat
	//
	Stat *string `field:"optional" json:"stat" yaml:"stat"`
}

Properties for defining a `CfnAnomalyDetector`.

Example:

// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"

cfnAnomalyDetectorProps := &CfnAnomalyDetectorProps{
	Configuration: &ConfigurationProperty{
		ExcludedTimeRanges: []interface{}{
			&RangeProperty{
				EndTime: jsii.String("endTime"),
				StartTime: jsii.String("startTime"),
			},
		},
		MetricTimeZone: jsii.String("metricTimeZone"),
	},
	Dimensions: []interface{}{
		&DimensionProperty{
			Name: jsii.String("name"),
			Value: jsii.String("value"),
		},
	},
	MetricCharacteristics: &MetricCharacteristicsProperty{
		PeriodicSpikes: jsii.Boolean(false),
	},
	MetricMathAnomalyDetector: &MetricMathAnomalyDetectorProperty{
		MetricDataQueries: []interface{}{
			&MetricDataQueryProperty{
				Id: jsii.String("id"),

				// the properties below are optional
				AccountId: jsii.String("accountId"),
				Expression: jsii.String("expression"),
				Label: jsii.String("label"),
				MetricStat: &MetricStatProperty{
					Metric: &MetricProperty{
						MetricName: jsii.String("metricName"),
						Namespace: jsii.String("namespace"),

						// the properties below are optional
						Dimensions: []interface{}{
							&DimensionProperty{
								Name: jsii.String("name"),
								Value: jsii.String("value"),
							},
						},
					},
					Period: jsii.Number(123),
					Stat: jsii.String("stat"),

					// the properties below are optional
					Unit: jsii.String("unit"),
				},
				Period: jsii.Number(123),
				ReturnData: jsii.Boolean(false),
			},
		},
	},
	MetricName: jsii.String("metricName"),
	Namespace: jsii.String("namespace"),
	SingleMetricAnomalyDetector: &SingleMetricAnomalyDetectorProperty{
		AccountId: jsii.String("accountId"),
		Dimensions: []interface{}{
			&DimensionProperty{
				Name: jsii.String("name"),
				Value: jsii.String("value"),
			},
		},
		MetricName: jsii.String("metricName"),
		Namespace: jsii.String("namespace"),
		Stat: jsii.String("stat"),
	},
	Stat: jsii.String("stat"),
}

See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-cloudwatch-anomalydetector.html

type CfnAnomalyDetector_ConfigurationProperty

type CfnAnomalyDetector_ConfigurationProperty struct {
	// Specifies an array of time ranges to exclude from use when the anomaly detection model is trained and updated.
	//
	// Use this to make sure that events that could cause unusual values for the metric, such as deployments, aren't used when CloudWatch creates or updates the model.
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudwatch-anomalydetector-configuration.html#cfn-cloudwatch-anomalydetector-configuration-excludedtimeranges
	//
	ExcludedTimeRanges interface{} `field:"optional" json:"excludedTimeRanges" yaml:"excludedTimeRanges"`
	// The time zone to use for the metric.
	//
	// This is useful to enable the model to automatically account for daylight savings time changes if the metric is sensitive to such time changes.
	//
	// To specify a time zone, use the name of the time zone as specified in the standard tz database. For more information, see [tz database](https://docs.aws.amazon.com/https://en.wikipedia.org/wiki/Tz_database) .
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudwatch-anomalydetector-configuration.html#cfn-cloudwatch-anomalydetector-configuration-metrictimezone
	//
	MetricTimeZone *string `field:"optional" json:"metricTimeZone" yaml:"metricTimeZone"`
}

Specifies details about how the anomaly detection model is to be trained, including time ranges to exclude when training and updating the model.

The configuration can also include the time zone to use for the metric.

Example:

// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"

configurationProperty := &ConfigurationProperty{
	ExcludedTimeRanges: []interface{}{
		&RangeProperty{
			EndTime: jsii.String("endTime"),
			StartTime: jsii.String("startTime"),
		},
	},
	MetricTimeZone: jsii.String("metricTimeZone"),
}

See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudwatch-anomalydetector-configuration.html

type CfnAnomalyDetector_DimensionProperty

type CfnAnomalyDetector_DimensionProperty struct {
	// The name of the dimension.
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudwatch-anomalydetector-dimension.html#cfn-cloudwatch-anomalydetector-dimension-name
	//
	Name *string `field:"required" json:"name" yaml:"name"`
	// The value of the dimension.
	//
	// Dimension values must contain only ASCII characters and must include at least one non-whitespace character. ASCII control characters are not supported as part of dimension values.
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudwatch-anomalydetector-dimension.html#cfn-cloudwatch-anomalydetector-dimension-value
	//
	Value *string `field:"required" json:"value" yaml:"value"`
}

A dimension is a name/value pair that is part of the identity of a metric.

Because dimensions are part of the unique identifier for a metric, whenever you add a unique name/value pair to one of your metrics, you are creating a new variation of that metric. For example, many Amazon EC2 metrics publish `InstanceId` as a dimension name, and the actual instance ID as the value for that dimension.

You can assign up to 30 dimensions to a metric.

Example:

// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"

dimensionProperty := &DimensionProperty{
	Name: jsii.String("name"),
	Value: jsii.String("value"),
}

See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudwatch-anomalydetector-dimension.html

type CfnAnomalyDetector_MetricCharacteristicsProperty added in v2.139.0

type CfnAnomalyDetector_MetricCharacteristicsProperty struct {
	// Set this parameter to true if values for this metric consistently include spikes that should not be considered to be anomalies.
	//
	// With this set to true, CloudWatch will expect to see spikes that occurred consistently during the model training period, and won't flag future similar spikes as anomalies.
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudwatch-anomalydetector-metriccharacteristics.html#cfn-cloudwatch-anomalydetector-metriccharacteristics-periodicspikes
	//
	PeriodicSpikes interface{} `field:"optional" json:"periodicSpikes" yaml:"periodicSpikes"`
}

This object includes parameters that you can use to provide information to CloudWatch to help it build more accurate anomaly detection models.

Example:

// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"

metricCharacteristicsProperty := &MetricCharacteristicsProperty{
	PeriodicSpikes: jsii.Boolean(false),
}

See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudwatch-anomalydetector-metriccharacteristics.html

type CfnAnomalyDetector_MetricDataQueryProperty

type CfnAnomalyDetector_MetricDataQueryProperty struct {
	// A short name used to tie this object to the results in the response.
	//
	// This name must be unique within a single call to `GetMetricData` . If you are performing math expressions on this set of data, this name represents that data and can serve as a variable in the mathematical expression. The valid characters are letters, numbers, and underscore. The first character must be a lowercase letter.
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudwatch-anomalydetector-metricdataquery.html#cfn-cloudwatch-anomalydetector-metricdataquery-id
	//
	Id *string `field:"required" json:"id" yaml:"id"`
	// The ID of the account where the metrics are located.
	//
	// If you are performing a `GetMetricData` operation in a monitoring account, use this to specify which account to retrieve this metric from.
	//
	// If you are performing a `PutMetricAlarm` operation, use this to specify which account contains the metric that the alarm is watching.
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudwatch-anomalydetector-metricdataquery.html#cfn-cloudwatch-anomalydetector-metricdataquery-accountid
	//
	AccountId *string `field:"optional" json:"accountId" yaml:"accountId"`
	// This field can contain either a Metrics Insights query, or a metric math expression to be performed on the returned data.
	//
	// For more information about Metrics Insights queries, see [Metrics Insights query components and syntax](https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/cloudwatch-metrics-insights-querylanguage) in the *Amazon CloudWatch User Guide* .
	//
	// A math expression can use the `Id` of the other metrics or queries to refer to those metrics, and can also use the `Id` of other expressions to use the result of those expressions. For more information about metric math expressions, see [Metric Math Syntax and Functions](https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/using-metric-math.html#metric-math-syntax) in the *Amazon CloudWatch User Guide* .
	//
	// Within each MetricDataQuery object, you must specify either `Expression` or `MetricStat` but not both.
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudwatch-anomalydetector-metricdataquery.html#cfn-cloudwatch-anomalydetector-metricdataquery-expression
	//
	Expression *string `field:"optional" json:"expression" yaml:"expression"`
	// A human-readable label for this metric or expression.
	//
	// This is especially useful if this is an expression, so that you know what the value represents. If the metric or expression is shown in a CloudWatch dashboard widget, the label is shown. If Label is omitted, CloudWatch generates a default.
	//
	// You can put dynamic expressions into a label, so that it is more descriptive. For more information, see [Using Dynamic Labels](https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/graph-dynamic-labels.html) .
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudwatch-anomalydetector-metricdataquery.html#cfn-cloudwatch-anomalydetector-metricdataquery-label
	//
	Label *string `field:"optional" json:"label" yaml:"label"`
	// The metric to be returned, along with statistics, period, and units.
	//
	// Use this parameter only if this object is retrieving a metric and not performing a math expression on returned data.
	//
	// Within one MetricDataQuery object, you must specify either `Expression` or `MetricStat` but not both.
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudwatch-anomalydetector-metricdataquery.html#cfn-cloudwatch-anomalydetector-metricdataquery-metricstat
	//
	MetricStat interface{} `field:"optional" json:"metricStat" yaml:"metricStat"`
	// The granularity, in seconds, of the returned data points.
	//
	// For metrics with regular resolution, a period can be as short as one minute (60 seconds) and must be a multiple of 60. For high-resolution metrics that are collected at intervals of less than one minute, the period can be 1, 5, 10, 30, 60, or any multiple of 60. High-resolution metrics are those metrics stored by a `PutMetricData` operation that includes a `StorageResolution of 1 second` .
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudwatch-anomalydetector-metricdataquery.html#cfn-cloudwatch-anomalydetector-metricdataquery-period
	//
	Period *float64 `field:"optional" json:"period" yaml:"period"`
	// When used in `GetMetricData` , this option indicates whether to return the timestamps and raw data values of this metric.
	//
	// If you are performing this call just to do math expressions and do not also need the raw data returned, you can specify `false` . If you omit this, the default of `true` is used.
	//
	// When used in `PutMetricAlarm` , specify `true` for the one expression result to use as the alarm. For all other metrics and expressions in the same `PutMetricAlarm` operation, specify `ReturnData` as False.
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudwatch-anomalydetector-metricdataquery.html#cfn-cloudwatch-anomalydetector-metricdataquery-returndata
	//
	ReturnData interface{} `field:"optional" json:"returnData" yaml:"returnData"`
}

This structure is used in both `GetMetricData` and `PutMetricAlarm` .

The supported use of this structure is different for those two operations.

When used in `GetMetricData` , it indicates the metric data to return, and whether this call is just retrieving a batch set of data for one metric, or is performing a Metrics Insights query or a math expression. A single `GetMetricData` call can include up to 500 `MetricDataQuery` structures.

When used in `PutMetricAlarm` , it enables you to create an alarm based on a metric math expression. Each `MetricDataQuery` in the array specifies either a metric to retrieve, or a math expression to be performed on retrieved metrics. A single `PutMetricAlarm` call can include up to 20 `MetricDataQuery` structures in the array. The 20 structures can include as many as 10 structures that contain a `MetricStat` parameter to retrieve a metric, and as many as 10 structures that contain the `Expression` parameter to perform a math expression. Of those `Expression` structures, one must have `true` as the value for `ReturnData` . The result of this expression is the value the alarm watches.

Any expression used in a `PutMetricAlarm` operation must return a single time series. For more information, see [Metric Math Syntax and Functions](https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/using-metric-math.html#metric-math-syntax) in the *Amazon CloudWatch User Guide* .

Some of the parameters of this structure also have different uses whether you are using this structure in a `GetMetricData` operation or a `PutMetricAlarm` operation. These differences are explained in the following parameter list.

Example:

// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"

metricDataQueryProperty := &MetricDataQueryProperty{
	Id: jsii.String("id"),

	// the properties below are optional
	AccountId: jsii.String("accountId"),
	Expression: jsii.String("expression"),
	Label: jsii.String("label"),
	MetricStat: &MetricStatProperty{
		Metric: &MetricProperty{
			MetricName: jsii.String("metricName"),
			Namespace: jsii.String("namespace"),

			// the properties below are optional
			Dimensions: []interface{}{
				&DimensionProperty{
					Name: jsii.String("name"),
					Value: jsii.String("value"),
				},
			},
		},
		Period: jsii.Number(123),
		Stat: jsii.String("stat"),

		// the properties below are optional
		Unit: jsii.String("unit"),
	},
	Period: jsii.Number(123),
	ReturnData: jsii.Boolean(false),
}

See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudwatch-anomalydetector-metricdataquery.html

type CfnAnomalyDetector_MetricMathAnomalyDetectorProperty

type CfnAnomalyDetector_MetricMathAnomalyDetectorProperty struct {
	// An array of metric data query structures that enables you to create an anomaly detector based on the result of a metric math expression.
	//
	// Each item in `MetricDataQueries` gets a metric or performs a math expression. One item in `MetricDataQueries` is the expression that provides the time series that the anomaly detector uses as input. Designate the expression by setting `ReturnData` to `true` for this object in the array. For all other expressions and metrics, set `ReturnData` to `false` . The designated expression must return a single time series.
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudwatch-anomalydetector-metricmathanomalydetector.html#cfn-cloudwatch-anomalydetector-metricmathanomalydetector-metricdataqueries
	//
	MetricDataQueries interface{} `field:"optional" json:"metricDataQueries" yaml:"metricDataQueries"`
}

Indicates the CloudWatch math expression that provides the time series the anomaly detector uses as input.

The designated math expression must return a single time series.

Example:

// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"

metricMathAnomalyDetectorProperty := &MetricMathAnomalyDetectorProperty{
	MetricDataQueries: []interface{}{
		&MetricDataQueryProperty{
			Id: jsii.String("id"),

			// the properties below are optional
			AccountId: jsii.String("accountId"),
			Expression: jsii.String("expression"),
			Label: jsii.String("label"),
			MetricStat: &MetricStatProperty{
				Metric: &MetricProperty{
					MetricName: jsii.String("metricName"),
					Namespace: jsii.String("namespace"),

					// the properties below are optional
					Dimensions: []interface{}{
						&DimensionProperty{
							Name: jsii.String("name"),
							Value: jsii.String("value"),
						},
					},
				},
				Period: jsii.Number(123),
				Stat: jsii.String("stat"),

				// the properties below are optional
				Unit: jsii.String("unit"),
			},
			Period: jsii.Number(123),
			ReturnData: jsii.Boolean(false),
		},
	},
}

See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudwatch-anomalydetector-metricmathanomalydetector.html

type CfnAnomalyDetector_MetricProperty

type CfnAnomalyDetector_MetricProperty struct {
	// The name of the metric.
	//
	// This is a required field.
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudwatch-anomalydetector-metric.html#cfn-cloudwatch-anomalydetector-metric-metricname
	//
	MetricName *string `field:"required" json:"metricName" yaml:"metricName"`
	// The namespace of the metric.
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudwatch-anomalydetector-metric.html#cfn-cloudwatch-anomalydetector-metric-namespace
	//
	Namespace *string `field:"required" json:"namespace" yaml:"namespace"`
	// The dimensions for the metric.
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudwatch-anomalydetector-metric.html#cfn-cloudwatch-anomalydetector-metric-dimensions
	//
	Dimensions interface{} `field:"optional" json:"dimensions" yaml:"dimensions"`
}

Represents a specific metric.

Example:

// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"

metricProperty := &MetricProperty{
	MetricName: jsii.String("metricName"),
	Namespace: jsii.String("namespace"),

	// the properties below are optional
	Dimensions: []interface{}{
		&DimensionProperty{
			Name: jsii.String("name"),
			Value: jsii.String("value"),
		},
	},
}

See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudwatch-anomalydetector-metric.html

type CfnAnomalyDetector_MetricStatProperty

type CfnAnomalyDetector_MetricStatProperty struct {
	// The metric to return, including the metric name, namespace, and dimensions.
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudwatch-anomalydetector-metricstat.html#cfn-cloudwatch-anomalydetector-metricstat-metric
	//
	Metric interface{} `field:"required" json:"metric" yaml:"metric"`
	// The granularity, in seconds, of the returned data points.
	//
	// For metrics with regular resolution, a period can be as short as one minute (60 seconds) and must be a multiple of 60. For high-resolution metrics that are collected at intervals of less than one minute, the period can be 1, 5, 10, 30, 60, or any multiple of 60. High-resolution metrics are those metrics stored by a `PutMetricData` call that includes a `StorageResolution` of 1 second.
	//
	// If the `StartTime` parameter specifies a time stamp that is greater than 3 hours ago, you must specify the period as follows or no data points in that time range is returned:
	//
	// - Start time between 3 hours and 15 days ago - Use a multiple of 60 seconds (1 minute).
	// - Start time between 15 and 63 days ago - Use a multiple of 300 seconds (5 minutes).
	// - Start time greater than 63 days ago - Use a multiple of 3600 seconds (1 hour).
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudwatch-anomalydetector-metricstat.html#cfn-cloudwatch-anomalydetector-metricstat-period
	//
	Period *float64 `field:"required" json:"period" yaml:"period"`
	// The statistic to return.
	//
	// It can include any CloudWatch statistic or extended statistic.
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudwatch-anomalydetector-metricstat.html#cfn-cloudwatch-anomalydetector-metricstat-stat
	//
	Stat *string `field:"required" json:"stat" yaml:"stat"`
	// When you are using a `Put` operation, this defines what unit you want to use when storing the metric.
	//
	// In a `Get` operation, if you omit `Unit` then all data that was collected with any unit is returned, along with the corresponding units that were specified when the data was reported to CloudWatch. If you specify a unit, the operation returns only data that was collected with that unit specified. If you specify a unit that does not match the data collected, the results of the operation are null. CloudWatch does not perform unit conversions.
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudwatch-anomalydetector-metricstat.html#cfn-cloudwatch-anomalydetector-metricstat-unit
	//
	Unit *string `field:"optional" json:"unit" yaml:"unit"`
}

This structure defines the metric to be returned, along with the statistics, period, and units.

Example:

// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"

metricStatProperty := &MetricStatProperty{
	Metric: &MetricProperty{
		MetricName: jsii.String("metricName"),
		Namespace: jsii.String("namespace"),

		// the properties below are optional
		Dimensions: []interface{}{
			&DimensionProperty{
				Name: jsii.String("name"),
				Value: jsii.String("value"),
			},
		},
	},
	Period: jsii.Number(123),
	Stat: jsii.String("stat"),

	// the properties below are optional
	Unit: jsii.String("unit"),
}

See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudwatch-anomalydetector-metricstat.html

type CfnAnomalyDetector_RangeProperty

type CfnAnomalyDetector_RangeProperty struct {
	// The end time of the range to exclude.
	//
	// The format is `yyyy-MM-dd'T'HH:mm:ss` . For example, `2019-07-01T23:59:59` .
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudwatch-anomalydetector-range.html#cfn-cloudwatch-anomalydetector-range-endtime
	//
	EndTime *string `field:"required" json:"endTime" yaml:"endTime"`
	// The start time of the range to exclude.
	//
	// The format is `yyyy-MM-dd'T'HH:mm:ss` . For example, `2019-07-01T23:59:59` .
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudwatch-anomalydetector-range.html#cfn-cloudwatch-anomalydetector-range-starttime
	//
	StartTime *string `field:"required" json:"startTime" yaml:"startTime"`
}

Each `Range` specifies one range of days or times to exclude from use for training or updating an anomaly detection model.

Example:

// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"

rangeProperty := &RangeProperty{
	EndTime: jsii.String("endTime"),
	StartTime: jsii.String("startTime"),
}

See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudwatch-anomalydetector-range.html

type CfnAnomalyDetector_SingleMetricAnomalyDetectorProperty

type CfnAnomalyDetector_SingleMetricAnomalyDetectorProperty struct {
	// If the CloudWatch metric that provides the time series that the anomaly detector uses as input is in another account, specify that account ID here.
	//
	// If you omit this parameter, the current account is used.
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudwatch-anomalydetector-singlemetricanomalydetector.html#cfn-cloudwatch-anomalydetector-singlemetricanomalydetector-accountid
	//
	AccountId *string `field:"optional" json:"accountId" yaml:"accountId"`
	// The metric dimensions to create the anomaly detection model for.
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudwatch-anomalydetector-singlemetricanomalydetector.html#cfn-cloudwatch-anomalydetector-singlemetricanomalydetector-dimensions
	//
	Dimensions interface{} `field:"optional" json:"dimensions" yaml:"dimensions"`
	// The name of the metric to create the anomaly detection model for.
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudwatch-anomalydetector-singlemetricanomalydetector.html#cfn-cloudwatch-anomalydetector-singlemetricanomalydetector-metricname
	//
	MetricName *string `field:"optional" json:"metricName" yaml:"metricName"`
	// The namespace of the metric to create the anomaly detection model for.
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudwatch-anomalydetector-singlemetricanomalydetector.html#cfn-cloudwatch-anomalydetector-singlemetricanomalydetector-namespace
	//
	Namespace *string `field:"optional" json:"namespace" yaml:"namespace"`
	// The statistic to use for the metric and anomaly detection model.
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudwatch-anomalydetector-singlemetricanomalydetector.html#cfn-cloudwatch-anomalydetector-singlemetricanomalydetector-stat
	//
	Stat *string `field:"optional" json:"stat" yaml:"stat"`
}

Designates the CloudWatch metric and statistic that provides the time series the anomaly detector uses as input.

If you have enabled unified cross-account observability, and this account is a monitoring account, the metric can be in the same account or a source account.

Example:

// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"

singleMetricAnomalyDetectorProperty := &SingleMetricAnomalyDetectorProperty{
	AccountId: jsii.String("accountId"),
	Dimensions: []interface{}{
		&DimensionProperty{
			Name: jsii.String("name"),
			Value: jsii.String("value"),
		},
	},
	MetricName: jsii.String("metricName"),
	Namespace: jsii.String("namespace"),
	Stat: jsii.String("stat"),
}

See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudwatch-anomalydetector-singlemetricanomalydetector.html

type CfnCompositeAlarm

type CfnCompositeAlarm interface {
	awscdk.CfnResource
	awscdk.IInspectable
	awscdk.ITaggableV2
	// Indicates whether actions should be executed during any changes to the alarm state of the composite alarm.
	ActionsEnabled() interface{}
	SetActionsEnabled(val interface{})
	// Actions will be suppressed if the suppressor alarm is in the `ALARM` state.
	ActionsSuppressor() *string
	SetActionsSuppressor(val *string)
	// The maximum time in seconds that the composite alarm waits after suppressor alarm goes out of the `ALARM` state.
	ActionsSuppressorExtensionPeriod() *float64
	SetActionsSuppressorExtensionPeriod(val *float64)
	// The maximum time in seconds that the composite alarm waits for the suppressor alarm to go into the `ALARM` state.
	ActionsSuppressorWaitPeriod() *float64
	SetActionsSuppressorWaitPeriod(val *float64)
	// The actions to execute when this alarm transitions to the ALARM state from any other state.
	AlarmActions() *[]*string
	SetAlarmActions(val *[]*string)
	// The description for the composite alarm.
	AlarmDescription() *string
	SetAlarmDescription(val *string)
	// The name for the composite alarm.
	AlarmName() *string
	SetAlarmName(val *string)
	// An expression that specifies which other alarms are to be evaluated to determine this composite alarm's state.
	AlarmRule() *string
	SetAlarmRule(val *string)
	// The ARN of the composite alarm, such as `arn:aws:cloudwatch:us-west-2:123456789012:alarm/CompositeAlarmName` .
	AttrArn() *string
	// Tag Manager which manages the tags for this resource.
	CdkTagManager() awscdk.TagManager
	// Options for this resource, such as condition, update policy etc.
	CfnOptions() awscdk.ICfnResourceOptions
	CfnProperties() *map[string]interface{}
	// AWS resource type.
	CfnResourceType() *string
	// Returns: the stack trace of the point where this Resource was created from, sourced
	// from the +metadata+ entry typed +aws:cdk:logicalId+, and with the bottom-most
	// node +internal+ entries filtered.
	CreationStack() *[]*string
	// The actions to execute when this alarm transitions to the INSUFFICIENT_DATA state from any other state.
	InsufficientDataActions() *[]*string
	SetInsufficientDataActions(val *[]*string)
	// The logical ID for this CloudFormation stack element.
	//
	// The logical ID of the element
	// is calculated from the path of the resource node in the construct tree.
	//
	// To override this value, use `overrideLogicalId(newLogicalId)`.
	//
	// Returns: the logical ID as a stringified token. This value will only get
	// resolved during synthesis.
	LogicalId() *string
	// The tree node.
	Node() constructs.Node
	// The actions to execute when this alarm transitions to the OK state from any other state.
	OkActions() *[]*string
	SetOkActions(val *[]*string)
	// Return a string that will be resolved to a CloudFormation `{ Ref }` for this element.
	//
	// If, by any chance, the intrinsic reference of a resource is not a string, you could
	// coerce it to an IResolvable through `Lazy.any({ produce: resource.ref })`.
	Ref() *string
	// The stack in which this element is defined.
	//
	// CfnElements must be defined within a stack scope (directly or indirectly).
	Stack() awscdk.Stack
	// A list of key-value pairs to associate with the alarm.
	Tags() *[]*awscdk.CfnTag
	SetTags(val *[]*awscdk.CfnTag)
	// Deprecated.
	// Deprecated: use `updatedProperties`
	//
	// Return properties modified after initiation
	//
	// Resources that expose mutable properties should override this function to
	// collect and return the properties object for this resource.
	UpdatedProperites() *map[string]interface{}
	// Return properties modified after initiation.
	//
	// Resources that expose mutable properties should override this function to
	// collect and return the properties object for this resource.
	UpdatedProperties() *map[string]interface{}
	// Syntactic sugar for `addOverride(path, undefined)`.
	AddDeletionOverride(path *string)
	// Indicates that this resource depends on another resource and cannot be provisioned unless the other resource has been successfully provisioned.
	//
	// This can be used for resources across stacks (or nested stack) boundaries
	// and the dependency will automatically be transferred to the relevant scope.
	AddDependency(target awscdk.CfnResource)
	// Indicates that this resource depends on another resource and cannot be provisioned unless the other resource has been successfully provisioned.
	// Deprecated: use addDependency.
	AddDependsOn(target awscdk.CfnResource)
	// Add a value to the CloudFormation Resource Metadata.
	// See: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/metadata-section-structure.html
	//
	// Note that this is a different set of metadata from CDK node metadata; this
	// metadata ends up in the stack template under the resource, whereas CDK
	// node metadata ends up in the Cloud Assembly.
	//
	AddMetadata(key *string, value interface{})
	// Adds an override to the synthesized CloudFormation resource.
	//
	// To add a
	// property override, either use `addPropertyOverride` or prefix `path` with
	// "Properties." (i.e. `Properties.TopicName`).
	//
	// If the override is nested, separate each nested level using a dot (.) in the path parameter.
	// If there is an array as part of the nesting, specify the index in the path.
	//
	// To include a literal `.` in the property name, prefix with a `\`. In most
	// programming languages you will need to write this as `"\\."` because the
	// `\` itself will need to be escaped.
	//
	// For example,
	// “`typescript
	// cfnResource.addOverride('Properties.GlobalSecondaryIndexes.0.Projection.NonKeyAttributes', ['myattribute']);
	// cfnResource.addOverride('Properties.GlobalSecondaryIndexes.1.ProjectionType', 'INCLUDE');
	// “`
	// would add the overrides
	// “`json
	// "Properties": {
	//   "GlobalSecondaryIndexes": [
	//     {
	//       "Projection": {
	//         "NonKeyAttributes": [ "myattribute" ]
	//         ...
	//       }
	//       ...
	//     },
	//     {
	//       "ProjectionType": "INCLUDE"
	//       ...
	//     },
	//   ]
	//   ...
	// }
	// “`
	//
	// The `value` argument to `addOverride` will not be processed or translated
	// in any way. Pass raw JSON values in here with the correct capitalization
	// for CloudFormation. If you pass CDK classes or structs, they will be
	// rendered with lowercased key names, and CloudFormation will reject the
	// template.
	AddOverride(path *string, value interface{})
	// Adds an override that deletes the value of a property from the resource definition.
	AddPropertyDeletionOverride(propertyPath *string)
	// Adds an override to a resource property.
	//
	// Syntactic sugar for `addOverride("Properties.<...>", value)`.
	AddPropertyOverride(propertyPath *string, value interface{})
	// Sets the deletion policy of the resource based on the removal policy specified.
	//
	// The Removal Policy controls what happens to this resource when it stops
	// being managed by CloudFormation, either because you've removed it from the
	// CDK application or because you've made a change that requires the resource
	// to be replaced.
	//
	// The resource can be deleted (`RemovalPolicy.DESTROY`), or left in your AWS
	// account for data recovery and cleanup later (`RemovalPolicy.RETAIN`). In some
	// cases, a snapshot can be taken of the resource prior to deletion
	// (`RemovalPolicy.SNAPSHOT`). A list of resources that support this policy
	// can be found in the following link:.
	// See: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-deletionpolicy.html#aws-attribute-deletionpolicy-options
	//
	ApplyRemovalPolicy(policy awscdk.RemovalPolicy, options *awscdk.RemovalPolicyOptions)
	// Returns a token for an runtime attribute of this resource.
	//
	// Ideally, use generated attribute accessors (e.g. `resource.arn`), but this can be used for future compatibility
	// in case there is no generated attribute.
	GetAtt(attributeName *string, typeHint awscdk.ResolutionTypeHint) awscdk.Reference
	// Retrieve a value value from the CloudFormation Resource Metadata.
	// See: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/metadata-section-structure.html
	//
	// Note that this is a different set of metadata from CDK node metadata; this
	// metadata ends up in the stack template under the resource, whereas CDK
	// node metadata ends up in the Cloud Assembly.
	//
	GetMetadata(key *string) interface{}
	// Examines the CloudFormation resource and discloses attributes.
	Inspect(inspector awscdk.TreeInspector)
	// Retrieves an array of resources this resource depends on.
	//
	// This assembles dependencies on resources across stacks (including nested stacks)
	// automatically.
	ObtainDependencies() *[]interface{}
	// Get a shallow copy of dependencies between this resource and other resources in the same stack.
	ObtainResourceDependencies() *[]awscdk.CfnResource
	// Overrides the auto-generated logical ID with a specific ID.
	OverrideLogicalId(newLogicalId *string)
	// Indicates that this resource no longer depends on another resource.
	//
	// This can be used for resources across stacks (including nested stacks)
	// and the dependency will automatically be removed from the relevant scope.
	RemoveDependency(target awscdk.CfnResource)
	RenderProperties(props *map[string]interface{}) *map[string]interface{}
	// Replaces one dependency with another.
	ReplaceDependency(target awscdk.CfnResource, newTarget awscdk.CfnResource)
	// Can be overridden by subclasses to determine if this resource will be rendered into the cloudformation template.
	//
	// Returns: `true` if the resource should be included or `false` is the resource
	// should be omitted.
	ShouldSynthesize() *bool
	// Returns a string representation of this construct.
	//
	// Returns: a string representation of this resource.
	ToString() *string
	ValidateProperties(_properties interface{})
}

The `AWS::CloudWatch::CompositeAlarm` type creates or updates a composite alarm.

When you create a composite alarm, you specify a rule expression for the alarm that takes into account the alarm states of other alarms that you have created. The composite alarm goes into ALARM state only if all conditions of the rule are met.

The alarms specified in a composite alarm's rule expression can include metric alarms and other composite alarms.

Using composite alarms can reduce alarm noise. You can create multiple metric alarms, and also create a composite alarm and set up alerts only for the composite alarm. For example, you could create a composite alarm that goes into ALARM state only when more than one of the underlying metric alarms are in ALARM state.

When this operation creates an alarm, the alarm state is immediately set to INSUFFICIENT_DATA. The alarm is then evaluated and its state is set appropriately. Any actions associated with the new state are then executed. For a composite alarm, this initial time after creation is the only time that the alarm can be in INSUFFICIENT_DATA state.

When you update an existing alarm, its state is left unchanged, but the update completely overwrites the previous configuration of the alarm.

Example:

// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"

cfnCompositeAlarm := awscdk.Aws_cloudwatch.NewCfnCompositeAlarm(this, jsii.String("MyCfnCompositeAlarm"), &CfnCompositeAlarmProps{
	AlarmRule: jsii.String("alarmRule"),

	// the properties below are optional
	ActionsEnabled: jsii.Boolean(false),
	ActionsSuppressor: jsii.String("actionsSuppressor"),
	ActionsSuppressorExtensionPeriod: jsii.Number(123),
	ActionsSuppressorWaitPeriod: jsii.Number(123),
	AlarmActions: []*string{
		jsii.String("alarmActions"),
	},
	AlarmDescription: jsii.String("alarmDescription"),
	AlarmName: jsii.String("alarmName"),
	InsufficientDataActions: []*string{
		jsii.String("insufficientDataActions"),
	},
	OkActions: []*string{
		jsii.String("okActions"),
	},
	Tags: []cfnTag{
		&cfnTag{
			Key: jsii.String("key"),
			Value: jsii.String("value"),
		},
	},
})

See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-cloudwatch-compositealarm.html

func NewCfnCompositeAlarm

func NewCfnCompositeAlarm(scope constructs.Construct, id *string, props *CfnCompositeAlarmProps) CfnCompositeAlarm

type CfnCompositeAlarmProps

type CfnCompositeAlarmProps struct {
	// An expression that specifies which other alarms are to be evaluated to determine this composite alarm's state.
	//
	// For each alarm that you reference, you designate a function that specifies whether that alarm needs to be in ALARM state, OK state, or INSUFFICIENT_DATA state. You can use operators (AND, OR and NOT) to combine multiple functions in a single expression. You can use parenthesis to logically group the functions in your expression.
	//
	// You can use either alarm names or ARNs to reference the other alarms that are to be evaluated.
	//
	// Functions can include the following:
	//
	// - ALARM("alarm-name or alarm-ARN") is TRUE if the named alarm is in ALARM state.
	// - OK("alarm-name or alarm-ARN") is TRUE if the named alarm is in OK state.
	// - INSUFFICIENT_DATA("alarm-name or alarm-ARN") is TRUE if the named alarm is in INSUFFICIENT_DATA state.
	// - TRUE always evaluates to TRUE.
	// - FALSE always evaluates to FALSE.
	//
	// TRUE and FALSE are useful for testing a complex AlarmRule structure, and for testing your alarm actions.
	//
	// For more information about `AlarmRule` syntax, see [PutCompositeAlarm](https://docs.aws.amazon.com/AmazonCloudWatch/latest/APIReference/API_PutCompositeAlarm.html) in the *Amazon CloudWatch API Reference* .
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-cloudwatch-compositealarm.html#cfn-cloudwatch-compositealarm-alarmrule
	//
	AlarmRule *string `field:"required" json:"alarmRule" yaml:"alarmRule"`
	// Indicates whether actions should be executed during any changes to the alarm state of the composite alarm.
	//
	// The default is TRUE.
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-cloudwatch-compositealarm.html#cfn-cloudwatch-compositealarm-actionsenabled
	//
	ActionsEnabled interface{} `field:"optional" json:"actionsEnabled" yaml:"actionsEnabled"`
	// Actions will be suppressed if the suppressor alarm is in the `ALARM` state.
	//
	// `ActionsSuppressor` can be an AlarmName or an Amazon Resource Name (ARN) from an existing alarm.
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-cloudwatch-compositealarm.html#cfn-cloudwatch-compositealarm-actionssuppressor
	//
	ActionsSuppressor *string `field:"optional" json:"actionsSuppressor" yaml:"actionsSuppressor"`
	// The maximum time in seconds that the composite alarm waits after suppressor alarm goes out of the `ALARM` state.
	//
	// After this time, the composite alarm performs its actions.
	//
	// > `ExtensionPeriod` is required only when `ActionsSuppressor` is specified.
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-cloudwatch-compositealarm.html#cfn-cloudwatch-compositealarm-actionssuppressorextensionperiod
	//
	ActionsSuppressorExtensionPeriod *float64 `field:"optional" json:"actionsSuppressorExtensionPeriod" yaml:"actionsSuppressorExtensionPeriod"`
	// The maximum time in seconds that the composite alarm waits for the suppressor alarm to go into the `ALARM` state.
	//
	// After this time, the composite alarm performs its actions.
	//
	// > `WaitPeriod` is required only when `ActionsSuppressor` is specified.
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-cloudwatch-compositealarm.html#cfn-cloudwatch-compositealarm-actionssuppressorwaitperiod
	//
	ActionsSuppressorWaitPeriod *float64 `field:"optional" json:"actionsSuppressorWaitPeriod" yaml:"actionsSuppressorWaitPeriod"`
	// The actions to execute when this alarm transitions to the ALARM state from any other state.
	//
	// Each action is specified as an Amazon Resource Name (ARN). For more information about creating alarms and the actions that you can specify, see [PutCompositeAlarm](https://docs.aws.amazon.com/AmazonCloudWatch/latest/APIReference/API_PutCompositeAlarm.html) in the *Amazon CloudWatch API Reference* .
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-cloudwatch-compositealarm.html#cfn-cloudwatch-compositealarm-alarmactions
	//
	AlarmActions *[]*string `field:"optional" json:"alarmActions" yaml:"alarmActions"`
	// The description for the composite alarm.
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-cloudwatch-compositealarm.html#cfn-cloudwatch-compositealarm-alarmdescription
	//
	AlarmDescription *string `field:"optional" json:"alarmDescription" yaml:"alarmDescription"`
	// The name for the composite alarm.
	//
	// This name must be unique within your AWS account.
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-cloudwatch-compositealarm.html#cfn-cloudwatch-compositealarm-alarmname
	//
	AlarmName *string `field:"optional" json:"alarmName" yaml:"alarmName"`
	// The actions to execute when this alarm transitions to the INSUFFICIENT_DATA state from any other state.
	//
	// Each action is specified as an Amazon Resource Name (ARN). For more information about creating alarms and the actions that you can specify, see [PutCompositeAlarm](https://docs.aws.amazon.com/AmazonCloudWatch/latest/APIReference/API_PutCompositeAlarm.html) in the *Amazon CloudWatch API Reference* .
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-cloudwatch-compositealarm.html#cfn-cloudwatch-compositealarm-insufficientdataactions
	//
	InsufficientDataActions *[]*string `field:"optional" json:"insufficientDataActions" yaml:"insufficientDataActions"`
	// The actions to execute when this alarm transitions to the OK state from any other state.
	//
	// Each action is specified as an Amazon Resource Name (ARN). For more information about creating alarms and the actions that you can specify, see [PutCompositeAlarm](https://docs.aws.amazon.com/AmazonCloudWatch/latest/APIReference/API_PutCompositeAlarm.html) in the *Amazon CloudWatch API Reference* .
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-cloudwatch-compositealarm.html#cfn-cloudwatch-compositealarm-okactions
	//
	OkActions *[]*string `field:"optional" json:"okActions" yaml:"okActions"`
	// A list of key-value pairs to associate with the alarm.
	//
	// You can associate as many as 50 tags with an alarm. To be able to associate tags with the alarm when you create the alarm, you must have the `cloudwatch:TagResource` permission.
	//
	// Tags can help you organize and categorize your resources. You can also use them to scope user permissions by granting a user permission to access or change only resources with certain tag values.
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-cloudwatch-compositealarm.html#cfn-cloudwatch-compositealarm-tags
	//
	Tags *[]*awscdk.CfnTag `field:"optional" json:"tags" yaml:"tags"`
}

Properties for defining a `CfnCompositeAlarm`.

Example:

// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"

cfnCompositeAlarmProps := &CfnCompositeAlarmProps{
	AlarmRule: jsii.String("alarmRule"),

	// the properties below are optional
	ActionsEnabled: jsii.Boolean(false),
	ActionsSuppressor: jsii.String("actionsSuppressor"),
	ActionsSuppressorExtensionPeriod: jsii.Number(123),
	ActionsSuppressorWaitPeriod: jsii.Number(123),
	AlarmActions: []*string{
		jsii.String("alarmActions"),
	},
	AlarmDescription: jsii.String("alarmDescription"),
	AlarmName: jsii.String("alarmName"),
	InsufficientDataActions: []*string{
		jsii.String("insufficientDataActions"),
	},
	OkActions: []*string{
		jsii.String("okActions"),
	},
	Tags: []cfnTag{
		&cfnTag{
			Key: jsii.String("key"),
			Value: jsii.String("value"),
		},
	},
}

See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-cloudwatch-compositealarm.html

type CfnDashboard

type CfnDashboard interface {
	awscdk.CfnResource
	awscdk.IInspectable
	AttrId() *string
	// Options for this resource, such as condition, update policy etc.
	CfnOptions() awscdk.ICfnResourceOptions
	CfnProperties() *map[string]interface{}
	// AWS resource type.
	CfnResourceType() *string
	// Returns: the stack trace of the point where this Resource was created from, sourced
	// from the +metadata+ entry typed +aws:cdk:logicalId+, and with the bottom-most
	// node +internal+ entries filtered.
	CreationStack() *[]*string
	// The detailed information about the dashboard in JSON format, including the widgets to include and their location on the dashboard.
	DashboardBody() *string
	SetDashboardBody(val *string)
	// The name of the dashboard.
	DashboardName() *string
	SetDashboardName(val *string)
	// The logical ID for this CloudFormation stack element.
	//
	// The logical ID of the element
	// is calculated from the path of the resource node in the construct tree.
	//
	// To override this value, use `overrideLogicalId(newLogicalId)`.
	//
	// Returns: the logical ID as a stringified token. This value will only get
	// resolved during synthesis.
	LogicalId() *string
	// The tree node.
	Node() constructs.Node
	// Return a string that will be resolved to a CloudFormation `{ Ref }` for this element.
	//
	// If, by any chance, the intrinsic reference of a resource is not a string, you could
	// coerce it to an IResolvable through `Lazy.any({ produce: resource.ref })`.
	Ref() *string
	// The stack in which this element is defined.
	//
	// CfnElements must be defined within a stack scope (directly or indirectly).
	Stack() awscdk.Stack
	// Deprecated.
	// Deprecated: use `updatedProperties`
	//
	// Return properties modified after initiation
	//
	// Resources that expose mutable properties should override this function to
	// collect and return the properties object for this resource.
	UpdatedProperites() *map[string]interface{}
	// Return properties modified after initiation.
	//
	// Resources that expose mutable properties should override this function to
	// collect and return the properties object for this resource.
	UpdatedProperties() *map[string]interface{}
	// Syntactic sugar for `addOverride(path, undefined)`.
	AddDeletionOverride(path *string)
	// Indicates that this resource depends on another resource and cannot be provisioned unless the other resource has been successfully provisioned.
	//
	// This can be used for resources across stacks (or nested stack) boundaries
	// and the dependency will automatically be transferred to the relevant scope.
	AddDependency(target awscdk.CfnResource)
	// Indicates that this resource depends on another resource and cannot be provisioned unless the other resource has been successfully provisioned.
	// Deprecated: use addDependency.
	AddDependsOn(target awscdk.CfnResource)
	// Add a value to the CloudFormation Resource Metadata.
	// See: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/metadata-section-structure.html
	//
	// Note that this is a different set of metadata from CDK node metadata; this
	// metadata ends up in the stack template under the resource, whereas CDK
	// node metadata ends up in the Cloud Assembly.
	//
	AddMetadata(key *string, value interface{})
	// Adds an override to the synthesized CloudFormation resource.
	//
	// To add a
	// property override, either use `addPropertyOverride` or prefix `path` with
	// "Properties." (i.e. `Properties.TopicName`).
	//
	// If the override is nested, separate each nested level using a dot (.) in the path parameter.
	// If there is an array as part of the nesting, specify the index in the path.
	//
	// To include a literal `.` in the property name, prefix with a `\`. In most
	// programming languages you will need to write this as `"\\."` because the
	// `\` itself will need to be escaped.
	//
	// For example,
	// “`typescript
	// cfnResource.addOverride('Properties.GlobalSecondaryIndexes.0.Projection.NonKeyAttributes', ['myattribute']);
	// cfnResource.addOverride('Properties.GlobalSecondaryIndexes.1.ProjectionType', 'INCLUDE');
	// “`
	// would add the overrides
	// “`json
	// "Properties": {
	//   "GlobalSecondaryIndexes": [
	//     {
	//       "Projection": {
	//         "NonKeyAttributes": [ "myattribute" ]
	//         ...
	//       }
	//       ...
	//     },
	//     {
	//       "ProjectionType": "INCLUDE"
	//       ...
	//     },
	//   ]
	//   ...
	// }
	// “`
	//
	// The `value` argument to `addOverride` will not be processed or translated
	// in any way. Pass raw JSON values in here with the correct capitalization
	// for CloudFormation. If you pass CDK classes or structs, they will be
	// rendered with lowercased key names, and CloudFormation will reject the
	// template.
	AddOverride(path *string, value interface{})
	// Adds an override that deletes the value of a property from the resource definition.
	AddPropertyDeletionOverride(propertyPath *string)
	// Adds an override to a resource property.
	//
	// Syntactic sugar for `addOverride("Properties.<...>", value)`.
	AddPropertyOverride(propertyPath *string, value interface{})
	// Sets the deletion policy of the resource based on the removal policy specified.
	//
	// The Removal Policy controls what happens to this resource when it stops
	// being managed by CloudFormation, either because you've removed it from the
	// CDK application or because you've made a change that requires the resource
	// to be replaced.
	//
	// The resource can be deleted (`RemovalPolicy.DESTROY`), or left in your AWS
	// account for data recovery and cleanup later (`RemovalPolicy.RETAIN`). In some
	// cases, a snapshot can be taken of the resource prior to deletion
	// (`RemovalPolicy.SNAPSHOT`). A list of resources that support this policy
	// can be found in the following link:.
	// See: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-deletionpolicy.html#aws-attribute-deletionpolicy-options
	//
	ApplyRemovalPolicy(policy awscdk.RemovalPolicy, options *awscdk.RemovalPolicyOptions)
	// Returns a token for an runtime attribute of this resource.
	//
	// Ideally, use generated attribute accessors (e.g. `resource.arn`), but this can be used for future compatibility
	// in case there is no generated attribute.
	GetAtt(attributeName *string, typeHint awscdk.ResolutionTypeHint) awscdk.Reference
	// Retrieve a value value from the CloudFormation Resource Metadata.
	// See: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/metadata-section-structure.html
	//
	// Note that this is a different set of metadata from CDK node metadata; this
	// metadata ends up in the stack template under the resource, whereas CDK
	// node metadata ends up in the Cloud Assembly.
	//
	GetMetadata(key *string) interface{}
	// Examines the CloudFormation resource and discloses attributes.
	Inspect(inspector awscdk.TreeInspector)
	// Retrieves an array of resources this resource depends on.
	//
	// This assembles dependencies on resources across stacks (including nested stacks)
	// automatically.
	ObtainDependencies() *[]interface{}
	// Get a shallow copy of dependencies between this resource and other resources in the same stack.
	ObtainResourceDependencies() *[]awscdk.CfnResource
	// Overrides the auto-generated logical ID with a specific ID.
	OverrideLogicalId(newLogicalId *string)
	// Indicates that this resource no longer depends on another resource.
	//
	// This can be used for resources across stacks (including nested stacks)
	// and the dependency will automatically be removed from the relevant scope.
	RemoveDependency(target awscdk.CfnResource)
	RenderProperties(props *map[string]interface{}) *map[string]interface{}
	// Replaces one dependency with another.
	ReplaceDependency(target awscdk.CfnResource, newTarget awscdk.CfnResource)
	// Can be overridden by subclasses to determine if this resource will be rendered into the cloudformation template.
	//
	// Returns: `true` if the resource should be included or `false` is the resource
	// should be omitted.
	ShouldSynthesize() *bool
	// Returns a string representation of this construct.
	//
	// Returns: a string representation of this resource.
	ToString() *string
	ValidateProperties(_properties interface{})
}

The `AWS::CloudWatch::Dashboard` resource specifies an Amazon CloudWatch dashboard.

A dashboard is a customizable home page in the CloudWatch console that you can use to monitor your AWS resources in a single view.

All dashboards in your account are global, not region-specific.

Example:

// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"

cfnDashboard := awscdk.Aws_cloudwatch.NewCfnDashboard(this, jsii.String("MyCfnDashboard"), &CfnDashboardProps{
	DashboardBody: jsii.String("dashboardBody"),

	// the properties below are optional
	DashboardName: jsii.String("dashboardName"),
})

See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-cloudwatch-dashboard.html

func NewCfnDashboard

func NewCfnDashboard(scope constructs.Construct, id *string, props *CfnDashboardProps) CfnDashboard

type CfnDashboardProps

type CfnDashboardProps struct {
	// The detailed information about the dashboard in JSON format, including the widgets to include and their location on the dashboard.
	//
	// This parameter is required.
	//
	// For more information about the syntax, see [Dashboard Body Structure and Syntax](https://docs.aws.amazon.com/AmazonCloudWatch/latest/APIReference/CloudWatch-Dashboard-Body-Structure.html) .
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-cloudwatch-dashboard.html#cfn-cloudwatch-dashboard-dashboardbody
	//
	DashboardBody *string `field:"required" json:"dashboardBody" yaml:"dashboardBody"`
	// The name of the dashboard.
	//
	// The name must be between 1 and 255 characters. If you do not specify a name, one will be generated automatically.
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-cloudwatch-dashboard.html#cfn-cloudwatch-dashboard-dashboardname
	//
	DashboardName *string `field:"optional" json:"dashboardName" yaml:"dashboardName"`
}

Properties for defining a `CfnDashboard`.

Example:

// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"

cfnDashboardProps := &CfnDashboardProps{
	DashboardBody: jsii.String("dashboardBody"),

	// the properties below are optional
	DashboardName: jsii.String("dashboardName"),
}

See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-cloudwatch-dashboard.html

type CfnInsightRule

type CfnInsightRule interface {
	awscdk.CfnResource
	awscdk.IInspectable
	awscdk.ITaggable
	// The ARN of the Contributor Insights rule, such as `arn:aws:cloudwatch:us-west-2:123456789012:insight-rule/MyInsightRuleName` .
	AttrArn() *string
	AttrId() *string
	// The name of the Contributor Insights rule.
	AttrRuleName() *string
	// Options for this resource, such as condition, update policy etc.
	CfnOptions() awscdk.ICfnResourceOptions
	CfnProperties() *map[string]interface{}
	// AWS resource type.
	CfnResourceType() *string
	// Returns: the stack trace of the point where this Resource was created from, sourced
	// from the +metadata+ entry typed +aws:cdk:logicalId+, and with the bottom-most
	// node +internal+ entries filtered.
	CreationStack() *[]*string
	// The logical ID for this CloudFormation stack element.
	//
	// The logical ID of the element
	// is calculated from the path of the resource node in the construct tree.
	//
	// To override this value, use `overrideLogicalId(newLogicalId)`.
	//
	// Returns: the logical ID as a stringified token. This value will only get
	// resolved during synthesis.
	LogicalId() *string
	// The tree node.
	Node() constructs.Node
	// Return a string that will be resolved to a CloudFormation `{ Ref }` for this element.
	//
	// If, by any chance, the intrinsic reference of a resource is not a string, you could
	// coerce it to an IResolvable through `Lazy.any({ produce: resource.ref })`.
	Ref() *string
	// The definition of the rule, as a JSON object.
	RuleBody() *string
	SetRuleBody(val *string)
	// The name of the rule.
	RuleName() *string
	SetRuleName(val *string)
	// The current state of the rule.
	RuleState() *string
	SetRuleState(val *string)
	// The stack in which this element is defined.
	//
	// CfnElements must be defined within a stack scope (directly or indirectly).
	Stack() awscdk.Stack
	// Tag Manager which manages the tags for this resource.
	Tags() awscdk.TagManager
	// A list of key-value pairs to associate with the Contributor Insights rule.
	TagsRaw() *[]*awscdk.CfnTag
	SetTagsRaw(val *[]*awscdk.CfnTag)
	// Deprecated.
	// Deprecated: use `updatedProperties`
	//
	// Return properties modified after initiation
	//
	// Resources that expose mutable properties should override this function to
	// collect and return the properties object for this resource.
	UpdatedProperites() *map[string]interface{}
	// Return properties modified after initiation.
	//
	// Resources that expose mutable properties should override this function to
	// collect and return the properties object for this resource.
	UpdatedProperties() *map[string]interface{}
	// Syntactic sugar for `addOverride(path, undefined)`.
	AddDeletionOverride(path *string)
	// Indicates that this resource depends on another resource and cannot be provisioned unless the other resource has been successfully provisioned.
	//
	// This can be used for resources across stacks (or nested stack) boundaries
	// and the dependency will automatically be transferred to the relevant scope.
	AddDependency(target awscdk.CfnResource)
	// Indicates that this resource depends on another resource and cannot be provisioned unless the other resource has been successfully provisioned.
	// Deprecated: use addDependency.
	AddDependsOn(target awscdk.CfnResource)
	// Add a value to the CloudFormation Resource Metadata.
	// See: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/metadata-section-structure.html
	//
	// Note that this is a different set of metadata from CDK node metadata; this
	// metadata ends up in the stack template under the resource, whereas CDK
	// node metadata ends up in the Cloud Assembly.
	//
	AddMetadata(key *string, value interface{})
	// Adds an override to the synthesized CloudFormation resource.
	//
	// To add a
	// property override, either use `addPropertyOverride` or prefix `path` with
	// "Properties." (i.e. `Properties.TopicName`).
	//
	// If the override is nested, separate each nested level using a dot (.) in the path parameter.
	// If there is an array as part of the nesting, specify the index in the path.
	//
	// To include a literal `.` in the property name, prefix with a `\`. In most
	// programming languages you will need to write this as `"\\."` because the
	// `\` itself will need to be escaped.
	//
	// For example,
	// “`typescript
	// cfnResource.addOverride('Properties.GlobalSecondaryIndexes.0.Projection.NonKeyAttributes', ['myattribute']);
	// cfnResource.addOverride('Properties.GlobalSecondaryIndexes.1.ProjectionType', 'INCLUDE');
	// “`
	// would add the overrides
	// “`json
	// "Properties": {
	//   "GlobalSecondaryIndexes": [
	//     {
	//       "Projection": {
	//         "NonKeyAttributes": [ "myattribute" ]
	//         ...
	//       }
	//       ...
	//     },
	//     {
	//       "ProjectionType": "INCLUDE"
	//       ...
	//     },
	//   ]
	//   ...
	// }
	// “`
	//
	// The `value` argument to `addOverride` will not be processed or translated
	// in any way. Pass raw JSON values in here with the correct capitalization
	// for CloudFormation. If you pass CDK classes or structs, they will be
	// rendered with lowercased key names, and CloudFormation will reject the
	// template.
	AddOverride(path *string, value interface{})
	// Adds an override that deletes the value of a property from the resource definition.
	AddPropertyDeletionOverride(propertyPath *string)
	// Adds an override to a resource property.
	//
	// Syntactic sugar for `addOverride("Properties.<...>", value)`.
	AddPropertyOverride(propertyPath *string, value interface{})
	// Sets the deletion policy of the resource based on the removal policy specified.
	//
	// The Removal Policy controls what happens to this resource when it stops
	// being managed by CloudFormation, either because you've removed it from the
	// CDK application or because you've made a change that requires the resource
	// to be replaced.
	//
	// The resource can be deleted (`RemovalPolicy.DESTROY`), or left in your AWS
	// account for data recovery and cleanup later (`RemovalPolicy.RETAIN`). In some
	// cases, a snapshot can be taken of the resource prior to deletion
	// (`RemovalPolicy.SNAPSHOT`). A list of resources that support this policy
	// can be found in the following link:.
	// See: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-deletionpolicy.html#aws-attribute-deletionpolicy-options
	//
	ApplyRemovalPolicy(policy awscdk.RemovalPolicy, options *awscdk.RemovalPolicyOptions)
	// Returns a token for an runtime attribute of this resource.
	//
	// Ideally, use generated attribute accessors (e.g. `resource.arn`), but this can be used for future compatibility
	// in case there is no generated attribute.
	GetAtt(attributeName *string, typeHint awscdk.ResolutionTypeHint) awscdk.Reference
	// Retrieve a value value from the CloudFormation Resource Metadata.
	// See: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/metadata-section-structure.html
	//
	// Note that this is a different set of metadata from CDK node metadata; this
	// metadata ends up in the stack template under the resource, whereas CDK
	// node metadata ends up in the Cloud Assembly.
	//
	GetMetadata(key *string) interface{}
	// Examines the CloudFormation resource and discloses attributes.
	Inspect(inspector awscdk.TreeInspector)
	// Retrieves an array of resources this resource depends on.
	//
	// This assembles dependencies on resources across stacks (including nested stacks)
	// automatically.
	ObtainDependencies() *[]interface{}
	// Get a shallow copy of dependencies between this resource and other resources in the same stack.
	ObtainResourceDependencies() *[]awscdk.CfnResource
	// Overrides the auto-generated logical ID with a specific ID.
	OverrideLogicalId(newLogicalId *string)
	// Indicates that this resource no longer depends on another resource.
	//
	// This can be used for resources across stacks (including nested stacks)
	// and the dependency will automatically be removed from the relevant scope.
	RemoveDependency(target awscdk.CfnResource)
	RenderProperties(props *map[string]interface{}) *map[string]interface{}
	// Replaces one dependency with another.
	ReplaceDependency(target awscdk.CfnResource, newTarget awscdk.CfnResource)
	// Can be overridden by subclasses to determine if this resource will be rendered into the cloudformation template.
	//
	// Returns: `true` if the resource should be included or `false` is the resource
	// should be omitted.
	ShouldSynthesize() *bool
	// Returns a string representation of this construct.
	//
	// Returns: a string representation of this resource.
	ToString() *string
	ValidateProperties(_properties interface{})
}

Creates or updates a Contributor Insights rule.

Rules evaluate log events in a CloudWatch Logs log group, enabling you to find contributor data for the log events in that log group. For more information, see [Using Contributor Insights to Analyze High-Cardinality Data](https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/ContributorInsights.html) in the *Amazon CloudWatch User Guide* .

Example:

// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"

cfnInsightRule := awscdk.Aws_cloudwatch.NewCfnInsightRule(this, jsii.String("MyCfnInsightRule"), &CfnInsightRuleProps{
	RuleBody: jsii.String("ruleBody"),
	RuleName: jsii.String("ruleName"),
	RuleState: jsii.String("ruleState"),

	// the properties below are optional
	Tags: []cfnTag{
		&cfnTag{
			Key: jsii.String("key"),
			Value: jsii.String("value"),
		},
	},
})

See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-cloudwatch-insightrule.html

func NewCfnInsightRule

func NewCfnInsightRule(scope constructs.Construct, id *string, props *CfnInsightRuleProps) CfnInsightRule

type CfnInsightRuleProps

type CfnInsightRuleProps struct {
	// The definition of the rule, as a JSON object.
	//
	// For details about the syntax, see [Contributor Insights Rule Syntax](https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/ContributorInsights-RuleSyntax.html) in the *Amazon CloudWatch User Guide* .
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-cloudwatch-insightrule.html#cfn-cloudwatch-insightrule-rulebody
	//
	RuleBody *string `field:"required" json:"ruleBody" yaml:"ruleBody"`
	// The name of the rule.
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-cloudwatch-insightrule.html#cfn-cloudwatch-insightrule-rulename
	//
	RuleName *string `field:"required" json:"ruleName" yaml:"ruleName"`
	// The current state of the rule.
	//
	// Valid values are `ENABLED` and `DISABLED` .
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-cloudwatch-insightrule.html#cfn-cloudwatch-insightrule-rulestate
	//
	RuleState *string `field:"required" json:"ruleState" yaml:"ruleState"`
	// A list of key-value pairs to associate with the Contributor Insights rule.
	//
	// You can associate as many as 50 tags with a rule.
	//
	// Tags can help you organize and categorize your resources. For more information, see [Tagging Your Amazon CloudWatch Resources](https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/CloudWatch-Tagging.html) .
	//
	// To be able to associate tags with a rule, you must have the `cloudwatch:TagResource` permission in addition to the `cloudwatch:PutInsightRule` permission.
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-cloudwatch-insightrule.html#cfn-cloudwatch-insightrule-tags
	//
	Tags *[]*awscdk.CfnTag `field:"optional" json:"tags" yaml:"tags"`
}

Properties for defining a `CfnInsightRule`.

Example:

// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"

cfnInsightRuleProps := &CfnInsightRuleProps{
	RuleBody: jsii.String("ruleBody"),
	RuleName: jsii.String("ruleName"),
	RuleState: jsii.String("ruleState"),

	// the properties below are optional
	Tags: []cfnTag{
		&cfnTag{
			Key: jsii.String("key"),
			Value: jsii.String("value"),
		},
	},
}

See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-cloudwatch-insightrule.html

type CfnMetricStream

type CfnMetricStream interface {
	awscdk.CfnResource
	awscdk.IInspectable
	awscdk.ITaggable
	// The ARN of the metric stream.
	AttrArn() *string
	// The date that the metric stream was originally created.
	AttrCreationDate() *string
	// The date that the metric stream was most recently updated.
	AttrLastUpdateDate() *string
	// The state of the metric stream, either `running` or `stopped` .
	AttrState() *string
	// Options for this resource, such as condition, update policy etc.
	CfnOptions() awscdk.ICfnResourceOptions
	CfnProperties() *map[string]interface{}
	// AWS resource type.
	CfnResourceType() *string
	// Returns: the stack trace of the point where this Resource was created from, sourced
	// from the +metadata+ entry typed +aws:cdk:logicalId+, and with the bottom-most
	// node +internal+ entries filtered.
	CreationStack() *[]*string
	// If you specify this parameter, the stream sends metrics from all metric namespaces except for the namespaces that you specify here.
	ExcludeFilters() interface{}
	SetExcludeFilters(val interface{})
	// The ARN of the Amazon Kinesis Firehose delivery stream to use for this metric stream.
	FirehoseArn() *string
	SetFirehoseArn(val *string)
	// If you specify this parameter, the stream sends only the metrics from the metric namespaces that you specify here.
	IncludeFilters() interface{}
	SetIncludeFilters(val interface{})
	// If you are creating a metric stream in a monitoring account, specify `true` to include metrics from source accounts that are linked to this monitoring account, in the metric stream.
	IncludeLinkedAccountsMetrics() interface{}
	SetIncludeLinkedAccountsMetrics(val interface{})
	// The logical ID for this CloudFormation stack element.
	//
	// The logical ID of the element
	// is calculated from the path of the resource node in the construct tree.
	//
	// To override this value, use `overrideLogicalId(newLogicalId)`.
	//
	// Returns: the logical ID as a stringified token. This value will only get
	// resolved during synthesis.
	LogicalId() *string
	// If you are creating a new metric stream, this is the name for the new stream.
	Name() *string
	SetName(val *string)
	// The tree node.
	Node() constructs.Node
	// The output format for the stream.
	OutputFormat() *string
	SetOutputFormat(val *string)
	// Return a string that will be resolved to a CloudFormation `{ Ref }` for this element.
	//
	// If, by any chance, the intrinsic reference of a resource is not a string, you could
	// coerce it to an IResolvable through `Lazy.any({ produce: resource.ref })`.
	Ref() *string
	// The ARN of an IAM role that this metric stream will use to access Amazon Kinesis Firehose resources.
	RoleArn() *string
	SetRoleArn(val *string)
	// The stack in which this element is defined.
	//
	// CfnElements must be defined within a stack scope (directly or indirectly).
	Stack() awscdk.Stack
	// By default, a metric stream always sends the MAX, MIN, SUM, and SAMPLECOUNT statistics for each metric that is streamed.
	StatisticsConfigurations() interface{}
	SetStatisticsConfigurations(val interface{})
	// Tag Manager which manages the tags for this resource.
	Tags() awscdk.TagManager
	// An array of key-value pairs to apply to the metric stream.
	TagsRaw() *[]*awscdk.CfnTag
	SetTagsRaw(val *[]*awscdk.CfnTag)
	// Deprecated.
	// Deprecated: use `updatedProperties`
	//
	// Return properties modified after initiation
	//
	// Resources that expose mutable properties should override this function to
	// collect and return the properties object for this resource.
	UpdatedProperites() *map[string]interface{}
	// Return properties modified after initiation.
	//
	// Resources that expose mutable properties should override this function to
	// collect and return the properties object for this resource.
	UpdatedProperties() *map[string]interface{}
	// Syntactic sugar for `addOverride(path, undefined)`.
	AddDeletionOverride(path *string)
	// Indicates that this resource depends on another resource and cannot be provisioned unless the other resource has been successfully provisioned.
	//
	// This can be used for resources across stacks (or nested stack) boundaries
	// and the dependency will automatically be transferred to the relevant scope.
	AddDependency(target awscdk.CfnResource)
	// Indicates that this resource depends on another resource and cannot be provisioned unless the other resource has been successfully provisioned.
	// Deprecated: use addDependency.
	AddDependsOn(target awscdk.CfnResource)
	// Add a value to the CloudFormation Resource Metadata.
	// See: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/metadata-section-structure.html
	//
	// Note that this is a different set of metadata from CDK node metadata; this
	// metadata ends up in the stack template under the resource, whereas CDK
	// node metadata ends up in the Cloud Assembly.
	//
	AddMetadata(key *string, value interface{})
	// Adds an override to the synthesized CloudFormation resource.
	//
	// To add a
	// property override, either use `addPropertyOverride` or prefix `path` with
	// "Properties." (i.e. `Properties.TopicName`).
	//
	// If the override is nested, separate each nested level using a dot (.) in the path parameter.
	// If there is an array as part of the nesting, specify the index in the path.
	//
	// To include a literal `.` in the property name, prefix with a `\`. In most
	// programming languages you will need to write this as `"\\."` because the
	// `\` itself will need to be escaped.
	//
	// For example,
	// “`typescript
	// cfnResource.addOverride('Properties.GlobalSecondaryIndexes.0.Projection.NonKeyAttributes', ['myattribute']);
	// cfnResource.addOverride('Properties.GlobalSecondaryIndexes.1.ProjectionType', 'INCLUDE');
	// “`
	// would add the overrides
	// “`json
	// "Properties": {
	//   "GlobalSecondaryIndexes": [
	//     {
	//       "Projection": {
	//         "NonKeyAttributes": [ "myattribute" ]
	//         ...
	//       }
	//       ...
	//     },
	//     {
	//       "ProjectionType": "INCLUDE"
	//       ...
	//     },
	//   ]
	//   ...
	// }
	// “`
	//
	// The `value` argument to `addOverride` will not be processed or translated
	// in any way. Pass raw JSON values in here with the correct capitalization
	// for CloudFormation. If you pass CDK classes or structs, they will be
	// rendered with lowercased key names, and CloudFormation will reject the
	// template.
	AddOverride(path *string, value interface{})
	// Adds an override that deletes the value of a property from the resource definition.
	AddPropertyDeletionOverride(propertyPath *string)
	// Adds an override to a resource property.
	//
	// Syntactic sugar for `addOverride("Properties.<...>", value)`.
	AddPropertyOverride(propertyPath *string, value interface{})
	// Sets the deletion policy of the resource based on the removal policy specified.
	//
	// The Removal Policy controls what happens to this resource when it stops
	// being managed by CloudFormation, either because you've removed it from the
	// CDK application or because you've made a change that requires the resource
	// to be replaced.
	//
	// The resource can be deleted (`RemovalPolicy.DESTROY`), or left in your AWS
	// account for data recovery and cleanup later (`RemovalPolicy.RETAIN`). In some
	// cases, a snapshot can be taken of the resource prior to deletion
	// (`RemovalPolicy.SNAPSHOT`). A list of resources that support this policy
	// can be found in the following link:.
	// See: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-deletionpolicy.html#aws-attribute-deletionpolicy-options
	//
	ApplyRemovalPolicy(policy awscdk.RemovalPolicy, options *awscdk.RemovalPolicyOptions)
	// Returns a token for an runtime attribute of this resource.
	//
	// Ideally, use generated attribute accessors (e.g. `resource.arn`), but this can be used for future compatibility
	// in case there is no generated attribute.
	GetAtt(attributeName *string, typeHint awscdk.ResolutionTypeHint) awscdk.Reference
	// Retrieve a value value from the CloudFormation Resource Metadata.
	// See: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/metadata-section-structure.html
	//
	// Note that this is a different set of metadata from CDK node metadata; this
	// metadata ends up in the stack template under the resource, whereas CDK
	// node metadata ends up in the Cloud Assembly.
	//
	GetMetadata(key *string) interface{}
	// Examines the CloudFormation resource and discloses attributes.
	Inspect(inspector awscdk.TreeInspector)
	// Retrieves an array of resources this resource depends on.
	//
	// This assembles dependencies on resources across stacks (including nested stacks)
	// automatically.
	ObtainDependencies() *[]interface{}
	// Get a shallow copy of dependencies between this resource and other resources in the same stack.
	ObtainResourceDependencies() *[]awscdk.CfnResource
	// Overrides the auto-generated logical ID with a specific ID.
	OverrideLogicalId(newLogicalId *string)
	// Indicates that this resource no longer depends on another resource.
	//
	// This can be used for resources across stacks (including nested stacks)
	// and the dependency will automatically be removed from the relevant scope.
	RemoveDependency(target awscdk.CfnResource)
	RenderProperties(props *map[string]interface{}) *map[string]interface{}
	// Replaces one dependency with another.
	ReplaceDependency(target awscdk.CfnResource, newTarget awscdk.CfnResource)
	// Can be overridden by subclasses to determine if this resource will be rendered into the cloudformation template.
	//
	// Returns: `true` if the resource should be included or `false` is the resource
	// should be omitted.
	ShouldSynthesize() *bool
	// Returns a string representation of this construct.
	//
	// Returns: a string representation of this resource.
	ToString() *string
	ValidateProperties(_properties interface{})
}

Creates or updates a metric stream.

Metrics streams can automatically stream CloudWatch metrics to AWS destinations including Amazon S3 and to many third-party solutions. For more information, see [Metric streams](https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/CloudWatch-Metric-Streams.html) .

To create a metric stream, you must be logged on to an account that has the `iam:PassRole` permission and either the *CloudWatchFullAccess* policy or the `cloudwatch:PutMetricStream` permission.

When you create or update a metric stream, you choose one of the following:

- Stream metrics from all metric namespaces in the account. - Stream metrics from all metric namespaces in the account, except for the namespaces that you list in `ExcludeFilters` . - Stream metrics from only the metric namespaces that you list in `IncludeFilters` .

When you create a metric stream, the stream is created in the `running` state. If you update an existing metric stream, the state does not change.

If you create a metric stream in an account that has been set up as a monitoring account in CloudWatch cross-account observability, you can choose whether to include metrics from linked source accounts in the metric stream.

Example:

// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"

cfnMetricStream := awscdk.Aws_cloudwatch.NewCfnMetricStream(this, jsii.String("MyCfnMetricStream"), &CfnMetricStreamProps{
	FirehoseArn: jsii.String("firehoseArn"),
	OutputFormat: jsii.String("outputFormat"),
	RoleArn: jsii.String("roleArn"),

	// the properties below are optional
	ExcludeFilters: []interface{}{
		&MetricStreamFilterProperty{
			Namespace: jsii.String("namespace"),

			// the properties below are optional
			MetricNames: []*string{
				jsii.String("metricNames"),
			},
		},
	},
	IncludeFilters: []interface{}{
		&MetricStreamFilterProperty{
			Namespace: jsii.String("namespace"),

			// the properties below are optional
			MetricNames: []*string{
				jsii.String("metricNames"),
			},
		},
	},
	IncludeLinkedAccountsMetrics: jsii.Boolean(false),
	Name: jsii.String("name"),
	StatisticsConfigurations: []interface{}{
		&MetricStreamStatisticsConfigurationProperty{
			AdditionalStatistics: []*string{
				jsii.String("additionalStatistics"),
			},
			IncludeMetrics: []interface{}{
				&MetricStreamStatisticsMetricProperty{
					MetricName: jsii.String("metricName"),
					Namespace: jsii.String("namespace"),
				},
			},
		},
	},
	Tags: []cfnTag{
		&cfnTag{
			Key: jsii.String("key"),
			Value: jsii.String("value"),
		},
	},
})

See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-cloudwatch-metricstream.html

func NewCfnMetricStream

func NewCfnMetricStream(scope constructs.Construct, id *string, props *CfnMetricStreamProps) CfnMetricStream

type CfnMetricStreamProps

type CfnMetricStreamProps struct {
	// The ARN of the Amazon Kinesis Firehose delivery stream to use for this metric stream.
	//
	// This Amazon Kinesis Firehose delivery stream must already exist and must be in the same account as the metric stream.
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-cloudwatch-metricstream.html#cfn-cloudwatch-metricstream-firehosearn
	//
	FirehoseArn *string `field:"required" json:"firehoseArn" yaml:"firehoseArn"`
	// The output format for the stream.
	//
	// Valid values are `json` , `opentelemetry1.0` and `opentelemetry0.7` For more information about metric stream output formats, see [Metric streams output formats](https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/CloudWatch-metric-streams-formats.html) .
	//
	// This parameter is required.
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-cloudwatch-metricstream.html#cfn-cloudwatch-metricstream-outputformat
	//
	OutputFormat *string `field:"required" json:"outputFormat" yaml:"outputFormat"`
	// The ARN of an IAM role that this metric stream will use to access Amazon Kinesis Firehose resources.
	//
	// This IAM role must already exist and must be in the same account as the metric stream. This IAM role must include the `firehose:PutRecord` and `firehose:PutRecordBatch` permissions.
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-cloudwatch-metricstream.html#cfn-cloudwatch-metricstream-rolearn
	//
	RoleArn *string `field:"required" json:"roleArn" yaml:"roleArn"`
	// If you specify this parameter, the stream sends metrics from all metric namespaces except for the namespaces that you specify here.
	//
	// You cannot specify both `IncludeFilters` and `ExcludeFilters` in the same metric stream.
	//
	// When you modify the `IncludeFilters` or `ExcludeFilters` of an existing metric stream in any way, the metric stream is effectively restarted, so after such a change you will get only the datapoints that have a timestamp after the time of the update.
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-cloudwatch-metricstream.html#cfn-cloudwatch-metricstream-excludefilters
	//
	ExcludeFilters interface{} `field:"optional" json:"excludeFilters" yaml:"excludeFilters"`
	// If you specify this parameter, the stream sends only the metrics from the metric namespaces that you specify here.
	//
	// You cannot specify both `IncludeFilters` and `ExcludeFilters` in the same metric stream.
	//
	// When you modify the `IncludeFilters` or `ExcludeFilters` of an existing metric stream in any way, the metric stream is effectively restarted, so after such a change you will get only the datapoints that have a timestamp after the time of the update.
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-cloudwatch-metricstream.html#cfn-cloudwatch-metricstream-includefilters
	//
	IncludeFilters interface{} `field:"optional" json:"includeFilters" yaml:"includeFilters"`
	// If you are creating a metric stream in a monitoring account, specify `true` to include metrics from source accounts that are linked to this monitoring account, in the metric stream.
	//
	// The default is `false` .
	//
	// For more information about linking accounts, see [CloudWatch cross-account observability](https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/CloudWatch-Unified-Cross-Account.html)
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-cloudwatch-metricstream.html#cfn-cloudwatch-metricstream-includelinkedaccountsmetrics
	//
	IncludeLinkedAccountsMetrics interface{} `field:"optional" json:"includeLinkedAccountsMetrics" yaml:"includeLinkedAccountsMetrics"`
	// If you are creating a new metric stream, this is the name for the new stream.
	//
	// The name must be different than the names of other metric streams in this account and Region.
	//
	// If you are updating a metric stream, specify the name of that stream here.
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-cloudwatch-metricstream.html#cfn-cloudwatch-metricstream-name
	//
	Name *string `field:"optional" json:"name" yaml:"name"`
	// By default, a metric stream always sends the MAX, MIN, SUM, and SAMPLECOUNT statistics for each metric that is streamed.
	//
	// You can use this parameter to have the metric stream also send additional statistics in the stream. This array can have up to 100 members.
	//
	// For each entry in this array, you specify one or more metrics and the list of additional statistics to stream for those metrics. The additional statistics that you can stream depend on the stream's `OutputFormat` . If the `OutputFormat` is `json` , you can stream any additional statistic that is supported by CloudWatch , listed in [CloudWatch statistics definitions](https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/Statistics-definitions.html) . If the `OutputFormat` is OpenTelemetry, you can stream percentile statistics.
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-cloudwatch-metricstream.html#cfn-cloudwatch-metricstream-statisticsconfigurations
	//
	StatisticsConfigurations interface{} `field:"optional" json:"statisticsConfigurations" yaml:"statisticsConfigurations"`
	// An array of key-value pairs to apply to the metric stream.
	//
	// For more information, see [Tag](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-resource-tags.html) .
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-cloudwatch-metricstream.html#cfn-cloudwatch-metricstream-tags
	//
	Tags *[]*awscdk.CfnTag `field:"optional" json:"tags" yaml:"tags"`
}

Properties for defining a `CfnMetricStream`.

Example:

// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"

cfnMetricStreamProps := &CfnMetricStreamProps{
	FirehoseArn: jsii.String("firehoseArn"),
	OutputFormat: jsii.String("outputFormat"),
	RoleArn: jsii.String("roleArn"),

	// the properties below are optional
	ExcludeFilters: []interface{}{
		&MetricStreamFilterProperty{
			Namespace: jsii.String("namespace"),

			// the properties below are optional
			MetricNames: []*string{
				jsii.String("metricNames"),
			},
		},
	},
	IncludeFilters: []interface{}{
		&MetricStreamFilterProperty{
			Namespace: jsii.String("namespace"),

			// the properties below are optional
			MetricNames: []*string{
				jsii.String("metricNames"),
			},
		},
	},
	IncludeLinkedAccountsMetrics: jsii.Boolean(false),
	Name: jsii.String("name"),
	StatisticsConfigurations: []interface{}{
		&MetricStreamStatisticsConfigurationProperty{
			AdditionalStatistics: []*string{
				jsii.String("additionalStatistics"),
			},
			IncludeMetrics: []interface{}{
				&MetricStreamStatisticsMetricProperty{
					MetricName: jsii.String("metricName"),
					Namespace: jsii.String("namespace"),
				},
			},
		},
	},
	Tags: []cfnTag{
		&cfnTag{
			Key: jsii.String("key"),
			Value: jsii.String("value"),
		},
	},
}

See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-cloudwatch-metricstream.html

type CfnMetricStream_MetricStreamFilterProperty

type CfnMetricStream_MetricStreamFilterProperty struct {
	// The name of the metric namespace in the filter.
	//
	// The namespace can contain only ASCII printable characters (ASCII range 32 through 126). It must contain at least one non-whitespace character.
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudwatch-metricstream-metricstreamfilter.html#cfn-cloudwatch-metricstream-metricstreamfilter-namespace
	//
	Namespace *string `field:"required" json:"namespace" yaml:"namespace"`
	// The names of the metrics to either include or exclude from the metric stream.
	//
	// If you omit this parameter, all metrics in the namespace are included or excluded, depending on whether this filter is specified as an exclude filter or an include filter.
	//
	// Each metric name can contain only ASCII printable characters (ASCII range 32 through 126). Each metric name must contain at least one non-whitespace character.
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudwatch-metricstream-metricstreamfilter.html#cfn-cloudwatch-metricstream-metricstreamfilter-metricnames
	//
	MetricNames *[]*string `field:"optional" json:"metricNames" yaml:"metricNames"`
}

This structure contains a metric namespace and optionally, a list of metric names, to either include in a metric ' stream or exclude from a metric stream.

A metric stream's filters can include up to 1000 total names. This limit applies to the sum of namespace names and metric names in the filters. For example, this could include 10 metric namespace filters with 99 metrics each, or 20 namespace filters with 49 metrics specified in each filter.

Example:

// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"

metricStreamFilterProperty := &MetricStreamFilterProperty{
	Namespace: jsii.String("namespace"),

	// the properties below are optional
	MetricNames: []*string{
		jsii.String("metricNames"),
	},
}

See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudwatch-metricstream-metricstreamfilter.html

type CfnMetricStream_MetricStreamStatisticsConfigurationProperty added in v2.21.0

type CfnMetricStream_MetricStreamStatisticsConfigurationProperty struct {
	// The additional statistics to stream for the metrics listed in `IncludeMetrics` .
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudwatch-metricstream-metricstreamstatisticsconfiguration.html#cfn-cloudwatch-metricstream-metricstreamstatisticsconfiguration-additionalstatistics
	//
	AdditionalStatistics *[]*string `field:"required" json:"additionalStatistics" yaml:"additionalStatistics"`
	// An array that defines the metrics that are to have additional statistics streamed.
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudwatch-metricstream-metricstreamstatisticsconfiguration.html#cfn-cloudwatch-metricstream-metricstreamstatisticsconfiguration-includemetrics
	//
	IncludeMetrics interface{} `field:"required" json:"includeMetrics" yaml:"includeMetrics"`
}

This structure specifies a list of additional statistics to stream, and the metrics to stream those additional statistics for.

All metrics that match the combination of metric name and namespace will be streamed with the additional statistics, no matter their dimensions.

Example:

// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"

metricStreamStatisticsConfigurationProperty := &MetricStreamStatisticsConfigurationProperty{
	AdditionalStatistics: []*string{
		jsii.String("additionalStatistics"),
	},
	IncludeMetrics: []interface{}{
		&MetricStreamStatisticsMetricProperty{
			MetricName: jsii.String("metricName"),
			Namespace: jsii.String("namespace"),
		},
	},
}

See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudwatch-metricstream-metricstreamstatisticsconfiguration.html

type CfnMetricStream_MetricStreamStatisticsMetricProperty added in v2.21.0

type CfnMetricStream_MetricStreamStatisticsMetricProperty struct {
	// The name of the metric.
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudwatch-metricstream-metricstreamstatisticsmetric.html#cfn-cloudwatch-metricstream-metricstreamstatisticsmetric-metricname
	//
	MetricName *string `field:"required" json:"metricName" yaml:"metricName"`
	// The namespace of the metric.
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudwatch-metricstream-metricstreamstatisticsmetric.html#cfn-cloudwatch-metricstream-metricstreamstatisticsmetric-namespace
	//
	Namespace *string `field:"required" json:"namespace" yaml:"namespace"`
}

A structure that specifies the metric name and namespace for one metric that is going to have additional statistics included in the stream.

Example:

// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"

metricStreamStatisticsMetricProperty := &MetricStreamStatisticsMetricProperty{
	MetricName: jsii.String("metricName"),
	Namespace: jsii.String("namespace"),
}

See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudwatch-metricstream-metricstreamstatisticsmetric.html

type Color

type Color interface {
}

A set of standard colours that can be used in annotations in a GraphWidget.

Example:

var dashboard dashboard

dashboard.AddWidgets(cloudwatch.NewGraphWidget(&GraphWidgetProps{
	// ...

	LeftAnnotations: []horizontalAnnotation{
		&horizontalAnnotation{
			Value: jsii.Number(1800),
			Label: awscdk.Duration_Minutes(jsii.Number(30)).ToHumanString(),
			Color: cloudwatch.Color_RED(),
		},
		&horizontalAnnotation{
			Value: jsii.Number(3600),
			Label: jsii.String("1 hour"),
			Color: jsii.String("#2ca02c"),
		},
	},
	VerticalAnnotations: []verticalAnnotation{
		&verticalAnnotation{
			Date: jsii.String("2022-10-19T00:00:00Z"),
			Label: jsii.String("Deployment"),
			Color: cloudwatch.Color_RED(),
		},
	},
}))

type Column

type Column interface {
	IWidget
	// The amount of vertical grid units the widget will take up.
	Height() *float64
	// List of contained widgets.
	Widgets() *[]IWidget
	// The amount of horizontal grid units the widget will take up.
	Width() *float64
	// Add the widget to this container.
	AddWidget(w IWidget)
	// Place the widget at a given position.
	Position(x *float64, y *float64)
	// Return the widget JSON for use in the dashboard.
	ToJson() *[]interface{}
}

A widget that contains other widgets in a vertical column.

Widgets will be laid out next to each other.

Example:

var widgetA iWidget
var widgetB iWidget

cloudwatch.NewColumn(widgetA, widgetB)

func NewColumn

func NewColumn(widgets ...IWidget) Column

type CommonMetricOptions

type CommonMetricOptions struct {
	// Account which this metric comes from.
	// Default: - Deployment account.
	//
	Account *string `field:"optional" json:"account" yaml:"account"`
	// The hex color code, prefixed with '#' (e.g. '#00ff00'), to use when this metric is rendered on a graph. The `Color` class has a set of standard colors that can be used here.
	// Default: - Automatic color.
	//
	Color *string `field:"optional" json:"color" yaml:"color"`
	// Dimensions of the metric.
	// Default: - No dimensions.
	//
	DimensionsMap *map[string]*string `field:"optional" json:"dimensionsMap" yaml:"dimensionsMap"`
	// Label for this metric when added to a Graph in a Dashboard.
	//
	// You can use [dynamic labels](https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/graph-dynamic-labels.html)
	// to show summary information about the entire displayed time series
	// in the legend. For example, if you use:
	//
	// “`
	// [max: ${MAX}] MyMetric
	// “`
	//
	// As the metric label, the maximum value in the visible range will
	// be shown next to the time series name in the graph's legend.
	// Default: - No label.
	//
	Label *string `field:"optional" json:"label" yaml:"label"`
	// The period over which the specified statistic is applied.
	// Default: Duration.minutes(5)
	//
	Period awscdk.Duration `field:"optional" json:"period" yaml:"period"`
	// Region which this metric comes from.
	// Default: - Deployment region.
	//
	Region *string `field:"optional" json:"region" yaml:"region"`
	// What function to use for aggregating.
	//
	// Use the `aws_cloudwatch.Stats` helper class to construct valid input strings.
	//
	// Can be one of the following:
	//
	// - "Minimum" | "min"
	// - "Maximum" | "max"
	// - "Average" | "avg"
	// - "Sum" | "sum"
	// - "SampleCount | "n"
	// - "pNN.NN"
	// - "tmNN.NN" | "tm(NN.NN%:NN.NN%)"
	// - "iqm"
	// - "wmNN.NN" | "wm(NN.NN%:NN.NN%)"
	// - "tcNN.NN" | "tc(NN.NN%:NN.NN%)"
	// - "tsNN.NN" | "ts(NN.NN%:NN.NN%)"
	// Default: Average.
	//
	Statistic *string `field:"optional" json:"statistic" yaml:"statistic"`
	// Unit used to filter the metric stream.
	//
	// Only refer to datums emitted to the metric stream with the given unit and
	// ignore all others. Only useful when datums are being emitted to the same
	// metric stream under different units.
	//
	// The default is to use all matric datums in the stream, regardless of unit,
	// which is recommended in nearly all cases.
	//
	// CloudWatch does not honor this property for graphs.
	// Default: - All metric datums in the given metric stream.
	//
	Unit Unit `field:"optional" json:"unit" yaml:"unit"`
}

Options shared by most methods accepting metric options.

Example:

// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import cdk "github.com/aws/aws-cdk-go/awscdk"
import "github.com/aws/aws-cdk-go/awscdk"

commonMetricOptions := &CommonMetricOptions{
	Account: jsii.String("account"),
	Color: jsii.String("color"),
	DimensionsMap: map[string]*string{
		"dimensionsMapKey": jsii.String("dimensionsMap"),
	},
	Label: jsii.String("label"),
	Period: cdk.Duration_Minutes(jsii.Number(30)),
	Region: jsii.String("region"),
	Statistic: jsii.String("statistic"),
	Unit: awscdk.Aws_cloudwatch.Unit_SECONDS,
}

type ComparisonOperator

type ComparisonOperator string

Comparison operator for evaluating alarms.

Example:

import cloudwatch "github.com/aws/aws-cdk-go/awscdk"

var myHostedZone hostedZone

certificate := acm.NewCertificate(this, jsii.String("Certificate"), &CertificateProps{
	DomainName: jsii.String("hello.example.com"),
	Validation: acm.CertificateValidation_FromDns(myHostedZone),
})
certificate.metricDaysToExpiry().CreateAlarm(this, jsii.String("Alarm"), &CreateAlarmOptions{
	ComparisonOperator: cloudwatch.ComparisonOperator_LESS_THAN_THRESHOLD,
	EvaluationPeriods: jsii.Number(1),
	Threshold: jsii.Number(45),
})
const (
	// Specified statistic is greater than or equal to the threshold.
	ComparisonOperator_GREATER_THAN_OR_EQUAL_TO_THRESHOLD ComparisonOperator = "GREATER_THAN_OR_EQUAL_TO_THRESHOLD"
	// Specified statistic is strictly greater than the threshold.
	ComparisonOperator_GREATER_THAN_THRESHOLD ComparisonOperator = "GREATER_THAN_THRESHOLD"
	// Specified statistic is strictly less than the threshold.
	ComparisonOperator_LESS_THAN_THRESHOLD ComparisonOperator = "LESS_THAN_THRESHOLD"
	// Specified statistic is less than or equal to the threshold.
	ComparisonOperator_LESS_THAN_OR_EQUAL_TO_THRESHOLD ComparisonOperator = "LESS_THAN_OR_EQUAL_TO_THRESHOLD"
	// Specified statistic is lower than or greater than the anomaly model band.
	//
	// Used only for alarms based on anomaly detection models.
	ComparisonOperator_LESS_THAN_LOWER_OR_GREATER_THAN_UPPER_THRESHOLD ComparisonOperator = "LESS_THAN_LOWER_OR_GREATER_THAN_UPPER_THRESHOLD"
	// Specified statistic is greater than the anomaly model band.
	//
	// Used only for alarms based on anomaly detection models.
	ComparisonOperator_GREATER_THAN_UPPER_THRESHOLD ComparisonOperator = "GREATER_THAN_UPPER_THRESHOLD"
	// Specified statistic is lower than the anomaly model band.
	//
	// Used only for alarms based on anomaly detection models.
	ComparisonOperator_LESS_THAN_LOWER_THRESHOLD ComparisonOperator = "LESS_THAN_LOWER_THRESHOLD"
)

type CompositeAlarm

type CompositeAlarm interface {
	AlarmBase
	AlarmActionArns() *[]*string
	SetAlarmActionArns(val *[]*string)
	// ARN of this alarm.
	AlarmArn() *string
	// Name of this alarm.
	AlarmName() *string
	// The environment this resource belongs to.
	//
	// For resources that are created and managed by the CDK
	// (generally, those created by creating new class instances like Role, Bucket, etc.),
	// this is always the same as the environment of the stack they belong to;
	// however, for imported resources
	// (those obtained from static methods like fromRoleArn, fromBucketName, etc.),
	// that might be different than the stack they were imported into.
	Env() *awscdk.ResourceEnvironment
	InsufficientDataActionArns() *[]*string
	SetInsufficientDataActionArns(val *[]*string)
	// The tree node.
	Node() constructs.Node
	OkActionArns() *[]*string
	SetOkActionArns(val *[]*string)
	// Returns a string-encoded token that resolves to the physical name that should be passed to the CloudFormation resource.
	//
	// This value will resolve to one of the following:
	// - a concrete value (e.g. `"my-awesome-bucket"`)
	// - `undefined`, when a name should be generated by CloudFormation
	// - a concrete name generated automatically during synthesis, in
	//   cross-environment scenarios.
	PhysicalName() *string
	// The stack in which this resource is defined.
	Stack() awscdk.Stack
	// Trigger this action if the alarm fires.
	//
	// Typically SnsAction or AutoScalingAction.
	AddAlarmAction(actions ...IAlarmAction)
	// Trigger this action if there is insufficient data to evaluate the alarm.
	//
	// Typically SnsAction or AutoScalingAction.
	AddInsufficientDataAction(actions ...IAlarmAction)
	// Trigger this action if the alarm returns from breaching state into ok state.
	//
	// Typically SnsAction or AutoScalingAction.
	AddOkAction(actions ...IAlarmAction)
	// Apply the given removal policy to this resource.
	//
	// The Removal Policy controls what happens to this resource when it stops
	// being managed by CloudFormation, either because you've removed it from the
	// CDK application or because you've made a change that requires the resource
	// to be replaced.
	//
	// The resource can be deleted (`RemovalPolicy.DESTROY`), or left in your AWS
	// account for data recovery and cleanup later (`RemovalPolicy.RETAIN`).
	ApplyRemovalPolicy(policy awscdk.RemovalPolicy)
	GeneratePhysicalName() *string
	// Returns an environment-sensitive token that should be used for the resource's "ARN" attribute (e.g. `bucket.bucketArn`).
	//
	// Normally, this token will resolve to `arnAttr`, but if the resource is
	// referenced across environments, `arnComponents` will be used to synthesize
	// a concrete ARN with the resource's physical name. Make sure to reference
	// `this.physicalName` in `arnComponents`.
	GetResourceArnAttribute(arnAttr *string, arnComponents *awscdk.ArnComponents) *string
	// Returns an environment-sensitive token that should be used for the resource's "name" attribute (e.g. `bucket.bucketName`).
	//
	// Normally, this token will resolve to `nameAttr`, but if the resource is
	// referenced across environments, it will be resolved to `this.physicalName`,
	// which will be a concrete name.
	GetResourceNameAttribute(nameAttr *string) *string
	// AlarmRule indicating ALARM state for Alarm.
	RenderAlarmRule() *string
	// Returns a string representation of this construct.
	ToString() *string
}

A Composite Alarm based on Alarm Rule.

Example:

var alarm1 alarm
var alarm2 alarm
var alarm3 alarm
var alarm4 alarm

alarmRule := cloudwatch.AlarmRule_AnyOf(cloudwatch.AlarmRule_AllOf(cloudwatch.AlarmRule_AnyOf(alarm1, cloudwatch.AlarmRule_FromAlarm(alarm2, cloudwatch.AlarmState_OK), alarm3), cloudwatch.AlarmRule_Not(cloudwatch.AlarmRule_FromAlarm(alarm4, cloudwatch.AlarmState_INSUFFICIENT_DATA))), cloudwatch.AlarmRule_FromBoolean(jsii.Boolean(false)))

cloudwatch.NewCompositeAlarm(this, jsii.String("MyAwesomeCompositeAlarm"), &CompositeAlarmProps{
	AlarmRule: AlarmRule,
})

func NewCompositeAlarm

func NewCompositeAlarm(scope constructs.Construct, id *string, props *CompositeAlarmProps) CompositeAlarm

type CompositeAlarmProps

type CompositeAlarmProps struct {
	// Expression that specifies which other alarms are to be evaluated to determine this composite alarm's state.
	AlarmRule IAlarmRule `field:"required" json:"alarmRule" yaml:"alarmRule"`
	// Whether the actions for this alarm are enabled.
	// Default: true.
	//
	ActionsEnabled *bool `field:"optional" json:"actionsEnabled" yaml:"actionsEnabled"`
	// Actions will be suppressed if the suppressor alarm is in the ALARM state.
	// Default: - alarm will not be suppressed.
	//
	ActionsSuppressor IAlarm `field:"optional" json:"actionsSuppressor" yaml:"actionsSuppressor"`
	// The maximum duration that the composite alarm waits after suppressor alarm goes out of the ALARM state.
	//
	// After this time, the composite alarm performs its actions.
	// Default: - 1 minute extension period will be set.
	//
	ActionsSuppressorExtensionPeriod awscdk.Duration `field:"optional" json:"actionsSuppressorExtensionPeriod" yaml:"actionsSuppressorExtensionPeriod"`
	// The maximum duration that the composite alarm waits for the suppressor alarm to go into the ALARM state.
	//
	// After this time, the composite alarm performs its actions.
	// Default: - 1 minute wait period will be set.
	//
	ActionsSuppressorWaitPeriod awscdk.Duration `field:"optional" json:"actionsSuppressorWaitPeriod" yaml:"actionsSuppressorWaitPeriod"`
	// Description for the alarm.
	// Default: - No description.
	//
	AlarmDescription *string `field:"optional" json:"alarmDescription" yaml:"alarmDescription"`
	// Name of the alarm.
	// Default: - Automatically generated name.
	//
	CompositeAlarmName *string `field:"optional" json:"compositeAlarmName" yaml:"compositeAlarmName"`
}

Properties for creating a Composite Alarm.

Example:

var alarm1 alarm
var alarm2 alarm
var alarm3 alarm
var alarm4 alarm

alarmRule := cloudwatch.AlarmRule_AnyOf(cloudwatch.AlarmRule_AllOf(cloudwatch.AlarmRule_AnyOf(alarm1, cloudwatch.AlarmRule_FromAlarm(alarm2, cloudwatch.AlarmState_OK), alarm3), cloudwatch.AlarmRule_Not(cloudwatch.AlarmRule_FromAlarm(alarm4, cloudwatch.AlarmState_INSUFFICIENT_DATA))), cloudwatch.AlarmRule_FromBoolean(jsii.Boolean(false)))

cloudwatch.NewCompositeAlarm(this, jsii.String("MyAwesomeCompositeAlarm"), &CompositeAlarmProps{
	AlarmRule: AlarmRule,
})

type ConcreteWidget

type ConcreteWidget interface {
	IWidget
	// The amount of vertical grid units the widget will take up.
	Height() *float64
	// Any warnings that are produced as a result of putting together this widget.
	Warnings() *[]*string
	// Any warnings that are produced as a result of putting together this widget.
	WarningsV2() *map[string]*string
	// The amount of horizontal grid units the widget will take up.
	Width() *float64
	X() *float64
	SetX(val *float64)
	Y() *float64
	SetY(val *float64)
	// Copy the warnings from the given metric.
	CopyMetricWarnings(ms ...IMetric)
	// Place the widget at a given position.
	Position(x *float64, y *float64)
	// Return the widget JSON for use in the dashboard.
	ToJson() *[]interface{}
}

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.

type CreateAlarmOptions

type CreateAlarmOptions struct {
	// The number of periods over which data is compared to the specified threshold.
	EvaluationPeriods *float64 `field:"required" json:"evaluationPeriods" yaml:"evaluationPeriods"`
	// The value against which the specified statistic is compared.
	Threshold *float64 `field:"required" json:"threshold" yaml:"threshold"`
	// Whether the actions for this alarm are enabled.
	// Default: true.
	//
	ActionsEnabled *bool `field:"optional" json:"actionsEnabled" yaml:"actionsEnabled"`
	// Description for the alarm.
	// Default: No description.
	//
	AlarmDescription *string `field:"optional" json:"alarmDescription" yaml:"alarmDescription"`
	// Name of the alarm.
	// Default: Automatically generated name.
	//
	AlarmName *string `field:"optional" json:"alarmName" yaml:"alarmName"`
	// Comparison to use to check if metric is breaching.
	// Default: GreaterThanOrEqualToThreshold.
	//
	ComparisonOperator ComparisonOperator `field:"optional" json:"comparisonOperator" yaml:"comparisonOperator"`
	// The number of datapoints that must be breaching to trigger the alarm.
	//
	// This is used only if you are setting an "M
	// out of N" alarm. In that case, this value is the M. For more information, see Evaluating an Alarm in the Amazon
	// CloudWatch User Guide.
	// See: https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/AlarmThatSendsEmail.html#alarm-evaluation
	//
	// Default: “evaluationPeriods“.
	//
	DatapointsToAlarm *float64 `field:"optional" json:"datapointsToAlarm" yaml:"datapointsToAlarm"`
	// Specifies whether to evaluate the data and potentially change the alarm state if there are too few data points to be statistically significant.
	//
	// Used only for alarms that are based on percentiles.
	// Default: - Not configured.
	//
	EvaluateLowSampleCountPercentile *string `field:"optional" json:"evaluateLowSampleCountPercentile" yaml:"evaluateLowSampleCountPercentile"`
	// Sets how this alarm is to handle missing data points.
	// Default: TreatMissingData.Missing
	//
	TreatMissingData TreatMissingData `field:"optional" json:"treatMissingData" yaml:"treatMissingData"`
}

Properties needed to make an alarm from a metric.

Example:

import cloudwatch "github.com/aws/aws-cdk-go/awscdk"

var myHostedZone hostedZone

certificate := acm.NewCertificate(this, jsii.String("Certificate"), &CertificateProps{
	DomainName: jsii.String("hello.example.com"),
	Validation: acm.CertificateValidation_FromDns(myHostedZone),
})
certificate.metricDaysToExpiry().CreateAlarm(this, jsii.String("Alarm"), &CreateAlarmOptions{
	ComparisonOperator: cloudwatch.ComparisonOperator_LESS_THAN_THRESHOLD,
	EvaluationPeriods: jsii.Number(1),
	Threshold: jsii.Number(45),
})

type CustomWidget added in v2.23.0

type CustomWidget interface {
	ConcreteWidget
	// The amount of vertical grid units the widget will take up.
	Height() *float64
	// Any warnings that are produced as a result of putting together this widget.
	Warnings() *[]*string
	// Any warnings that are produced as a result of putting together this widget.
	WarningsV2() *map[string]*string
	// The amount of horizontal grid units the widget will take up.
	Width() *float64
	X() *float64
	SetX(val *float64)
	Y() *float64
	SetY(val *float64)
	// Copy the warnings from the given metric.
	CopyMetricWarnings(ms ...IMetric)
	// Place the widget at a given position.
	Position(x *float64, y *float64)
	// Return the widget JSON for use in the dashboard.
	ToJson() *[]interface{}
}

A CustomWidget shows the result of a AWS lambda function.

Example:

var dashboard dashboard

// Import or create a lambda function
fn := lambda.Function_FromFunctionArn(dashboard, jsii.String("Function"), jsii.String("arn:aws:lambda:us-east-1:123456789012:function:MyFn"))

dashboard.AddWidgets(cloudwatch.NewCustomWidget(&CustomWidgetProps{
	FunctionArn: fn.FunctionArn,
	Title: jsii.String("My lambda baked widget"),
}))

func NewCustomWidget added in v2.23.0

func NewCustomWidget(props *CustomWidgetProps) CustomWidget

type CustomWidgetProps added in v2.23.0

type CustomWidgetProps struct {
	// The Arn of the AWS Lambda function that returns HTML or JSON that will be displayed in the widget.
	FunctionArn *string `field:"required" json:"functionArn" yaml:"functionArn"`
	// The title of the widget.
	Title *string `field:"required" json:"title" yaml:"title"`
	// Height of the widget.
	// Default: - 6 for Alarm and Graph widgets.
	// 3 for single value widgets where most recent value of a metric is displayed.
	//
	Height *float64 `field:"optional" json:"height" yaml:"height"`
	// Parameters passed to the lambda function.
	// Default: - no parameters are passed to the lambda function.
	//
	Params interface{} `field:"optional" json:"params" yaml:"params"`
	// Update the widget on refresh.
	// Default: true.
	//
	UpdateOnRefresh *bool `field:"optional" json:"updateOnRefresh" yaml:"updateOnRefresh"`
	// Update the widget on resize.
	// Default: true.
	//
	UpdateOnResize *bool `field:"optional" json:"updateOnResize" yaml:"updateOnResize"`
	// Update the widget on time range change.
	// Default: true.
	//
	UpdateOnTimeRangeChange *bool `field:"optional" json:"updateOnTimeRangeChange" yaml:"updateOnTimeRangeChange"`
	// Width of the widget, in a grid of 24 units wide.
	// Default: 6.
	//
	Width *float64 `field:"optional" json:"width" yaml:"width"`
}

The properties for a CustomWidget.

Example:

var dashboard dashboard

// Import or create a lambda function
fn := lambda.Function_FromFunctionArn(dashboard, jsii.String("Function"), jsii.String("arn:aws:lambda:us-east-1:123456789012:function:MyFn"))

dashboard.AddWidgets(cloudwatch.NewCustomWidget(&CustomWidgetProps{
	FunctionArn: fn.FunctionArn,
	Title: jsii.String("My lambda baked widget"),
}))

type Dashboard

type Dashboard interface {
	awscdk.Resource
	// ARN of this dashboard.
	DashboardArn() *string
	// The name of this dashboard.
	DashboardName() *string
	// The environment this resource belongs to.
	//
	// For resources that are created and managed by the CDK
	// (generally, those created by creating new class instances like Role, Bucket, etc.),
	// this is always the same as the environment of the stack they belong to;
	// however, for imported resources
	// (those obtained from static methods like fromRoleArn, fromBucketName, etc.),
	// that might be different than the stack they were imported into.
	Env() *awscdk.ResourceEnvironment
	// The tree node.
	Node() constructs.Node
	// Returns a string-encoded token that resolves to the physical name that should be passed to the CloudFormation resource.
	//
	// This value will resolve to one of the following:
	// - a concrete value (e.g. `"my-awesome-bucket"`)
	// - `undefined`, when a name should be generated by CloudFormation
	// - a concrete name generated automatically during synthesis, in
	//   cross-environment scenarios.
	PhysicalName() *string
	// The stack in which this resource is defined.
	Stack() awscdk.Stack
	// Add a variable to the dashboard.
	// See: https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/cloudwatch_dashboard_variables.html
	//
	AddVariable(variable IVariable)
	// Add a widget to the dashboard.
	//
	// Widgets given in multiple calls to add() will be laid out stacked on
	// top of each other.
	//
	// Multiple widgets added in the same call to add() will be laid out next
	// to each other.
	AddWidgets(widgets ...IWidget)
	// Apply the given removal policy to this resource.
	//
	// The Removal Policy controls what happens to this resource when it stops
	// being managed by CloudFormation, either because you've removed it from the
	// CDK application or because you've made a change that requires the resource
	// to be replaced.
	//
	// The resource can be deleted (`RemovalPolicy.DESTROY`), or left in your AWS
	// account for data recovery and cleanup later (`RemovalPolicy.RETAIN`).
	ApplyRemovalPolicy(policy awscdk.RemovalPolicy)
	GeneratePhysicalName() *string
	// Returns an environment-sensitive token that should be used for the resource's "ARN" attribute (e.g. `bucket.bucketArn`).
	//
	// Normally, this token will resolve to `arnAttr`, but if the resource is
	// referenced across environments, `arnComponents` will be used to synthesize
	// a concrete ARN with the resource's physical name. Make sure to reference
	// `this.physicalName` in `arnComponents`.
	GetResourceArnAttribute(arnAttr *string, arnComponents *awscdk.ArnComponents) *string
	// Returns an environment-sensitive token that should be used for the resource's "name" attribute (e.g. `bucket.bucketName`).
	//
	// Normally, this token will resolve to `nameAttr`, but if the resource is
	// referenced across environments, it will be resolved to `this.physicalName`,
	// which will be a concrete name.
	GetResourceNameAttribute(nameAttr *string) *string
	// Returns a string representation of this construct.
	ToString() *string
}

A CloudWatch dashboard.

Example:

import "github.com/aws/aws-cdk-go/awscdk"

dashboard := cw.NewDashboard(this, jsii.String("Dash"), &DashboardProps{
	DefaultInterval: awscdk.Duration_Days(jsii.Number(7)),
	Variables: []iVariable{
		cw.NewDashboardVariable(&DashboardVariableOptions{
			Id: jsii.String("region2"),
			Type: cw.VariableType_PATTERN,
			Label: jsii.String("RegionPattern"),
			InputType: cw.VariableInputType_INPUT,
			Value: jsii.String("us-east-1"),
			DefaultValue: cw.DefaultValue_Value(jsii.String("us-east-1")),
			Visible: jsii.Boolean(true),
		}),
	},
})

func NewDashboard

func NewDashboard(scope constructs.Construct, id *string, props *DashboardProps) Dashboard

type DashboardProps

type DashboardProps struct {
	// Name of the dashboard.
	//
	// If set, must only contain alphanumerics, dash (-) and underscore (_).
	// Default: - automatically generated name.
	//
	DashboardName *string `field:"optional" json:"dashboardName" yaml:"dashboardName"`
	// 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.
	//
	DefaultInterval awscdk.Duration `field:"optional" json:"defaultInterval" yaml:"defaultInterval"`
	// 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.
	// Specify an absolute time in the ISO 8601 format. For example, 2018-12-17T06:00:00.000Z.
	// Default: When the dashboard loads, the end date will be the current time.
	//
	End *string `field:"optional" json:"end" yaml:"end"`
	// 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.
	// Default: Auto.
	//
	PeriodOverride PeriodOverride `field:"optional" json:"periodOverride" yaml:"periodOverride"`
	// 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.
	//
	// Both properties `defaultInterval` and `start` cannot be set at once.
	// Default: When the dashboard loads, the start time will be the default time range.
	//
	Start *string `field:"optional" json:"start" yaml:"start"`
	// A list of dashboard variables.
	// See: https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/cloudwatch_dashboard_variables.html#cloudwatch_dashboard_variables_types
	//
	// Default: - No variables.
	//
	Variables *[]IVariable `field:"optional" json:"variables" yaml:"variables"`
	// Initial set of widgets on the dashboard.
	//
	// One array represents a row of widgets.
	// Default: - No widgets.
	//
	Widgets *[]*[]IWidget `field:"optional" json:"widgets" yaml:"widgets"`
}

Properties for defining a CloudWatch Dashboard.

Example:

import "github.com/aws/aws-cdk-go/awscdk"

dashboard := cw.NewDashboard(this, jsii.String("Dash"), &DashboardProps{
	DefaultInterval: awscdk.Duration_Days(jsii.Number(7)),
	Variables: []iVariable{
		cw.NewDashboardVariable(&DashboardVariableOptions{
			Id: jsii.String("region2"),
			Type: cw.VariableType_PATTERN,
			Label: jsii.String("RegionPattern"),
			InputType: cw.VariableInputType_INPUT,
			Value: jsii.String("us-east-1"),
			DefaultValue: cw.DefaultValue_Value(jsii.String("us-east-1")),
			Visible: jsii.Boolean(true),
		}),
	},
})

type DashboardVariable added in v2.88.0

type DashboardVariable interface {
	IVariable
	// Return the variable JSON for use in the dashboard.
	ToJson() interface{}
}

Dashboard Variable.

Example:

import "github.com/aws/aws-cdk-go/awscdk"

dashboard := cw.NewDashboard(this, jsii.String("Dash"), &DashboardProps{
	DefaultInterval: awscdk.Duration_Days(jsii.Number(7)),
	Variables: []iVariable{
		cw.NewDashboardVariable(&DashboardVariableOptions{
			Id: jsii.String("functionName"),
			Type: cw.VariableType_PATTERN,
			Label: jsii.String("Function"),
			InputType: cw.VariableInputType_RADIO,
			Value: jsii.String("originalFuncNameInDashboard"),
			// equivalent to cw.Values.fromSearch('{AWS/Lambda,FunctionName} MetricName=\"Duration\"', 'FunctionName')
			Values: cw.Values_FromSearchComponents(&SearchComponents{
				Namespace: jsii.String("AWS/Lambda"),
				Dimensions: []*string{
					jsii.String("FunctionName"),
				},
				MetricName: jsii.String("Duration"),
				PopulateFrom: jsii.String("FunctionName"),
			}),
			DefaultValue: cw.DefaultValue_FIRST(),
			Visible: jsii.Boolean(true),
		}),
	},
})

func NewDashboardVariable added in v2.88.0

func NewDashboardVariable(options *DashboardVariableOptions) DashboardVariable

type DashboardVariableOptions added in v2.88.0

type DashboardVariableOptions struct {
	// Unique id.
	Id *string `field:"required" json:"id" yaml:"id"`
	// The way the variable value is selected.
	InputType VariableInputType `field:"required" json:"inputType" yaml:"inputType"`
	// Type of the variable.
	Type VariableType `field:"required" json:"type" yaml:"type"`
	// Pattern or property value to replace.
	Value *string `field:"required" json:"value" yaml:"value"`
	// Optional default value.
	// Default: - no default value is set.
	//
	DefaultValue DefaultValue `field:"optional" json:"defaultValue" yaml:"defaultValue"`
	// Optional label in the toolbar.
	// Default: - the variable's value.
	//
	Label *string `field:"optional" json:"label" yaml:"label"`
	// Optional values (required for {@link VariableInputType.RADIO} and {@link VariableInputType.SELECT} dashboard variables).
	// Default: - no values.
	//
	Values Values `field:"optional" json:"values" yaml:"values"`
	// Whether the variable is visible.
	// Default: - true.
	//
	Visible *bool `field:"optional" json:"visible" yaml:"visible"`
}

Options for {@link DashboardVariable}.

Example:

import "github.com/aws/aws-cdk-go/awscdk"

dashboard := cw.NewDashboard(this, jsii.String("Dash"), &DashboardProps{
	DefaultInterval: awscdk.Duration_Days(jsii.Number(7)),
	Variables: []iVariable{
		cw.NewDashboardVariable(&DashboardVariableOptions{
			Id: jsii.String("functionName"),
			Type: cw.VariableType_PATTERN,
			Label: jsii.String("Function"),
			InputType: cw.VariableInputType_RADIO,
			Value: jsii.String("originalFuncNameInDashboard"),
			// equivalent to cw.Values.fromSearch('{AWS/Lambda,FunctionName} MetricName=\"Duration\"', 'FunctionName')
			Values: cw.Values_FromSearchComponents(&SearchComponents{
				Namespace: jsii.String("AWS/Lambda"),
				Dimensions: []*string{
					jsii.String("FunctionName"),
				},
				MetricName: jsii.String("Duration"),
				PopulateFrom: jsii.String("FunctionName"),
			}),
			DefaultValue: cw.DefaultValue_FIRST(),
			Visible: jsii.Boolean(true),
		}),
	},
})

type DefaultValue added in v2.88.0

type DefaultValue interface {
	Val() interface{}
}

Default value for use in {@link DashboardVariableOptions}.

Example:

import "github.com/aws/aws-cdk-go/awscdk"

dashboard := cw.NewDashboard(this, jsii.String("Dash"), &DashboardProps{
	DefaultInterval: awscdk.Duration_Days(jsii.Number(7)),
	Variables: []iVariable{
		cw.NewDashboardVariable(&DashboardVariableOptions{
			Id: jsii.String("functionName"),
			Type: cw.VariableType_PATTERN,
			Label: jsii.String("Function"),
			InputType: cw.VariableInputType_RADIO,
			Value: jsii.String("originalFuncNameInDashboard"),
			// equivalent to cw.Values.fromSearch('{AWS/Lambda,FunctionName} MetricName=\"Duration\"', 'FunctionName')
			Values: cw.Values_FromSearchComponents(&SearchComponents{
				Namespace: jsii.String("AWS/Lambda"),
				Dimensions: []*string{
					jsii.String("FunctionName"),
				},
				MetricName: jsii.String("Duration"),
				PopulateFrom: jsii.String("FunctionName"),
			}),
			DefaultValue: cw.DefaultValue_FIRST(),
			Visible: jsii.Boolean(true),
		}),
	},
})

func DefaultValue_FIRST added in v2.88.0

func DefaultValue_FIRST() DefaultValue

func DefaultValue_Value added in v2.88.0

func DefaultValue_Value(value interface{}) DefaultValue

Create a default value.

type Dimension

type Dimension struct {
	// Name of the dimension.
	Name *string `field:"required" json:"name" yaml:"name"`
	// Value of the dimension.
	Value interface{} `field:"required" json:"value" yaml:"value"`
}

Metric dimension.

Example:

// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"

var value interface{}

dimension := &Dimension{
	Name: jsii.String("name"),
	Value: value,
}

See: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cw-dimension.html

type GaugeWidget added in v2.44.0

type GaugeWidget interface {
	ConcreteWidget
	// The amount of vertical grid units the widget will take up.
	Height() *float64
	// Any warnings that are produced as a result of putting together this widget.
	Warnings() *[]*string
	// Any warnings that are produced as a result of putting together this widget.
	WarningsV2() *map[string]*string
	// The amount of horizontal grid units the widget will take up.
	Width() *float64
	X() *float64
	SetX(val *float64)
	Y() *float64
	SetY(val *float64)
	// Add another metric to the left Y axis of the GaugeWidget.
	AddMetric(metric IMetric)
	// Copy the warnings from the given metric.
	CopyMetricWarnings(ms ...IMetric)
	// Place the widget at a given position.
	Position(x *float64, y *float64)
	// Return the widget JSON for use in the dashboard.
	ToJson() *[]interface{}
}

A dashboard gauge widget that displays metrics.

Example:

var dashboard dashboard
var errorAlarm alarm
var gaugeMetric metric

dashboard.AddWidgets(cloudwatch.NewGaugeWidget(&GaugeWidgetProps{
	Metrics: []iMetric{
		gaugeMetric,
	},
	LeftYAxis: &YAxisProps{
		Min: jsii.Number(0),
		Max: jsii.Number(1000),
	},
}))

func NewGaugeWidget added in v2.44.0

func NewGaugeWidget(props *GaugeWidgetProps) GaugeWidget

type GaugeWidgetProps added in v2.44.0

type GaugeWidgetProps struct {
	// Height of the widget.
	// Default: - 6 for Alarm and Graph widgets.
	// 3 for single value widgets where most recent value of a metric is displayed.
	//
	Height *float64 `field:"optional" json:"height" yaml:"height"`
	// The region the metrics of this graph should be taken from.
	// Default: - Current region.
	//
	Region *string `field:"optional" json:"region" yaml:"region"`
	// Title for the graph.
	// Default: - None.
	//
	Title *string `field:"optional" json:"title" yaml:"title"`
	// Width of the widget, in a grid of 24 units wide.
	// Default: 6.
	//
	Width *float64 `field:"optional" json:"width" yaml:"width"`
	// Annotations for the left Y axis.
	// Default: - No annotations.
	//
	Annotations *[]*HorizontalAnnotation `field:"optional" json:"annotations" yaml:"annotations"`
	// The end of the time range to use for each widget independently from those of the dashboard.
	//
	// 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.
	// Default: When the dashboard loads, the end date will be the current time.
	//
	End *string `field:"optional" json:"end" yaml:"end"`
	// Left Y axis.
	// Default: - None.
	//
	LeftYAxis *YAxisProps `field:"optional" json:"leftYAxis" yaml:"leftYAxis"`
	// Position of the legend.
	// Default: - bottom.
	//
	LegendPosition LegendPosition `field:"optional" json:"legendPosition" yaml:"legendPosition"`
	// Whether the graph should show live data.
	// Default: false.
	//
	LiveData *bool `field:"optional" json:"liveData" yaml:"liveData"`
	// Metrics to display on left Y axis.
	// Default: - No metrics.
	//
	Metrics *[]IMetric `field:"optional" json:"metrics" yaml:"metrics"`
	// The default period 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.
	// Default: cdk.Duration.seconds(300)
	//
	Period awscdk.Duration `field:"optional" json:"period" yaml:"period"`
	// Whether to show the value from the entire time range. Only applicable for Bar and Pie charts.
	//
	// If false, values will be from the most recent period of your chosen time range;
	// if true, shows the value from the entire time range.
	// Default: false.
	//
	SetPeriodToTimeRange *bool `field:"optional" json:"setPeriodToTimeRange" yaml:"setPeriodToTimeRange"`
	// The start of the time range to use for each widget independently from those of 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.
	// Default: When the dashboard loads, the start time will be the default time range.
	//
	Start *string `field:"optional" json:"start" yaml:"start"`
	// The default statistic to be displayed for each metric.
	//
	// This default can be overridden within the definition of each individual metric.
	// Default: - The statistic for each metric is used.
	//
	Statistic *string `field:"optional" json:"statistic" yaml:"statistic"`
}

Properties for a GaugeWidget.

Example:

var dashboard dashboard
var errorAlarm alarm
var gaugeMetric metric

dashboard.AddWidgets(cloudwatch.NewGaugeWidget(&GaugeWidgetProps{
	Metrics: []iMetric{
		gaugeMetric,
	},
	LeftYAxis: &YAxisProps{
		Min: jsii.Number(0),
		Max: jsii.Number(1000),
	},
}))

type GraphWidget

type GraphWidget interface {
	ConcreteWidget
	// The amount of vertical grid units the widget will take up.
	Height() *float64
	// Any warnings that are produced as a result of putting together this widget.
	Warnings() *[]*string
	// Any warnings that are produced as a result of putting together this widget.
	WarningsV2() *map[string]*string
	// The amount of horizontal grid units the widget will take up.
	Width() *float64
	X() *float64
	SetX(val *float64)
	Y() *float64
	SetY(val *float64)
	// Add another metric to the left Y axis of the GraphWidget.
	AddLeftMetric(metric IMetric)
	// Add another metric to the right Y axis of the GraphWidget.
	AddRightMetric(metric IMetric)
	// Copy the warnings from the given metric.
	CopyMetricWarnings(ms ...IMetric)
	// Place the widget at a given position.
	Position(x *float64, y *float64)
	// Return the widget JSON for use in the dashboard.
	ToJson() *[]interface{}
}

A dashboard widget that displays metrics.

Example:

var dashboard dashboard

dashboard.AddWidgets(cloudwatch.NewGraphWidget(&GraphWidgetProps{
	// ...

	LegendPosition: cloudwatch.LegendPosition_RIGHT,
}))

func NewGraphWidget

func NewGraphWidget(props *GraphWidgetProps) GraphWidget

type GraphWidgetProps

type GraphWidgetProps struct {
	// Height of the widget.
	// Default: - 6 for Alarm and Graph widgets.
	// 3 for single value widgets where most recent value of a metric is displayed.
	//
	Height *float64 `field:"optional" json:"height" yaml:"height"`
	// The region the metrics of this graph should be taken from.
	// Default: - Current region.
	//
	Region *string `field:"optional" json:"region" yaml:"region"`
	// Title for the graph.
	// Default: - None.
	//
	Title *string `field:"optional" json:"title" yaml:"title"`
	// Width of the widget, in a grid of 24 units wide.
	// Default: 6.
	//
	Width *float64 `field:"optional" json:"width" yaml:"width"`
	// The end of the time range to use for each widget independently from those of the dashboard.
	//
	// 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.
	// Default: When the dashboard loads, the end date will be the current time.
	//
	End *string `field:"optional" json:"end" yaml:"end"`
	// Metrics to display on left Y axis.
	// Default: - No metrics.
	//
	Left *[]IMetric `field:"optional" json:"left" yaml:"left"`
	// Annotations for the left Y axis.
	// Default: - No annotations.
	//
	LeftAnnotations *[]*HorizontalAnnotation `field:"optional" json:"leftAnnotations" yaml:"leftAnnotations"`
	// Left Y axis.
	// Default: - None.
	//
	LeftYAxis *YAxisProps `field:"optional" json:"leftYAxis" yaml:"leftYAxis"`
	// Position of the legend.
	// Default: - bottom.
	//
	LegendPosition LegendPosition `field:"optional" json:"legendPosition" yaml:"legendPosition"`
	// Whether the graph should show live data.
	// Default: false.
	//
	LiveData *bool `field:"optional" json:"liveData" yaml:"liveData"`
	// The default period 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.
	// Default: cdk.Duration.seconds(300)
	//
	Period awscdk.Duration `field:"optional" json:"period" yaml:"period"`
	// Metrics to display on right Y axis.
	// Default: - No metrics.
	//
	Right *[]IMetric `field:"optional" json:"right" yaml:"right"`
	// Annotations for the right Y axis.
	// Default: - No annotations.
	//
	RightAnnotations *[]*HorizontalAnnotation `field:"optional" json:"rightAnnotations" yaml:"rightAnnotations"`
	// Right Y axis.
	// Default: - None.
	//
	RightYAxis *YAxisProps `field:"optional" json:"rightYAxis" yaml:"rightYAxis"`
	// Whether to show the value from the entire time range. Only applicable for Bar and Pie charts.
	//
	// If false, values will be from the most recent period of your chosen time range;
	// if true, shows the value from the entire time range.
	// Default: false.
	//
	SetPeriodToTimeRange *bool `field:"optional" json:"setPeriodToTimeRange" yaml:"setPeriodToTimeRange"`
	// Whether the graph should be shown as stacked lines.
	// Default: false.
	//
	Stacked *bool `field:"optional" json:"stacked" yaml:"stacked"`
	// The start of the time range to use for each widget independently from those of 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.
	// Default: When the dashboard loads, the start time will be the default time range.
	//
	Start *string `field:"optional" json:"start" yaml:"start"`
	// The default statistic to be displayed for each metric.
	//
	// This default can be overridden within the definition of each individual metric.
	// Default: - The statistic for each metric is used.
	//
	Statistic *string `field:"optional" json:"statistic" yaml:"statistic"`
	// Annotations for the X axis.
	// Default: - No annotations.
	//
	VerticalAnnotations *[]*VerticalAnnotation `field:"optional" json:"verticalAnnotations" yaml:"verticalAnnotations"`
	// Display this metric.
	// Default: TimeSeries.
	//
	View GraphWidgetView `field:"optional" json:"view" yaml:"view"`
}

Properties for a GraphWidget.

Example:

var dashboard dashboard

dashboard.AddWidgets(cloudwatch.NewGraphWidget(&GraphWidgetProps{
	// ...

	LegendPosition: cloudwatch.LegendPosition_RIGHT,
}))

type GraphWidgetView

type GraphWidgetView string

Types of view.

Example:

var dashboard dashboard

dashboard.AddWidgets(cloudwatch.NewGraphWidget(&GraphWidgetProps{
	// ...

	View: cloudwatch.GraphWidgetView_BAR,
}))
const (
	// Display as a line graph.
	GraphWidgetView_TIME_SERIES GraphWidgetView = "TIME_SERIES"
	// Display as a bar graph.
	GraphWidgetView_BAR GraphWidgetView = "BAR"
	// Display as a pie graph.
	GraphWidgetView_PIE GraphWidgetView = "PIE"
)

type HorizontalAnnotation

type HorizontalAnnotation struct {
	// The value of the annotation.
	Value *float64 `field:"required" json:"value" yaml:"value"`
	// The hex color code, prefixed with '#' (e.g. '#00ff00'), to be used for the annotation. The `Color` class has a set of standard colors that can be used here.
	// Default: - Automatic color.
	//
	Color *string `field:"optional" json:"color" yaml:"color"`
	// Add shading above or below the annotation.
	// Default: No shading.
	//
	Fill Shading `field:"optional" json:"fill" yaml:"fill"`
	// Label for the annotation.
	// Default: - No label.
	//
	Label *string `field:"optional" json:"label" yaml:"label"`
	// Whether the annotation is visible.
	// Default: true.
	//
	Visible *bool `field:"optional" json:"visible" yaml:"visible"`
}

Horizontal annotation to be added to a graph.

Example:

// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"

horizontalAnnotation := &HorizontalAnnotation{
	Value: jsii.Number(123),

	// the properties below are optional
	Color: jsii.String("color"),
	Fill: awscdk.Aws_cloudwatch.Shading_NONE,
	Label: jsii.String("label"),
	Visible: jsii.Boolean(false),
}

type IAlarm

type IAlarm interface {
	IAlarmRule
	awscdk.IResource
	// Alarm ARN (i.e. arn:aws:cloudwatch:<region>:<account-id>:alarm:Foo).
	AlarmArn() *string
	// Name of the alarm.
	AlarmName() *string
}

Represents a CloudWatch Alarm.

func Alarm_FromAlarmArn

func Alarm_FromAlarmArn(scope constructs.Construct, id *string, alarmArn *string) IAlarm

Import an existing CloudWatch alarm provided an ARN.

func Alarm_FromAlarmName added in v2.76.0

func Alarm_FromAlarmName(scope constructs.Construct, id *string, alarmName *string) IAlarm

Import an existing CloudWatch alarm provided an Name.

func CompositeAlarm_FromCompositeAlarmArn

func CompositeAlarm_FromCompositeAlarmArn(scope constructs.Construct, id *string, compositeAlarmArn *string) IAlarm

Import an existing CloudWatch composite alarm provided an ARN.

func CompositeAlarm_FromCompositeAlarmName

func CompositeAlarm_FromCompositeAlarmName(scope constructs.Construct, id *string, compositeAlarmName *string) IAlarm

Import an existing CloudWatch composite alarm provided an Name.

type IAlarmAction

type IAlarmAction interface {
	// Return the properties required to send alarm actions to this CloudWatch alarm.
	Bind(scope constructs.Construct, alarm IAlarm) *AlarmActionConfig
}

Interface for objects that can be the targets of CloudWatch alarm actions.

type IAlarmRule

type IAlarmRule interface {
	// serialized representation of Alarm Rule to be used when building the Composite Alarm resource.
	RenderAlarmRule() *string
}

Interface for Alarm Rule.

func AlarmRule_AllOf

func AlarmRule_AllOf(operands ...IAlarmRule) IAlarmRule

function to join all provided AlarmRules with AND operator.

func AlarmRule_AnyOf

func AlarmRule_AnyOf(operands ...IAlarmRule) IAlarmRule

function to join all provided AlarmRules with OR operator.

func AlarmRule_FromAlarm

func AlarmRule_FromAlarm(alarm IAlarm, alarmState AlarmState) IAlarmRule

function to build Rule Expression for given IAlarm and AlarmState.

func AlarmRule_FromBoolean

func AlarmRule_FromBoolean(value *bool) IAlarmRule

function to build TRUE/FALSE intent for Rule Expression.

func AlarmRule_FromString

func AlarmRule_FromString(alarmRule *string) IAlarmRule

function to build Rule Expression for given Alarm Rule string.

func AlarmRule_Not

func AlarmRule_Not(operand IAlarmRule) IAlarmRule

function to wrap provided AlarmRule in NOT operator.

type IMetric

type IMetric interface {
	// Inspect the details of the metric object.
	ToMetricConfig() *MetricConfig
	// Any warnings related to this metric.
	//
	// Should be attached to the consuming construct.
	// Default: - None.
	//
	// Deprecated: - use warningsV2.
	Warnings() *[]*string
	// Any warnings related to this metric.
	//
	// Should be attached to the consuming construct.
	// Default: - None.
	//
	WarningsV2() *map[string]*string
}

Interface for metrics.

type IVariable added in v2.88.0

type IVariable interface {
	// Return the variable JSON for use in the dashboard.
	ToJson() interface{}
}

A single dashboard variable.

type IWidget

type IWidget interface {
	// Place the widget at a given position.
	Position(x *float64, y *float64)
	// Return the widget JSON for use in the dashboard.
	ToJson() *[]interface{}
	// The amount of vertical grid units the widget will take up.
	Height() *float64
	// Any warnings that are produced as a result of putting together this widget.
	// Deprecated: - use warningsV2.
	Warnings() *[]*string
	// Any warnings that are produced as a result of putting together this widget.
	WarningsV2() *map[string]*string
	// The amount of horizontal grid units the widget will take up.
	Width() *float64
}

A single dashboard widget.

type LegendPosition

type LegendPosition string

The position of the legend on a GraphWidget.

Example:

var dashboard dashboard

dashboard.AddWidgets(cloudwatch.NewGraphWidget(&GraphWidgetProps{
	// ...

	LegendPosition: cloudwatch.LegendPosition_RIGHT,
}))
const (
	// Legend appears below the graph (default).
	LegendPosition_BOTTOM LegendPosition = "BOTTOM"
	// Add shading above the annotation.
	LegendPosition_RIGHT LegendPosition = "RIGHT"
	// Add shading below the annotation.
	LegendPosition_HIDDEN LegendPosition = "HIDDEN"
)

type LogQueryVisualizationType

type LogQueryVisualizationType string

Types of view.

Example:

var dashboard dashboard

dashboard.AddWidgets(cloudwatch.NewLogQueryWidget(&LogQueryWidgetProps{
	LogGroupNames: []*string{
		jsii.String("my-log-group"),
	},
	View: cloudwatch.LogQueryVisualizationType_TABLE,
	// The lines will be automatically combined using '\n|'.
	QueryLines: []*string{
		jsii.String("fields @message"),
		jsii.String("filter @message like /Error/"),
	},
}))
const (
	// Table view.
	LogQueryVisualizationType_TABLE LogQueryVisualizationType = "TABLE"
	// Line view.
	LogQueryVisualizationType_LINE LogQueryVisualizationType = "LINE"
	// Stacked area view.
	LogQueryVisualizationType_STACKEDAREA LogQueryVisualizationType = "STACKEDAREA"
	// Bar view.
	LogQueryVisualizationType_BAR LogQueryVisualizationType = "BAR"
	// Pie view.
	LogQueryVisualizationType_PIE LogQueryVisualizationType = "PIE"
)

type LogQueryWidget

type LogQueryWidget interface {
	ConcreteWidget
	// The amount of vertical grid units the widget will take up.
	Height() *float64
	// Any warnings that are produced as a result of putting together this widget.
	Warnings() *[]*string
	// Any warnings that are produced as a result of putting together this widget.
	WarningsV2() *map[string]*string
	// The amount of horizontal grid units the widget will take up.
	Width() *float64
	X() *float64
	SetX(val *float64)
	Y() *float64
	SetY(val *float64)
	// Copy the warnings from the given metric.
	CopyMetricWarnings(ms ...IMetric)
	// Place the widget at a given position.
	Position(x *float64, y *float64)
	// Return the widget JSON for use in the dashboard.
	ToJson() *[]interface{}
}

Display query results from Logs Insights.

Example:

var dashboard dashboard

dashboard.AddWidgets(cloudwatch.NewLogQueryWidget(&LogQueryWidgetProps{
	LogGroupNames: []*string{
		jsii.String("my-log-group"),
	},
	View: cloudwatch.LogQueryVisualizationType_TABLE,
	// The lines will be automatically combined using '\n|'.
	QueryLines: []*string{
		jsii.String("fields @message"),
		jsii.String("filter @message like /Error/"),
	},
}))

func NewLogQueryWidget

func NewLogQueryWidget(props *LogQueryWidgetProps) LogQueryWidget

type LogQueryWidgetProps

type LogQueryWidgetProps struct {
	// Names of log groups to query.
	LogGroupNames *[]*string `field:"required" json:"logGroupNames" yaml:"logGroupNames"`
	// Height of the widget.
	// Default: 6.
	//
	Height *float64 `field:"optional" json:"height" yaml:"height"`
	// A sequence of lines to use to build the query.
	//
	// The query will be built by joining the lines together using `\n|`.
	// Default: - Exactly one of `queryString`, `queryLines` is required.
	//
	QueryLines *[]*string `field:"optional" json:"queryLines" yaml:"queryLines"`
	// Full query string for log insights.
	//
	// Be sure to prepend every new line with a newline and pipe character
	// (`\n|`).
	// Default: - Exactly one of `queryString`, `queryLines` is required.
	//
	QueryString *string `field:"optional" json:"queryString" yaml:"queryString"`
	// The region the metrics of this widget should be taken from.
	// Default: Current region.
	//
	Region *string `field:"optional" json:"region" yaml:"region"`
	// Title for the widget.
	// Default: No title.
	//
	Title *string `field:"optional" json:"title" yaml:"title"`
	// The type of view to use.
	// Default: LogQueryVisualizationType.TABLE
	//
	View LogQueryVisualizationType `field:"optional" json:"view" yaml:"view"`
	// Width of the widget, in a grid of 24 units wide.
	// Default: 6.
	//
	Width *float64 `field:"optional" json:"width" yaml:"width"`
}

Properties for a Query widget.

Example:

var dashboard dashboard

dashboard.AddWidgets(cloudwatch.NewLogQueryWidget(&LogQueryWidgetProps{
	LogGroupNames: []*string{
		jsii.String("my-log-group"),
	},
	View: cloudwatch.LogQueryVisualizationType_TABLE,
	// The lines will be automatically combined using '\n|'.
	QueryLines: []*string{
		jsii.String("fields @message"),
		jsii.String("filter @message like /Error/"),
	},
}))

type MathExpression

type MathExpression interface {
	IMetric
	// The hex color code, prefixed with '#' (e.g. '#00ff00'), to use when this metric is rendered on a graph. The `Color` class has a set of standard colors that can be used here.
	Color() *string
	// The expression defining the metric.
	Expression() *string
	// Label for this metric when added to a Graph.
	Label() *string
	// Aggregation period of this metric.
	Period() awscdk.Duration
	// Account to evaluate search expressions within.
	SearchAccount() *string
	// Region to evaluate search expressions within.
	SearchRegion() *string
	// The metrics used in the expression as KeyValuePair <id, metric>.
	UsingMetrics() *map[string]IMetric
	// Warnings generated by this math expression.
	// Deprecated: - use warningsV2.
	Warnings() *[]*string
	// Warnings generated by this math expression.
	WarningsV2() *map[string]*string
	// Make a new Alarm for this metric.
	//
	// Combines both properties that may adjust the metric (aggregation) as well
	// as alarm properties.
	CreateAlarm(scope constructs.Construct, id *string, props *CreateAlarmOptions) Alarm
	// Inspect the details of the metric object.
	ToMetricConfig() *MetricConfig
	// Returns a string representation of an object.
	ToString() *string
	// Return a copy of Metric with properties changed.
	//
	// All properties except namespace and metricName can be changed.
	With(props *MathExpressionOptions) MathExpression
}

A math expression built with metric(s) emitted by a service.

The math expression is a combination of an expression (x+y) and metrics to apply expression on. It also contains metadata which is used only in graphs, such as color and label. It makes sense to embed this in here, so that compound constructs can attach that metadata to metrics they expose.

MathExpression can also be used for search expressions. In this case, it also optionally accepts a searchRegion and searchAccount property for cross-environment search expressions.

This class does not represent a resource, so hence is not a construct. Instead, MathExpression is an abstraction that makes it easy to specify metrics for use in both alarms and graphs.

Example:

var fn function

allProblems := cloudwatch.NewMathExpression(&MathExpressionProps{
	Expression: jsii.String("errors + throttles"),
	UsingMetrics: map[string]iMetric{
		"errors": fn.metricErrors(),
		"throttles": fn.metricThrottles(),
	},
})

func NewMathExpression

func NewMathExpression(props *MathExpressionProps) MathExpression

type MathExpressionOptions

type MathExpressionOptions struct {
	// Color for this metric when added to a Graph in a Dashboard.
	// Default: - Automatic color.
	//
	Color *string `field:"optional" json:"color" yaml:"color"`
	// Label for this expression when added to a Graph in a Dashboard.
	//
	// If this expression evaluates to more than one time series (for
	// example, through the use of `METRICS()` or `SEARCH()` expressions),
	// each time series will appear in the graph using a combination of the
	// expression label and the individual metric label. Specify the empty
	// string (`”`) to suppress the expression label and only keep the
	// metric label.
	//
	// You can use [dynamic labels](https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/graph-dynamic-labels.html)
	// to show summary information about the displayed time series
	// in the legend. For example, if you use:
	//
	// “`
	// [max: ${MAX}] MyMetric
	// “`
	//
	// As the metric label, the maximum value in the visible range will
	// be shown next to the time series name in the graph's legend. If the
	// math expression produces more than one time series, the maximum
	// will be shown for each individual time series produce by this
	// math expression.
	// Default: - Expression value is used as label.
	//
	Label *string `field:"optional" json:"label" yaml:"label"`
	// The period over which the expression's statistics are applied.
	//
	// This period overrides all periods in the metrics used in this
	// math expression.
	// Default: Duration.minutes(5)
	//
	Period awscdk.Duration `field:"optional" json:"period" yaml:"period"`
	// Account to evaluate search expressions within.
	//
	// Specifying a searchAccount has no effect to the account used
	// for metrics within the expression (passed via usingMetrics).
	// Default: - Deployment account.
	//
	SearchAccount *string `field:"optional" json:"searchAccount" yaml:"searchAccount"`
	// Region to evaluate search expressions within.
	//
	// Specifying a searchRegion has no effect to the region used
	// for metrics within the expression (passed via usingMetrics).
	// Default: - Deployment region.
	//
	SearchRegion *string `field:"optional" json:"searchRegion" yaml:"searchRegion"`
}

Configurable options for MathExpressions.

Example:

// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import cdk "github.com/aws/aws-cdk-go/awscdk"
import "github.com/aws/aws-cdk-go/awscdk"

mathExpressionOptions := &MathExpressionOptions{
	Color: jsii.String("color"),
	Label: jsii.String("label"),
	Period: cdk.Duration_Minutes(jsii.Number(30)),
	SearchAccount: jsii.String("searchAccount"),
	SearchRegion: jsii.String("searchRegion"),
}

type MathExpressionProps

type MathExpressionProps struct {
	// Color for this metric when added to a Graph in a Dashboard.
	// Default: - Automatic color.
	//
	Color *string `field:"optional" json:"color" yaml:"color"`
	// Label for this expression when added to a Graph in a Dashboard.
	//
	// If this expression evaluates to more than one time series (for
	// example, through the use of `METRICS()` or `SEARCH()` expressions),
	// each time series will appear in the graph using a combination of the
	// expression label and the individual metric label. Specify the empty
	// string (`”`) to suppress the expression label and only keep the
	// metric label.
	//
	// You can use [dynamic labels](https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/graph-dynamic-labels.html)
	// to show summary information about the displayed time series
	// in the legend. For example, if you use:
	//
	// “`
	// [max: ${MAX}] MyMetric
	// “`
	//
	// As the metric label, the maximum value in the visible range will
	// be shown next to the time series name in the graph's legend. If the
	// math expression produces more than one time series, the maximum
	// will be shown for each individual time series produce by this
	// math expression.
	// Default: - Expression value is used as label.
	//
	Label *string `field:"optional" json:"label" yaml:"label"`
	// The period over which the expression's statistics are applied.
	//
	// This period overrides all periods in the metrics used in this
	// math expression.
	// Default: Duration.minutes(5)
	//
	Period awscdk.Duration `field:"optional" json:"period" yaml:"period"`
	// Account to evaluate search expressions within.
	//
	// Specifying a searchAccount has no effect to the account used
	// for metrics within the expression (passed via usingMetrics).
	// Default: - Deployment account.
	//
	SearchAccount *string `field:"optional" json:"searchAccount" yaml:"searchAccount"`
	// Region to evaluate search expressions within.
	//
	// Specifying a searchRegion has no effect to the region used
	// for metrics within the expression (passed via usingMetrics).
	// Default: - Deployment region.
	//
	SearchRegion *string `field:"optional" json:"searchRegion" yaml:"searchRegion"`
	// The expression defining the metric.
	//
	// When an expression contains a SEARCH function, it cannot be used
	// within an Alarm.
	Expression *string `field:"required" json:"expression" yaml:"expression"`
	// The metrics used in the expression, in a map.
	//
	// The key is the identifier that represents the given metric in the
	// expression, and the value is the actual Metric object.
	// Default: - Empty map.
	//
	UsingMetrics *map[string]IMetric `field:"optional" json:"usingMetrics" yaml:"usingMetrics"`
}

Properties for a MathExpression.

Example:

var fn function

allProblems := cloudwatch.NewMathExpression(&MathExpressionProps{
	Expression: jsii.String("errors + throttles"),
	UsingMetrics: map[string]iMetric{
		"errors": fn.metricErrors(),
		"throttles": fn.metricThrottles(),
	},
})

type Metric

type Metric interface {
	IMetric
	// Account which this metric comes from.
	Account() *string
	// The hex color code used when this metric is rendered on a graph.
	Color() *string
	// Dimensions of this metric.
	Dimensions() *map[string]interface{}
	// Label for this metric when added to a Graph in a Dashboard.
	Label() *string
	// Name of this metric.
	MetricName() *string
	// Namespace of this metric.
	Namespace() *string
	// Period of this metric.
	Period() awscdk.Duration
	// Region which this metric comes from.
	Region() *string
	// Statistic of this metric.
	Statistic() *string
	// Unit of the metric.
	Unit() Unit
	// Warnings attached to this metric.
	// Deprecated: - use warningsV2.
	Warnings() *[]*string
	// Warnings attached to this metric.
	WarningsV2() *map[string]*string
	// Attach the metric object to the given construct scope.
	//
	// Returns a Metric object that uses the account and region from the Stack
	// the given construct is defined in. If the metric is subsequently used
	// in a Dashboard or Alarm in a different Stack defined in a different
	// account or region, the appropriate 'region' and 'account' fields
	// will be added to it.
	//
	// If the scope we attach to is in an environment-agnostic stack,
	// nothing is done and the same Metric object is returned.
	AttachTo(scope constructs.IConstruct) Metric
	// Make a new Alarm for this metric.
	//
	// Combines both properties that may adjust the metric (aggregation) as well
	// as alarm properties.
	CreateAlarm(scope constructs.Construct, id *string, props *CreateAlarmOptions) Alarm
	// Inspect the details of the metric object.
	ToMetricConfig() *MetricConfig
	// Returns a string representation of an object.
	ToString() *string
	// Return a copy of Metric `with` properties changed.
	//
	// All properties except namespace and metricName can be changed.
	With(props *MetricOptions) Metric
}

A metric emitted by a service.

The metric is a combination of a metric identifier (namespace, name and dimensions) and an aggregation function (statistic, period and unit).

It also contains metadata which is used only in graphs, such as color and label. It makes sense to embed this in here, so that compound constructs can attach that metadata to metrics they expose.

This class does not represent a resource, so hence is not a construct. Instead, Metric is an abstraction that makes it easy to specify metrics for use in both alarms and graphs.

Example:

var fn function

minuteErrorRate := fn.metricErrors(&MetricOptions{
	Statistic: cloudwatch.Stats_AVERAGE(),
	Period: awscdk.Duration_Minutes(jsii.Number(1)),
	Label: jsii.String("Lambda failure rate"),
})

func NewMetric

func NewMetric(props *MetricProps) Metric

type MetricConfig

type MetricConfig struct {
	// In case the metric is a math expression, the details of the math expression.
	// Default: - None.
	//
	MathExpression *MetricExpressionConfig `field:"optional" json:"mathExpression" yaml:"mathExpression"`
	// In case the metric represents a query, the details of the query.
	// Default: - None.
	//
	MetricStat *MetricStatConfig `field:"optional" json:"metricStat" yaml:"metricStat"`
	// Additional properties which will be rendered if the metric is used in a dashboard.
	//
	// Examples are 'label' and 'color', but any key in here will be
	// added to dashboard graphs.
	// Default: - None.
	//
	RenderingProperties *map[string]interface{} `field:"optional" json:"renderingProperties" yaml:"renderingProperties"`
}

Properties of a rendered metric.

Example:

// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import cdk "github.com/aws/aws-cdk-go/awscdk"
import "github.com/aws/aws-cdk-go/awscdk"

var metric metric
var renderingProperties interface{}
var value interface{}

metricConfig := &MetricConfig{
	MathExpression: &MetricExpressionConfig{
		Expression: jsii.String("expression"),
		Period: jsii.Number(123),
		UsingMetrics: map[string]iMetric{
			"usingMetricsKey": metric,
		},

		// the properties below are optional
		SearchAccount: jsii.String("searchAccount"),
		SearchRegion: jsii.String("searchRegion"),
	},
	MetricStat: &MetricStatConfig{
		MetricName: jsii.String("metricName"),
		Namespace: jsii.String("namespace"),
		Period: cdk.Duration_Minutes(jsii.Number(30)),
		Statistic: jsii.String("statistic"),

		// the properties below are optional
		Account: jsii.String("account"),
		Dimensions: []dimension{
			&dimension{
				Name: jsii.String("name"),
				Value: value,
			},
		},
		Region: jsii.String("region"),
		UnitFilter: awscdk.Aws_cloudwatch.Unit_SECONDS,
	},
	RenderingProperties: map[string]interface{}{
		"renderingPropertiesKey": renderingProperties,
	},
}

type MetricExpressionConfig

type MetricExpressionConfig struct {
	// Math expression for the metric.
	Expression *string `field:"required" json:"expression" yaml:"expression"`
	// How many seconds to aggregate over.
	Period *float64 `field:"required" json:"period" yaml:"period"`
	// Metrics used in the math expression.
	UsingMetrics *map[string]IMetric `field:"required" json:"usingMetrics" yaml:"usingMetrics"`
	// Account to evaluate search expressions within.
	// Default: - Deployment account.
	//
	SearchAccount *string `field:"optional" json:"searchAccount" yaml:"searchAccount"`
	// Region to evaluate search expressions within.
	// Default: - Deployment region.
	//
	SearchRegion *string `field:"optional" json:"searchRegion" yaml:"searchRegion"`
}

Properties for a concrete metric.

Example:

// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"

var metric metric

metricExpressionConfig := &MetricExpressionConfig{
	Expression: jsii.String("expression"),
	Period: jsii.Number(123),
	UsingMetrics: map[string]iMetric{
		"usingMetricsKey": metric,
	},

	// the properties below are optional
	SearchAccount: jsii.String("searchAccount"),
	SearchRegion: jsii.String("searchRegion"),
}

type MetricOptions

type MetricOptions struct {
	// Account which this metric comes from.
	// Default: - Deployment account.
	//
	Account *string `field:"optional" json:"account" yaml:"account"`
	// The hex color code, prefixed with '#' (e.g. '#00ff00'), to use when this metric is rendered on a graph. The `Color` class has a set of standard colors that can be used here.
	// Default: - Automatic color.
	//
	Color *string `field:"optional" json:"color" yaml:"color"`
	// Dimensions of the metric.
	// Default: - No dimensions.
	//
	DimensionsMap *map[string]*string `field:"optional" json:"dimensionsMap" yaml:"dimensionsMap"`
	// Label for this metric when added to a Graph in a Dashboard.
	//
	// You can use [dynamic labels](https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/graph-dynamic-labels.html)
	// to show summary information about the entire displayed time series
	// in the legend. For example, if you use:
	//
	// “`
	// [max: ${MAX}] MyMetric
	// “`
	//
	// As the metric label, the maximum value in the visible range will
	// be shown next to the time series name in the graph's legend.
	// Default: - No label.
	//
	Label *string `field:"optional" json:"label" yaml:"label"`
	// The period over which the specified statistic is applied.
	// Default: Duration.minutes(5)
	//
	Period awscdk.Duration `field:"optional" json:"period" yaml:"period"`
	// Region which this metric comes from.
	// Default: - Deployment region.
	//
	Region *string `field:"optional" json:"region" yaml:"region"`
	// What function to use for aggregating.
	//
	// Use the `aws_cloudwatch.Stats` helper class to construct valid input strings.
	//
	// Can be one of the following:
	//
	// - "Minimum" | "min"
	// - "Maximum" | "max"
	// - "Average" | "avg"
	// - "Sum" | "sum"
	// - "SampleCount | "n"
	// - "pNN.NN"
	// - "tmNN.NN" | "tm(NN.NN%:NN.NN%)"
	// - "iqm"
	// - "wmNN.NN" | "wm(NN.NN%:NN.NN%)"
	// - "tcNN.NN" | "tc(NN.NN%:NN.NN%)"
	// - "tsNN.NN" | "ts(NN.NN%:NN.NN%)"
	// Default: Average.
	//
	Statistic *string `field:"optional" json:"statistic" yaml:"statistic"`
	// Unit used to filter the metric stream.
	//
	// Only refer to datums emitted to the metric stream with the given unit and
	// ignore all others. Only useful when datums are being emitted to the same
	// metric stream under different units.
	//
	// The default is to use all matric datums in the stream, regardless of unit,
	// which is recommended in nearly all cases.
	//
	// CloudWatch does not honor this property for graphs.
	// Default: - All metric datums in the given metric stream.
	//
	Unit Unit `field:"optional" json:"unit" yaml:"unit"`
}

Properties of a metric that can be changed.

Example:

import "github.com/aws/aws-cdk-go/awscdk"

var deliveryStream deliveryStream

// Alarm that triggers when the per-second average of incoming bytes exceeds 90% of the current service limit
incomingBytesPercentOfLimit := cloudwatch.NewMathExpression(&MathExpressionProps{
	Expression: jsii.String("incomingBytes / 300 / bytePerSecLimit"),
	UsingMetrics: map[string]iMetric{
		"incomingBytes": deliveryStream.metricIncomingBytes(&MetricOptions{
			"statistic": cloudwatch.Statistic_SUM,
		}),
		"bytePerSecLimit": deliveryStream.metric(jsii.String("BytesPerSecondLimit")),
	},
})

cloudwatch.NewAlarm(this, jsii.String("Alarm"), &AlarmProps{
	Metric: incomingBytesPercentOfLimit,
	Threshold: jsii.Number(0.9),
	EvaluationPeriods: jsii.Number(3),
})

type MetricProps

type MetricProps struct {
	// Account which this metric comes from.
	// Default: - Deployment account.
	//
	Account *string `field:"optional" json:"account" yaml:"account"`
	// The hex color code, prefixed with '#' (e.g. '#00ff00'), to use when this metric is rendered on a graph. The `Color` class has a set of standard colors that can be used here.
	// Default: - Automatic color.
	//
	Color *string `field:"optional" json:"color" yaml:"color"`
	// Dimensions of the metric.
	// Default: - No dimensions.
	//
	DimensionsMap *map[string]*string `field:"optional" json:"dimensionsMap" yaml:"dimensionsMap"`
	// Label for this metric when added to a Graph in a Dashboard.
	//
	// You can use [dynamic labels](https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/graph-dynamic-labels.html)
	// to show summary information about the entire displayed time series
	// in the legend. For example, if you use:
	//
	// “`
	// [max: ${MAX}] MyMetric
	// “`
	//
	// As the metric label, the maximum value in the visible range will
	// be shown next to the time series name in the graph's legend.
	// Default: - No label.
	//
	Label *string `field:"optional" json:"label" yaml:"label"`
	// The period over which the specified statistic is applied.
	// Default: Duration.minutes(5)
	//
	Period awscdk.Duration `field:"optional" json:"period" yaml:"period"`
	// Region which this metric comes from.
	// Default: - Deployment region.
	//
	Region *string `field:"optional" json:"region" yaml:"region"`
	// What function to use for aggregating.
	//
	// Use the `aws_cloudwatch.Stats` helper class to construct valid input strings.
	//
	// Can be one of the following:
	//
	// - "Minimum" | "min"
	// - "Maximum" | "max"
	// - "Average" | "avg"
	// - "Sum" | "sum"
	// - "SampleCount | "n"
	// - "pNN.NN"
	// - "tmNN.NN" | "tm(NN.NN%:NN.NN%)"
	// - "iqm"
	// - "wmNN.NN" | "wm(NN.NN%:NN.NN%)"
	// - "tcNN.NN" | "tc(NN.NN%:NN.NN%)"
	// - "tsNN.NN" | "ts(NN.NN%:NN.NN%)"
	// Default: Average.
	//
	Statistic *string `field:"optional" json:"statistic" yaml:"statistic"`
	// Unit used to filter the metric stream.
	//
	// Only refer to datums emitted to the metric stream with the given unit and
	// ignore all others. Only useful when datums are being emitted to the same
	// metric stream under different units.
	//
	// The default is to use all matric datums in the stream, regardless of unit,
	// which is recommended in nearly all cases.
	//
	// CloudWatch does not honor this property for graphs.
	// Default: - All metric datums in the given metric stream.
	//
	Unit Unit `field:"optional" json:"unit" yaml:"unit"`
	// Name of the metric.
	MetricName *string `field:"required" json:"metricName" yaml:"metricName"`
	// Namespace of the metric.
	Namespace *string `field:"required" json:"namespace" yaml:"namespace"`
}

Properties for a metric.

Example:

import "github.com/aws/aws-cdk-go/awscdk"

metric := cloudwatch.NewMetric(&MetricProps{
	Namespace: jsii.String("MyNamespace"),
	MetricName: jsii.String("MyMetric"),
	DimensionsMap: map[string]*string{
		"MyDimension": jsii.String("MyDimensionValue"),
	},
})
alarm := cloudwatch.NewAlarm(this, jsii.String("MyAlarm"), &AlarmProps{
	Metric: metric,
	Threshold: jsii.Number(100),
	EvaluationPeriods: jsii.Number(3),
	DatapointsToAlarm: jsii.Number(2),
})

topicRule := iot.NewTopicRule(this, jsii.String("TopicRule"), &TopicRuleProps{
	Sql: iot.IotSql_FromStringAsVer20160323(jsii.String("SELECT topic(2) as device_id FROM 'device/+/data'")),
	Actions: []iAction{
		actions.NewCloudWatchSetAlarmStateAction(alarm, &CloudWatchSetAlarmStateActionProps{
			Reason: jsii.String("AWS Iot Rule action is triggered"),
			AlarmStateToSet: cloudwatch.AlarmState_ALARM,
		}),
	},
})

type MetricStatConfig

type MetricStatConfig struct {
	// Name of the metric.
	MetricName *string `field:"required" json:"metricName" yaml:"metricName"`
	// Namespace of the metric.
	Namespace *string `field:"required" json:"namespace" yaml:"namespace"`
	// How many seconds to aggregate over.
	Period awscdk.Duration `field:"required" json:"period" yaml:"period"`
	// Aggregation function to use (can be either simple or a percentile).
	Statistic *string `field:"required" json:"statistic" yaml:"statistic"`
	// Account which this metric comes from.
	// Default: Deployment account.
	//
	Account *string `field:"optional" json:"account" yaml:"account"`
	// The dimensions to apply to the alarm.
	// Default: [].
	//
	Dimensions *[]*Dimension `field:"optional" json:"dimensions" yaml:"dimensions"`
	// Region which this metric comes from.
	// Default: Deployment region.
	//
	Region *string `field:"optional" json:"region" yaml:"region"`
	// Unit used to filter the metric stream.
	//
	// Only refer to datums emitted to the metric stream with the given unit and
	// ignore all others. Only useful when datums are being emitted to the same
	// metric stream under different units.
	//
	// This field has been renamed from plain `unit` to clearly communicate
	// its purpose.
	// Default: - Refer to all metric datums.
	//
	UnitFilter Unit `field:"optional" json:"unitFilter" yaml:"unitFilter"`
}

Properties for a concrete metric.

NOTE: `unit` is no longer on this object since it is only used for `Alarms`, and doesn't mean what one would expect it to mean there anyway. It is most likely to be misused.

Example:

// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import cdk "github.com/aws/aws-cdk-go/awscdk"
import "github.com/aws/aws-cdk-go/awscdk"

var value interface{}

metricStatConfig := &MetricStatConfig{
	MetricName: jsii.String("metricName"),
	Namespace: jsii.String("namespace"),
	Period: cdk.Duration_Minutes(jsii.Number(30)),
	Statistic: jsii.String("statistic"),

	// the properties below are optional
	Account: jsii.String("account"),
	Dimensions: []dimension{
		&dimension{
			Name: jsii.String("name"),
			Value: value,
		},
	},
	Region: jsii.String("region"),
	UnitFilter: awscdk.Aws_cloudwatch.Unit_SECONDS,
}

type MetricWidgetProps

type MetricWidgetProps struct {
	// Height of the widget.
	// Default: - 6 for Alarm and Graph widgets.
	// 3 for single value widgets where most recent value of a metric is displayed.
	//
	Height *float64 `field:"optional" json:"height" yaml:"height"`
	// The region the metrics of this graph should be taken from.
	// Default: - Current region.
	//
	Region *string `field:"optional" json:"region" yaml:"region"`
	// Title for the graph.
	// Default: - None.
	//
	Title *string `field:"optional" json:"title" yaml:"title"`
	// Width of the widget, in a grid of 24 units wide.
	// Default: 6.
	//
	Width *float64 `field:"optional" json:"width" yaml:"width"`
}

Basic properties for widgets that display metrics.

Example:

// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"

metricWidgetProps := &MetricWidgetProps{
	Height: jsii.Number(123),
	Region: jsii.String("region"),
	Title: jsii.String("title"),
	Width: jsii.Number(123),
}

type PeriodOverride

type PeriodOverride string

Specify the period for graphs when the CloudWatch dashboard loads.

const (
	// Period of all graphs on the dashboard automatically adapt to the time range of the dashboard.
	PeriodOverride_AUTO PeriodOverride = "AUTO"
	// Period set for each graph will be used.
	PeriodOverride_INHERIT PeriodOverride = "INHERIT"
)

type Row

type Row interface {
	IWidget
	// The amount of vertical grid units the widget will take up.
	Height() *float64
	// List of contained widgets.
	Widgets() *[]IWidget
	// The amount of horizontal grid units the widget will take up.
	Width() *float64
	// Add the widget to this container.
	AddWidget(w IWidget)
	// Place the widget at a given position.
	Position(x *float64, y *float64)
	// Return the widget JSON for use in the dashboard.
	ToJson() *[]interface{}
}

A widget that contains other widgets in a horizontal row.

Widgets will be laid out next to each other.

Example:

var widgetA iWidget
var widgetB iWidget

cloudwatch.NewRow(widgetA, widgetB)

func NewRow

func NewRow(widgets ...IWidget) Row

type SearchComponents added in v2.88.0

type SearchComponents struct {
	// The list of dimensions to be used in the search expression.
	Dimensions *[]*string `field:"required" json:"dimensions" yaml:"dimensions"`
	// The metric name to be used in the search expression.
	MetricName *string `field:"required" json:"metricName" yaml:"metricName"`
	// The namespace to be used in the search expression.
	Namespace *string `field:"required" json:"namespace" yaml:"namespace"`
	// The dimension name, that the search expression retrieves, whose values will be used to populate the values to choose from.
	PopulateFrom *string `field:"required" json:"populateFrom" yaml:"populateFrom"`
}

Search components for use with {@link Values.fromSearchComponents}.

Example:

import "github.com/aws/aws-cdk-go/awscdk"

dashboard := cw.NewDashboard(this, jsii.String("Dash"), &DashboardProps{
	DefaultInterval: awscdk.Duration_Days(jsii.Number(7)),
	Variables: []iVariable{
		cw.NewDashboardVariable(&DashboardVariableOptions{
			Id: jsii.String("functionName"),
			Type: cw.VariableType_PATTERN,
			Label: jsii.String("Function"),
			InputType: cw.VariableInputType_RADIO,
			Value: jsii.String("originalFuncNameInDashboard"),
			// equivalent to cw.Values.fromSearch('{AWS/Lambda,FunctionName} MetricName=\"Duration\"', 'FunctionName')
			Values: cw.Values_FromSearchComponents(&SearchComponents{
				Namespace: jsii.String("AWS/Lambda"),
				Dimensions: []*string{
					jsii.String("FunctionName"),
				},
				MetricName: jsii.String("Duration"),
				PopulateFrom: jsii.String("FunctionName"),
			}),
			DefaultValue: cw.DefaultValue_FIRST(),
			Visible: jsii.Boolean(true),
		}),
	},
})

type Shading

type Shading string

Fill shading options that will be used with a horizontal annotation.

const (
	// Don't add shading.
	Shading_NONE Shading = "NONE"
	// Add shading above the annotation.
	Shading_ABOVE Shading = "ABOVE"
	// Add shading below the annotation.
	Shading_BELOW Shading = "BELOW"
)

type SingleValueWidget

type SingleValueWidget interface {
	ConcreteWidget
	// The amount of vertical grid units the widget will take up.
	Height() *float64
	// Any warnings that are produced as a result of putting together this widget.
	Warnings() *[]*string
	// Any warnings that are produced as a result of putting together this widget.
	WarningsV2() *map[string]*string
	// The amount of horizontal grid units the widget will take up.
	Width() *float64
	X() *float64
	SetX(val *float64)
	Y() *float64
	SetY(val *float64)
	// Copy the warnings from the given metric.
	CopyMetricWarnings(ms ...IMetric)
	// Place the widget at a given position.
	Position(x *float64, y *float64)
	// Return the widget JSON for use in the dashboard.
	ToJson() *[]interface{}
}

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

Example:

var dashboard dashboard

dashboard.AddWidgets(cloudwatch.NewSingleValueWidget(&SingleValueWidgetProps{
	Metrics: []iMetric{
	},

	Period: awscdk.Duration_Minutes(jsii.Number(15)),
}))

func NewSingleValueWidget

func NewSingleValueWidget(props *SingleValueWidgetProps) SingleValueWidget

type SingleValueWidgetProps

type SingleValueWidgetProps struct {
	// Height of the widget.
	// Default: - 6 for Alarm and Graph widgets.
	// 3 for single value widgets where most recent value of a metric is displayed.
	//
	Height *float64 `field:"optional" json:"height" yaml:"height"`
	// The region the metrics of this graph should be taken from.
	// Default: - Current region.
	//
	Region *string `field:"optional" json:"region" yaml:"region"`
	// Title for the graph.
	// Default: - None.
	//
	Title *string `field:"optional" json:"title" yaml:"title"`
	// Width of the widget, in a grid of 24 units wide.
	// Default: 6.
	//
	Width *float64 `field:"optional" json:"width" yaml:"width"`
	// Metrics to display.
	Metrics *[]IMetric `field:"required" json:"metrics" yaml:"metrics"`
	// The end of the time range to use for each widget independently from those of the dashboard.
	//
	// 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.
	// Default: When the dashboard loads, the end date will be the current time.
	//
	End *string `field:"optional" json:"end" yaml:"end"`
	// Whether to show as many digits as can fit, before rounding.
	// Default: false.
	//
	FullPrecision *bool `field:"optional" json:"fullPrecision" yaml:"fullPrecision"`
	// The default period 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.
	// Default: cdk.Duration.seconds(300)
	//
	Period awscdk.Duration `field:"optional" json:"period" yaml:"period"`
	// Whether to show the value from the entire time range.
	// Default: false.
	//
	SetPeriodToTimeRange *bool `field:"optional" json:"setPeriodToTimeRange" yaml:"setPeriodToTimeRange"`
	// Whether to show a graph below the value illustrating the value for the whole time range.
	//
	// Cannot be used in combination with `setPeriodToTimeRange`.
	// Default: false.
	//
	Sparkline *bool `field:"optional" json:"sparkline" yaml:"sparkline"`
	// The start of the time range to use for each widget independently from those of 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.
	// Default: When the dashboard loads, the start time will be the default time range.
	//
	Start *string `field:"optional" json:"start" yaml:"start"`
}

Properties for a SingleValueWidget.

Example:

var dashboard dashboard

dashboard.AddWidgets(cloudwatch.NewSingleValueWidget(&SingleValueWidgetProps{
	Metrics: []iMetric{
	},

	Period: awscdk.Duration_Minutes(jsii.Number(15)),
}))

type Spacer

type Spacer interface {
	IWidget
	// The amount of vertical grid units the widget will take up.
	Height() *float64
	// The amount of horizontal grid units the widget will take up.
	Width() *float64
	// Place the widget at a given position.
	Position(_x *float64, _y *float64)
	// Return the widget JSON for use in the dashboard.
	ToJson() *[]interface{}
}

A widget that doesn't display anything but takes up space.

Example:

// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"

spacer := awscdk.Aws_cloudwatch.NewSpacer(&SpacerProps{
	Height: jsii.Number(123),
	Width: jsii.Number(123),
})

func NewSpacer

func NewSpacer(props *SpacerProps) Spacer

type SpacerProps

type SpacerProps struct {
	// Height of the spacer.
	// Default: : 1.
	//
	Height *float64 `field:"optional" json:"height" yaml:"height"`
	// Width of the spacer.
	// Default: 1.
	//
	Width *float64 `field:"optional" json:"width" yaml:"width"`
}

Props of the spacer.

Example:

// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"

spacerProps := &SpacerProps{
	Height: jsii.Number(123),
	Width: jsii.Number(123),
}

type Statistic deprecated

type Statistic string

Statistic to use over the aggregation period.

Example:

var matchmakingRuleSet matchmakingRuleSet

// Alarm that triggers when the per-second average of not placed matches exceed 10%
ruleEvaluationRatio := cloudwatch.NewMathExpression(&MathExpressionProps{
	Expression: jsii.String("1 - (ruleEvaluationsPassed / ruleEvaluationsFailed)"),
	UsingMetrics: map[string]iMetric{
		"ruleEvaluationsPassed": matchmakingRuleSet.metricRuleEvaluationsPassed(&MetricOptions{
			"statistic": cloudwatch.Statistic_SUM,
		}),
		"ruleEvaluationsFailed": matchmakingRuleSet.metric(jsii.String("ruleEvaluationsFailed")),
	},
})
cloudwatch.NewAlarm(this, jsii.String("Alarm"), &AlarmProps{
	Metric: ruleEvaluationRatio,
	Threshold: jsii.Number(0.1),
	EvaluationPeriods: jsii.Number(3),
})

See: https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/Statistics-definitions.html

Deprecated: Use one of the factory methods on `Stats` to produce statistics strings.

const (
	// The count (number) of data points used for the statistical calculation.
	// Deprecated: Use one of the factory methods on `Stats` to produce statistics strings.
	Statistic_SAMPLE_COUNT Statistic = "SAMPLE_COUNT"
	// The value of Sum / SampleCount during the specified period.
	// Deprecated: Use one of the factory methods on `Stats` to produce statistics strings.
	Statistic_AVERAGE Statistic = "AVERAGE"
	// All values submitted for the matching metric added together.
	//
	// This statistic can be useful for determining the total volume of a metric.
	// Deprecated: Use one of the factory methods on `Stats` to produce statistics strings.
	Statistic_SUM Statistic = "SUM"
	// The lowest value observed during the specified period.
	//
	// You can use this value to determine low volumes of activity for your application.
	// Deprecated: Use one of the factory methods on `Stats` to produce statistics strings.
	Statistic_MINIMUM Statistic = "MINIMUM"
	// The highest value observed during the specified period.
	//
	// You can use this value to determine high volumes of activity for your application.
	// Deprecated: Use one of the factory methods on `Stats` to produce statistics strings.
	Statistic_MAXIMUM Statistic = "MAXIMUM"
)

type Stats added in v2.54.0

type Stats interface {
}

Factory functions for standard statistics strings.

Example:

var dashboard dashboard
var executionCountMetric metric
var errorCountMetric metric

dashboard.AddWidgets(cloudwatch.NewGraphWidget(&GraphWidgetProps{
	Title: jsii.String("Executions vs error rate"),

	Left: []iMetric{
		executionCountMetric,
	},

	Right: []*iMetric{
		errorCountMetric.With(&MetricOptions{
			Statistic: cloudwatch.Stats_AVERAGE(),
			Label: jsii.String("Error rate"),
			Color: cloudwatch.Color_GREEN(),
		}),
	},
}))

type TableLayout added in v2.128.0

type TableLayout string

Layout for TableWidget.

Example:

var dashboard dashboard

dashboard.AddWidgets(cloudwatch.NewTableWidget(&TableWidgetProps{
	// ...

	Layout: cloudwatch.TableLayout_VERTICAL,
}))
const (
	// Data points are laid out in columns.
	TableLayout_HORIZONTAL TableLayout = "HORIZONTAL"
	// Data points are laid out in rows.
	TableLayout_VERTICAL TableLayout = "VERTICAL"
)

type TableSummaryColumn added in v2.128.0

type TableSummaryColumn string

Standard table summary columns.

Example:

var dashboard dashboard

dashboard.AddWidgets(cloudwatch.NewTableWidget(&TableWidgetProps{
	// ...

	Summary: &TableSummaryProps{
		Columns: []tableSummaryColumn{
			cloudwatch.*tableSummaryColumn_AVERAGE,
		},
		HideNonSummaryColumns: jsii.Boolean(true),
		Sticky: jsii.Boolean(true),
	},
}))
const (
	// Minimum of all data points.
	TableSummaryColumn_MINIMUM TableSummaryColumn = "MINIMUM"
	// Maximum of all data points.
	TableSummaryColumn_MAXIMUM TableSummaryColumn = "MAXIMUM"
	// Sum of all data points.
	TableSummaryColumn_SUM TableSummaryColumn = "SUM"
	// Average of all data points.
	TableSummaryColumn_AVERAGE TableSummaryColumn = "AVERAGE"
)

type TableSummaryProps added in v2.128.0

type TableSummaryProps struct {
	// Summary columns.
	// Default: - No summary columns will be shown.
	//
	Columns *[]TableSummaryColumn `field:"optional" json:"columns" yaml:"columns"`
	// Prevent the columns of datapoints from being displayed, so that only the label and summary columns are displayed.
	// Default: - false.
	//
	HideNonSummaryColumns *bool `field:"optional" json:"hideNonSummaryColumns" yaml:"hideNonSummaryColumns"`
	// Make the summary columns sticky, so that they remain in view while scrolling.
	// Default: - false.
	//
	Sticky *bool `field:"optional" json:"sticky" yaml:"sticky"`
}

Properties for TableWidget's summary columns.

Example:

var dashboard dashboard

dashboard.AddWidgets(cloudwatch.NewTableWidget(&TableWidgetProps{
	// ...

	Summary: &TableSummaryProps{
		Columns: []tableSummaryColumn{
			cloudwatch.*tableSummaryColumn_AVERAGE,
		},
		HideNonSummaryColumns: jsii.Boolean(true),
		Sticky: jsii.Boolean(true),
	},
}))

type TableThreshold added in v2.128.0

type TableThreshold interface {
	ToJson() interface{}
}

Thresholds for highlighting cells in TableWidget.

Example:

var dashboard dashboard

dashboard.AddWidgets(cloudwatch.NewTableWidget(&TableWidgetProps{
	// ...

	Thresholds: []tableThreshold{
		cloudwatch.*tableThreshold_Above(jsii.Number(1000), cloudwatch.Color_RED()),
		cloudwatch.*tableThreshold_Between(jsii.Number(500), jsii.Number(1000), cloudwatch.Color_ORANGE()),
		cloudwatch.*tableThreshold_Below(jsii.Number(500), cloudwatch.Color_GREEN()),
	},
}))

func TableThreshold_Above added in v2.128.0

func TableThreshold_Above(value *float64, color *string) TableThreshold

A threshold for highlighting and coloring cells above the specified value.

func TableThreshold_Below added in v2.128.0

func TableThreshold_Below(value *float64, color *string) TableThreshold

A threshold for highlighting and coloring cells below the specified value.

func TableThreshold_Between added in v2.128.0

func TableThreshold_Between(lowerBound *float64, upperBound *float64, color *string) TableThreshold

A threshold for highlighting and coloring cells within the specified values.

type TableWidget added in v2.128.0

type TableWidget interface {
	ConcreteWidget
	// The amount of vertical grid units the widget will take up.
	Height() *float64
	// Any warnings that are produced as a result of putting together this widget.
	Warnings() *[]*string
	// Any warnings that are produced as a result of putting together this widget.
	WarningsV2() *map[string]*string
	// The amount of horizontal grid units the widget will take up.
	Width() *float64
	X() *float64
	SetX(val *float64)
	Y() *float64
	SetY(val *float64)
	// Add another metric.
	AddMetric(metric IMetric)
	// Copy the warnings from the given metric.
	CopyMetricWarnings(ms ...IMetric)
	// Place the widget at a given position.
	Position(x *float64, y *float64)
	// Return the widget JSON for use in the dashboard.
	ToJson() *[]interface{}
}

A dashboard widget that displays metrics.

Example:

var dashboard dashboard

dashboard.AddWidgets(cloudwatch.NewTableWidget(&TableWidgetProps{
	// ...

	Layout: cloudwatch.TableLayout_VERTICAL,
}))

func NewTableWidget added in v2.128.0

func NewTableWidget(props *TableWidgetProps) TableWidget

type TableWidgetProps added in v2.128.0

type TableWidgetProps struct {
	// Height of the widget.
	// Default: - 6 for Alarm and Graph widgets.
	// 3 for single value widgets where most recent value of a metric is displayed.
	//
	Height *float64 `field:"optional" json:"height" yaml:"height"`
	// The region the metrics of this graph should be taken from.
	// Default: - Current region.
	//
	Region *string `field:"optional" json:"region" yaml:"region"`
	// Title for the graph.
	// Default: - None.
	//
	Title *string `field:"optional" json:"title" yaml:"title"`
	// Width of the widget, in a grid of 24 units wide.
	// Default: 6.
	//
	Width *float64 `field:"optional" json:"width" yaml:"width"`
	// The end of the time range to use for each widget independently from those of the dashboard.
	//
	// 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.
	// Default: When the dashboard loads, the end date will be the current time.
	//
	End *string `field:"optional" json:"end" yaml:"end"`
	// Whether to show as many digits as can fit, before rounding.
	// Default: false.
	//
	FullPrecision *bool `field:"optional" json:"fullPrecision" yaml:"fullPrecision"`
	// Table layout.
	// Default: - TableLayout.HORIZONTAL
	//
	Layout TableLayout `field:"optional" json:"layout" yaml:"layout"`
	// Whether the graph should show live data.
	// Default: false.
	//
	LiveData *bool `field:"optional" json:"liveData" yaml:"liveData"`
	// Metrics to display in the table.
	// Default: - No metrics.
	//
	Metrics *[]IMetric `field:"optional" json:"metrics" yaml:"metrics"`
	// The default period 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.
	// Default: cdk.Duration.seconds(300)
	//
	Period awscdk.Duration `field:"optional" json:"period" yaml:"period"`
	// Whether to show the value from the entire time range. Only applicable for Bar and Pie charts.
	//
	// If false, values will be from the most recent period of your chosen time range;
	// if true, shows the value from the entire time range.
	// Default: false.
	//
	SetPeriodToTimeRange *bool `field:"optional" json:"setPeriodToTimeRange" yaml:"setPeriodToTimeRange"`
	// Show the metrics units in the label column.
	// Default: - false.
	//
	ShowUnitsInLabel *bool `field:"optional" json:"showUnitsInLabel" yaml:"showUnitsInLabel"`
	// The start of the time range to use for each widget independently from those of 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.
	// Default: When the dashboard loads, the start time will be the default time range.
	//
	Start *string `field:"optional" json:"start" yaml:"start"`
	// The default statistic to be displayed for each metric.
	//
	// This default can be overridden within the definition of each individual metric.
	// Default: - The statistic for each metric is used.
	//
	Statistic *string `field:"optional" json:"statistic" yaml:"statistic"`
	// Properties for displaying summary columns.
	// Default: - no summary columns are shown.
	//
	Summary *TableSummaryProps `field:"optional" json:"summary" yaml:"summary"`
	// Thresholds for highlighting table cells.
	// Default: - No thresholds.
	//
	Thresholds *[]TableThreshold `field:"optional" json:"thresholds" yaml:"thresholds"`
}

Properties for a TableWidget.

Example:

var dashboard dashboard

dashboard.AddWidgets(cloudwatch.NewTableWidget(&TableWidgetProps{
	// ...

	Layout: cloudwatch.TableLayout_VERTICAL,
}))

type TextWidget

type TextWidget interface {
	ConcreteWidget
	// The amount of vertical grid units the widget will take up.
	Height() *float64
	// Any warnings that are produced as a result of putting together this widget.
	Warnings() *[]*string
	// Any warnings that are produced as a result of putting together this widget.
	WarningsV2() *map[string]*string
	// The amount of horizontal grid units the widget will take up.
	Width() *float64
	X() *float64
	SetX(val *float64)
	Y() *float64
	SetY(val *float64)
	// Copy the warnings from the given metric.
	CopyMetricWarnings(ms ...IMetric)
	// Place the widget at a given position.
	Position(x *float64, y *float64)
	// Return the widget JSON for use in the dashboard.
	ToJson() *[]interface{}
}

A dashboard widget that displays MarkDown.

Example:

var dashboard dashboard

dashboard.AddWidgets(cloudwatch.NewTextWidget(&TextWidgetProps{
	Markdown: jsii.String("# Key Performance Indicators"),
}))

func NewTextWidget

func NewTextWidget(props *TextWidgetProps) TextWidget

type TextWidgetBackground added in v2.54.0

type TextWidgetBackground string

Background types available.

Example:

var dashboard dashboard

dashboard.AddWidgets(cloudwatch.NewTextWidget(&TextWidgetProps{
	Markdown: jsii.String("# Key Performance Indicators"),
	Background: cloudwatch.TextWidgetBackground_TRANSPARENT,
}))
const (
	// Solid background.
	TextWidgetBackground_SOLID TextWidgetBackground = "SOLID"
	// Transparent background.
	TextWidgetBackground_TRANSPARENT TextWidgetBackground = "TRANSPARENT"
)

type TextWidgetProps

type TextWidgetProps struct {
	// The text to display, in MarkDown format.
	Markdown *string `field:"required" json:"markdown" yaml:"markdown"`
	// Background for the widget.
	// Default: solid.
	//
	Background TextWidgetBackground `field:"optional" json:"background" yaml:"background"`
	// Height of the widget.
	// Default: 2.
	//
	Height *float64 `field:"optional" json:"height" yaml:"height"`
	// Width of the widget, in a grid of 24 units wide.
	// Default: 6.
	//
	Width *float64 `field:"optional" json:"width" yaml:"width"`
}

Properties for a Text widget.

Example:

var dashboard dashboard

dashboard.AddWidgets(cloudwatch.NewTextWidget(&TextWidgetProps{
	Markdown: jsii.String("# Key Performance Indicators"),
}))

type TreatMissingData

type TreatMissingData string

Specify how missing data points are treated during alarm evaluation.

Example:

import cdk "github.com/aws/aws-cdk-go/awscdk"
import "github.com/aws/aws-cdk-go/awscdk"

fn := lambda.NewFunction(this, jsii.String("MyFunction"), &FunctionProps{
	Runtime: lambda.Runtime_NODEJS_18_X(),
	Handler: jsii.String("index.handler"),
	Code: lambda.Code_FromAsset(path.join(__dirname, jsii.String("lambda-handler"))),
	Timeout: awscdk.Duration_Minutes(jsii.Number(5)),
})

if fn.Timeout {
	cloudwatch.NewAlarm(this, jsii.String("MyAlarm"), &AlarmProps{
		Metric: fn.metricDuration().With(&MetricOptions{
			Statistic: jsii.String("Maximum"),
		}),
		EvaluationPeriods: jsii.Number(1),
		DatapointsToAlarm: jsii.Number(1),
		Threshold: fn.*Timeout.ToMilliseconds(),
		TreatMissingData: cloudwatch.TreatMissingData_IGNORE,
		AlarmName: jsii.String("My Lambda Timeout"),
	})
}
const (
	// Missing data points are treated as breaching the threshold.
	TreatMissingData_BREACHING TreatMissingData = "BREACHING"
	// Missing data points are treated as being within the threshold.
	TreatMissingData_NOT_BREACHING TreatMissingData = "NOT_BREACHING"
	// The current alarm state is maintained.
	TreatMissingData_IGNORE TreatMissingData = "IGNORE"
	// The alarm does not consider missing data points when evaluating whether to change state.
	TreatMissingData_MISSING TreatMissingData = "MISSING"
)

type Unit

type Unit string

Unit for metric.

Example:

var logGroup logGroup

mf := logs.NewMetricFilter(this, jsii.String("MetricFilter"), &MetricFilterProps{
	LogGroup: LogGroup,
	MetricNamespace: jsii.String("MyApp"),
	MetricName: jsii.String("Latency"),
	FilterPattern: logs.FilterPattern_Exists(jsii.String("$.latency")),
	MetricValue: jsii.String("$.latency"),
	Dimensions: map[string]*string{
		"ErrorCode": jsii.String("$.errorCode"),
	},
	Unit: cloudwatch.Unit_MILLISECONDS,
})

//expose a metric from the metric filter
metric := mf.Metric()

//you can use the metric to create a new alarm
//you can use the metric to create a new alarm
cloudwatch.NewAlarm(this, jsii.String("alarm from metric filter"), &AlarmProps{
	Metric: Metric,
	Threshold: jsii.Number(100),
	EvaluationPeriods: jsii.Number(2),
})
const (
	// Seconds.
	Unit_SECONDS Unit = "SECONDS"
	// Microseconds.
	Unit_MICROSECONDS Unit = "MICROSECONDS"
	// Milliseconds.
	Unit_MILLISECONDS Unit = "MILLISECONDS"
	// Bytes.
	Unit_BYTES Unit = "BYTES"
	// Kilobytes.
	Unit_KILOBYTES Unit = "KILOBYTES"
	// Megabytes.
	Unit_MEGABYTES Unit = "MEGABYTES"
	// Gigabytes.
	Unit_GIGABYTES Unit = "GIGABYTES"
	// Terabytes.
	Unit_TERABYTES Unit = "TERABYTES"
	// Bits.
	Unit_BITS Unit = "BITS"
	// Kilobits.
	Unit_KILOBITS Unit = "KILOBITS"
	// Megabits.
	Unit_MEGABITS Unit = "MEGABITS"
	// Gigabits.
	Unit_GIGABITS Unit = "GIGABITS"
	// Terabits.
	Unit_TERABITS Unit = "TERABITS"
	// Percent.
	Unit_PERCENT Unit = "PERCENT"
	// Count.
	Unit_COUNT Unit = "COUNT"
	// Bytes/second (B/s).
	Unit_BYTES_PER_SECOND Unit = "BYTES_PER_SECOND"
	// Kilobytes/second (kB/s).
	Unit_KILOBYTES_PER_SECOND Unit = "KILOBYTES_PER_SECOND"
	// Megabytes/second (MB/s).
	Unit_MEGABYTES_PER_SECOND Unit = "MEGABYTES_PER_SECOND"
	// Gigabytes/second (GB/s).
	Unit_GIGABYTES_PER_SECOND Unit = "GIGABYTES_PER_SECOND"
	// Terabytes/second (TB/s).
	Unit_TERABYTES_PER_SECOND Unit = "TERABYTES_PER_SECOND"
	// Bits/second (b/s).
	Unit_BITS_PER_SECOND Unit = "BITS_PER_SECOND"
	// Kilobits/second (kb/s).
	Unit_KILOBITS_PER_SECOND Unit = "KILOBITS_PER_SECOND"
	// Megabits/second (Mb/s).
	Unit_MEGABITS_PER_SECOND Unit = "MEGABITS_PER_SECOND"
	// Gigabits/second (Gb/s).
	Unit_GIGABITS_PER_SECOND Unit = "GIGABITS_PER_SECOND"
	// Terabits/second (Tb/s).
	Unit_TERABITS_PER_SECOND Unit = "TERABITS_PER_SECOND"
	// Count/second.
	Unit_COUNT_PER_SECOND Unit = "COUNT_PER_SECOND"
	// None.
	Unit_NONE Unit = "NONE"
)

type Values added in v2.88.0

type Values interface {
	ToJson() interface{}
}

A class for providing values for use with {@link VariableInputType.SELECT} and {@link VariableInputType.RADIO} dashboard variables.

Example:

import "github.com/aws/aws-cdk-go/awscdk"

dashboard := cw.NewDashboard(this, jsii.String("Dash"), &DashboardProps{
	DefaultInterval: awscdk.Duration_Days(jsii.Number(7)),
	Variables: []iVariable{
		cw.NewDashboardVariable(&DashboardVariableOptions{
			Id: jsii.String("region"),
			Type: cw.VariableType_PROPERTY,
			Label: jsii.String("Region"),
			InputType: cw.VariableInputType_RADIO,
			Value: jsii.String("region"),
			Values: cw.Values_FromValues(&VariableValue{
				Label: jsii.String("IAD"),
				Value: jsii.String("us-east-1"),
			}, &VariableValue{
				Label: jsii.String("DUB"),
				Value: jsii.String("us-west-2"),
			}),
			DefaultValue: cw.DefaultValue_Value(jsii.String("us-east-1")),
			Visible: jsii.Boolean(true),
		}),
	},
})

func Values_FromSearch added in v2.88.0

func Values_FromSearch(expression *string, populateFrom *string) Values

Create values from a search expression.

func Values_FromSearchComponents added in v2.88.0

func Values_FromSearchComponents(components *SearchComponents) Values

Create values from the components of search expression.

func Values_FromValues added in v2.88.0

func Values_FromValues(values ...*VariableValue) Values

Create values from an array of possible variable values.

type VariableInputType added in v2.88.0

type VariableInputType string

Example:

import "github.com/aws/aws-cdk-go/awscdk"

dashboard := cw.NewDashboard(this, jsii.String("Dash"), &DashboardProps{
	DefaultInterval: awscdk.Duration_Days(jsii.Number(7)),
	Variables: []iVariable{
		cw.NewDashboardVariable(&DashboardVariableOptions{
			Id: jsii.String("functionName"),
			Type: cw.VariableType_PATTERN,
			Label: jsii.String("Function"),
			InputType: cw.VariableInputType_RADIO,
			Value: jsii.String("originalFuncNameInDashboard"),
			// equivalent to cw.Values.fromSearch('{AWS/Lambda,FunctionName} MetricName=\"Duration\"', 'FunctionName')
			Values: cw.Values_FromSearchComponents(&SearchComponents{
				Namespace: jsii.String("AWS/Lambda"),
				Dimensions: []*string{
					jsii.String("FunctionName"),
				},
				MetricName: jsii.String("Duration"),
				PopulateFrom: jsii.String("FunctionName"),
			}),
			DefaultValue: cw.DefaultValue_FIRST(),
			Visible: jsii.Boolean(true),
		}),
	},
})
const (
	// Freeform text input box.
	VariableInputType_INPUT VariableInputType = "INPUT"
	// A dropdown of pre-defined values, or values filled in from a metric search query.
	VariableInputType_RADIO VariableInputType = "RADIO"
	// A set of pre-defined radio buttons, which can also be defined from a metric search query.
	VariableInputType_SELECT VariableInputType = "SELECT"
)

type VariableType added in v2.88.0

type VariableType string

Example:

import "github.com/aws/aws-cdk-go/awscdk"

dashboard := cw.NewDashboard(this, jsii.String("Dash"), &DashboardProps{
	DefaultInterval: awscdk.Duration_Days(jsii.Number(7)),
	Variables: []iVariable{
		cw.NewDashboardVariable(&DashboardVariableOptions{
			Id: jsii.String("functionName"),
			Type: cw.VariableType_PATTERN,
			Label: jsii.String("Function"),
			InputType: cw.VariableInputType_RADIO,
			Value: jsii.String("originalFuncNameInDashboard"),
			// equivalent to cw.Values.fromSearch('{AWS/Lambda,FunctionName} MetricName=\"Duration\"', 'FunctionName')
			Values: cw.Values_FromSearchComponents(&SearchComponents{
				Namespace: jsii.String("AWS/Lambda"),
				Dimensions: []*string{
					jsii.String("FunctionName"),
				},
				MetricName: jsii.String("Duration"),
				PopulateFrom: jsii.String("FunctionName"),
			}),
			DefaultValue: cw.DefaultValue_FIRST(),
			Visible: jsii.Boolean(true),
		}),
	},
})
const (
	// A property variable changes the values of all instances of a property in the list of widgets in the dashboard.
	VariableType_PROPERTY VariableType = "PROPERTY"
	// A pattern variable is one that changes a regex pattern across the dashboard JSON.
	VariableType_PATTERN VariableType = "PATTERN"
)

type VariableValue added in v2.88.0

type VariableValue struct {
	// Value of the selected item.
	Value *string `field:"required" json:"value" yaml:"value"`
	// Optional label for the selected item.
	// Default: - the variable's value.
	//
	Label *string `field:"optional" json:"label" yaml:"label"`
}

Example:

import "github.com/aws/aws-cdk-go/awscdk"

dashboard := cw.NewDashboard(this, jsii.String("Dash"), &DashboardProps{
	DefaultInterval: awscdk.Duration_Days(jsii.Number(7)),
	Variables: []iVariable{
		cw.NewDashboardVariable(&DashboardVariableOptions{
			Id: jsii.String("region"),
			Type: cw.VariableType_PROPERTY,
			Label: jsii.String("Region"),
			InputType: cw.VariableInputType_RADIO,
			Value: jsii.String("region"),
			Values: cw.Values_FromValues(&VariableValue{
				Label: jsii.String("IAD"),
				Value: jsii.String("us-east-1"),
			}, &VariableValue{
				Label: jsii.String("DUB"),
				Value: jsii.String("us-west-2"),
			}),
			DefaultValue: cw.DefaultValue_Value(jsii.String("us-east-1")),
			Visible: jsii.Boolean(true),
		}),
	},
})

type VerticalAnnotation added in v2.97.0

type VerticalAnnotation struct {
	// The date and time (in ISO 8601 format) in the graph where the vertical annotation line is to appear.
	Date *string `field:"required" json:"date" yaml:"date"`
	// The hex color code, prefixed with '#' (e.g. '#00ff00'), to be used for the annotation. The `Color` class has a set of standard colors that can be used here.
	// Default: - Automatic color.
	//
	Color *string `field:"optional" json:"color" yaml:"color"`
	// Add shading before or after the annotation.
	// Default: No shading.
	//
	Fill VerticalShading `field:"optional" json:"fill" yaml:"fill"`
	// Label for the annotation.
	// Default: - No label.
	//
	Label *string `field:"optional" json:"label" yaml:"label"`
	// Whether the annotation is visible.
	// Default: true.
	//
	Visible *bool `field:"optional" json:"visible" yaml:"visible"`
}

Vertical annotation to be added to a graph.

Example:

// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"

verticalAnnotation := &VerticalAnnotation{
	Date: jsii.String("date"),

	// the properties below are optional
	Color: jsii.String("color"),
	Fill: awscdk.Aws_cloudwatch.VerticalShading_NONE,
	Label: jsii.String("label"),
	Visible: jsii.Boolean(false),
}

type VerticalShading added in v2.97.0

type VerticalShading string

Fill shading options that will be used with a vertical annotation.

const (
	// Don't add shading.
	VerticalShading_NONE VerticalShading = "NONE"
	// Add shading before the annotation.
	VerticalShading_BEFORE VerticalShading = "BEFORE"
	// Add shading after the annotation.
	VerticalShading_AFTER VerticalShading = "AFTER"
)

type YAxisProps

type YAxisProps struct {
	// The label.
	// Default: - No label.
	//
	Label *string `field:"optional" json:"label" yaml:"label"`
	// The max value.
	// Default: - No maximum value.
	//
	Max *float64 `field:"optional" json:"max" yaml:"max"`
	// The min value.
	// Default: 0.
	//
	Min *float64 `field:"optional" json:"min" yaml:"min"`
	// Whether to show units.
	// Default: true.
	//
	ShowUnits *bool `field:"optional" json:"showUnits" yaml:"showUnits"`
}

Properties for a Y-Axis.

Example:

var dashboard dashboard
var errorAlarm alarm
var gaugeMetric metric

dashboard.AddWidgets(cloudwatch.NewGaugeWidget(&GaugeWidgetProps{
	Metrics: []iMetric{
		gaugeMetric,
	},
	LeftYAxis: &YAxisProps{
		Min: jsii.Number(0),
		Max: jsii.Number(1000),
	},
}))

Source Files

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL