DefaultValue Class
Default value for use in {@link DashboardVariableOptions}.
Example
ts
import * as cw from 'aws-cdk-lib/aws-cloudwatch';
const dashboard = new cw.Dashboard(this, 'Dash', {
defaultInterval: Duration.days(7),
variables: [new cw.DashboardVariable({
id: 'functionName',
type: cw.VariableType.PATTERN,
label: 'Function',
inputType: cw.VariableInputType.RADIO,
value: 'originalFuncNameInDashboard',
// equivalent to cw.Values.fromSearch('{AWS/Lambda,FunctionName} MetricName=\"Duration\"', 'FunctionName')
values: cw.Values.fromSearchComponents({
namespace: 'AWS/Lambda',
dimensions: ['FunctionName'],
metricName: 'Duration',
populateFrom: 'FunctionName',
}),
defaultValue: cw.DefaultValue.FIRST,
visible: true,
})],
});
Properties
FIRSTDefaultValuefirstDefaultValueFIRSTDefaultValueFIRSTDefaultValueFIRSTDefaultValuerequiredstatic#A special value for use with search expressions to have the default value be the first value returned from search.
Methods
value(value: any): DefaultValue // chainable@staticmethod def value(value: Any) -> DefaultValuepublic static DefaultValue value(Object value)public static DefaultValue Value(object value)func Value(Value interface{}) DefaultValuestatic#Create a default value.
1 parameter
Parameters
valuevaluevaluevalueValue— the value to be used as default.