DashboardVariableOptions Struct
Options for {@link DashboardVariable}.
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
defaultValueoptionalDefaultValuedefault_valueoptionalDefaultValuedefaultValueoptionalDefaultValueDefaultValueoptionalDefaultValueDefaultValueoptionalDefaultValue#Optional default value.
Default: no default value is set
Unique id.
inputTypeVariableInputTypeinput_typeVariableInputTypeinputTypeVariableInputTypeInputTypeVariableInputTypeInputTypeVariableInputTyperequired#The way the variable value is selected.
Optional label in the toolbar.
Default: the variable's value
Type of the variable.
Pattern or property value to replace.
valuesoptionalValuesvaluesoptionalValuesvaluesoptionalValuesValuesoptionalValuesValuesoptionalValues#Optional values (required for {@link VariableInputType.RADIO} and {@link VariableInputType.SELECT} dashboard variables).
Default: no values
visibleoptionalbooleanvisibleoptionalboolvisibleoptionalBooleanVisibleoptionalboolVisibleoptional*bool= true#Whether the variable is visible.