class DefaultValue
| Language | Type name | 
|---|---|
|  .NET | Amazon.CDK.AWS.CloudWatch.DefaultValue | 
|  Go | github.com/aws/aws-cdk-go/awscdk/v2/awscloudwatch#DefaultValue | 
|  Java | software.amazon.awscdk.services.cloudwatch.DefaultValue | 
|  Python | aws_cdk.aws_cloudwatch.DefaultValue | 
|  TypeScript (source) | aws-cdk-lib»aws_cloudwatch»DefaultValue | 
Default value for use in {@link DashboardVariableOptions}.
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 | 
|---|---|---|
| val | any | |
| static FIRST | Default | A special value for use with search expressions to have the default value be the first value returned from search. | 
val
Type:
any
static FIRST
Type:
Default
A special value for use with search expressions to have the default value be the first value returned from search.
Methods
| Name | Description | 
|---|---|
| static value(value) | Create a default value. | 
static value(value)
public static value(value: any): DefaultValue
Parameters
- value any— the value to be used as default.
Returns
Create a default value.
