class Values
Language | Type name |
---|---|
![]() | Amazon.CDK.AWS.CloudWatch.Values |
![]() | github.com/aws/aws-cdk-go/awscdk/v2/awscloudwatch#Values |
![]() | software.amazon.awscdk.services.cloudwatch.Values |
![]() | aws_cdk.aws_cloudwatch.Values |
![]() | aws-cdk-lib » aws_cloudwatch » Values |
A class for providing values for use with {@link VariableInputType.SELECT} and {@link VariableInputType.RADIO} dashboard variables.
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: 'region',
type: cw.VariableType.PROPERTY,
label: 'Region',
inputType: cw.VariableInputType.RADIO,
value: 'region',
values: cw.Values.fromValues({ label: 'IAD', value: 'us-east-1' }, { label: 'DUB', value: 'us-west-2' }),
defaultValue: cw.DefaultValue.value('us-east-1'),
visible: true,
})],
});
Initializer
new Values()
Methods
Name | Description |
---|---|
to | |
static from | Create values from a search expression. |
static from | Create values from the components of search expression. |
static from | Create values from an array of possible variable values. |
toJson()
public toJson(): any
Returns
any
static fromSearch(expression, populateFrom)
public static fromSearch(expression: string, populateFrom: string): Values
Parameters
- expression
string
— search expression that specifies a namespace, dimension name(s) and a metric name. - populateFrom
string
— dimension the dimension name, that the search expression retrieves, whose values will be used to populate the values to choose from.
Returns
Create values from a search expression.
static fromSearchComponents(components)
public static fromSearchComponents(components: SearchComponents): Values
Parameters
- components
Search
Components
Returns
Create values from the components of search expression.
static fromValues(...values)
public static fromValues(...values: VariableValue[]): Values
Parameters
- values
Variable
Value
Returns
Create values from an array of possible variable values.