interface DashboardVariableOptions
Language | Type name |
---|---|
![]() | Amazon.CDK.AWS.CloudWatch.DashboardVariableOptions |
![]() | github.com/aws/aws-cdk-go/awscdk/v2/awscloudwatch#DashboardVariableOptions |
![]() | software.amazon.awscdk.services.cloudwatch.DashboardVariableOptions |
![]() | aws_cdk.aws_cloudwatch.DashboardVariableOptions |
![]() | aws-cdk-lib » aws_cloudwatch » DashboardVariableOptions |
Options for {@link DashboardVariable}.
Example
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
Name | Type | Description |
---|---|---|
id | string | Unique id. |
input | Variable | The way the variable value is selected. |
type | Variable | Type of the variable. |
value | string | Pattern or property value to replace. |
default | Default | Optional default value. |
label? | string | Optional label in the toolbar. |
values? | Values | Optional values (required for {@link VariableInputType.RADIO} and {@link VariableInputType.SELECT} dashboard variables). |
visible? | boolean | Whether the variable is visible. |
id
Type:
string
Unique id.
inputType
Type:
Variable
The way the variable value is selected.
type
Type:
Variable
Type of the variable.
value
Type:
string
Pattern or property value to replace.
defaultValue?
Type:
Default
(optional, default: no default value is set)
Optional default value.
label?
Type:
string
(optional, default: the variable's value)
Optional label in the toolbar.
values?
Type:
Values
(optional, default: no values)
Optional values (required for {@link VariableInputType.RADIO} and {@link VariableInputType.SELECT} dashboard variables).
visible?
Type:
boolean
(optional, default: true)
Whether the variable is visible.