Skip to content
v2.275.0

Values Class ​

A class for providing values for use with {@link VariableInputType.SELECT} and {@link VariableInputType.RADIO} dashboard variables.

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: '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 ​

ts
new Values()
python
Values()
java
new Values()
csharp
new Values()
go
NewValues()

Methods ​

fromSearch(expression: string, populateFrom: string): Values // chainable@staticmethod def from_search(expression: str, populate_from: str) -> Valuespublic static Values fromSearch(String expression, String populateFrom)public static Values FromSearch(string expression, string populateFrom)func FromSearch(Expression *string, PopulateFrom *string) Valuesstatic#
Create values from a search expression.
2 parameters

Parameters

  • expressionexpressionexpressionexpressionExpression — search expression that specifies a namespace, dimension name(s) and a metric name.
  • populateFrompopulate_frompopulateFrompopulateFromPopulateFrom — dimension the dimension name, that the search expression retrieves, whose values will be used to populate the values to choose from.
fromSearchComponents(components: SearchComponents): Values // chainable@staticmethod def from_search_components(components: SearchComponents) -> Valuespublic static Values fromSearchComponents(SearchComponents components)public static Values FromSearchComponents(SearchComponents components)func FromSearchComponents(Components SearchComponents) Valuesstatic#
Create values from the components of search expression.
fromValues(...values: VariableValue[]): Values // chainable@staticmethod def from_values(values: VariableValue) -> Valuespublic static Values fromValues(VariableValue values)public static Values FromValues(VariableValue values)func FromValues(Values VariableValue) Valuesstatic#
Create values from an array of possible variable values.
toJson(): anydef to_json(self, ) -> Anypublic Object toJson()public object ToJson()func ToJson() interface{}#