interface SearchComponents
Language | Type name |
---|---|
![]() | Amazon.CDK.AWS.CloudWatch.SearchComponents |
![]() | github.com/aws/aws-cdk-go/awscdk/v2/awscloudwatch#SearchComponents |
![]() | software.amazon.awscdk.services.cloudwatch.SearchComponents |
![]() | aws_cdk.aws_cloudwatch.SearchComponents |
![]() | aws-cdk-lib » aws_cloudwatch » SearchComponents |
Search components for use with {@link Values.fromSearchComponents}.
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 |
---|---|---|
dimensions | string[] | The list of dimensions to be used in the search expression. |
metric | string | The metric name to be used in the search expression. |
namespace | string | The namespace to be used in the search expression. |
populate | string | The dimension name, that the search expression retrieves, whose values will be used to populate the values to choose from. |
dimensions
Type:
string[]
The list of dimensions to be used in the search expression.
metricName
Type:
string
The metric name to be used in the search expression.
namespace
Type:
string
The namespace to be used in the search expression.
populateFrom
Type:
string
The dimension name, that the search expression retrieves, whose values will be used to populate the values to choose from.