aws-cdk-lib 2.205.0__py3-none-any.whl → 2.207.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of aws-cdk-lib might be problematic. Click here for more details.

Files changed (30) hide show
  1. aws_cdk/__init__.py +96 -15
  2. aws_cdk/_jsii/__init__.py +1 -1
  3. aws_cdk/_jsii/{aws-cdk-lib@2.205.0.jsii.tgz → aws-cdk-lib@2.207.0.jsii.tgz} +0 -0
  4. aws_cdk/aws_aiops/__init__.py +66 -76
  5. aws_cdk/aws_autoscaling/__init__.py +20 -0
  6. aws_cdk/aws_bedrock/__init__.py +126 -70
  7. aws_cdk/aws_certificatemanager/__init__.py +3 -3
  8. aws_cdk/aws_cleanrooms/__init__.py +6 -2
  9. aws_cdk/aws_cloudformation/__init__.py +28 -15
  10. aws_cdk/aws_cloudwatch/__init__.py +574 -33
  11. aws_cdk/aws_datasync/__init__.py +14 -15
  12. aws_cdk/aws_ec2/__init__.py +6 -2
  13. aws_cdk/aws_ecs/__init__.py +773 -212
  14. aws_cdk/aws_iotsitewise/__init__.py +13 -9
  15. aws_cdk/aws_kms/__init__.py +19 -17
  16. aws_cdk/aws_logs/__init__.py +4725 -763
  17. aws_cdk/aws_mediapackagev2/__init__.py +69 -48
  18. aws_cdk/aws_opsworkscm/__init__.py +2 -4
  19. aws_cdk/aws_rds/__init__.py +150 -17
  20. aws_cdk/aws_s3/__init__.py +9 -6
  21. aws_cdk/aws_sagemaker/__init__.py +3 -3
  22. aws_cdk/aws_ssm/__init__.py +58 -33
  23. aws_cdk/aws_transfer/__init__.py +21 -11
  24. aws_cdk/custom_resources/__init__.py +32 -4
  25. {aws_cdk_lib-2.205.0.dist-info → aws_cdk_lib-2.207.0.dist-info}/METADATA +1 -1
  26. {aws_cdk_lib-2.205.0.dist-info → aws_cdk_lib-2.207.0.dist-info}/RECORD +30 -30
  27. {aws_cdk_lib-2.205.0.dist-info → aws_cdk_lib-2.207.0.dist-info}/LICENSE +0 -0
  28. {aws_cdk_lib-2.205.0.dist-info → aws_cdk_lib-2.207.0.dist-info}/NOTICE +0 -0
  29. {aws_cdk_lib-2.205.0.dist-info → aws_cdk_lib-2.207.0.dist-info}/WHEEL +0 -0
  30. {aws_cdk_lib-2.205.0.dist-info → aws_cdk_lib-2.207.0.dist-info}/top_level.txt +0 -0
@@ -152,19 +152,17 @@ error_rate = cloudwatch.MathExpression(
152
152
 
153
153
  ### Search Expressions
154
154
 
155
- Math expressions also support search expressions. For example, the following
156
- search expression returns all CPUUtilization metrics that it finds, with the
157
- graph showing the Average statistic with an aggregation period of 5 minutes:
155
+ Search expressions allow you to dynamically discover and display metrics that match specific criteria, making them ideal for monitoring dynamic infrastructure where the exact metrics aren't known in advance. A single search expression can return up to 500 time series.
156
+
157
+ #### Using SearchExpression Class
158
+
159
+ Following is an example of a search expression that returns all CPUUtilization metrics with the graph showing the Average statistic with an aggregation period of 5 minutes:
158
160
 
159
161
  ```python
160
- cpu_utilization = cloudwatch.MathExpression(
161
- expression="SEARCH('{AWS/EC2,InstanceId} MetricName=\"CPUUtilization\"', 'Average', 300)",
162
-
163
- # Specifying '' as the label suppresses the default behavior
164
- # of using the expression as metric label. This is especially appropriate
165
- # when using expressions that return multiple time series (like SEARCH()
166
- # or METRICS()), to show the labels of the retrieved metrics only.
167
- label=""
162
+ cpu_utilization = cloudwatch.SearchExpression(
163
+ expression="SEARCH('{AWS/EC2,InstanceId} MetricName=\"CPUUtilization\"', 'Average', 900)",
164
+ label="EC2 CPU Utilization",
165
+ color="#ff7f0e"
168
166
  )
169
167
  ```
170
168
 
@@ -172,6 +170,15 @@ Cross-account and cross-region search expressions are also supported. Use
172
170
  the `searchAccount` and `searchRegion` properties to specify the account
173
171
  and/or region to evaluate the search expression against.
174
172
 
173
+ ```python
174
+ cross_account_search = cloudwatch.SearchExpression(
175
+ expression="SEARCH('{AWS/Lambda,FunctionName} MetricName=\"Invocations\"', 'Sum', 300)",
176
+ search_account="123456789012",
177
+ search_region="us-west-2",
178
+ label="Production Lambda Invocations"
179
+ )
180
+ ```
181
+
175
182
  ### Aggregation
176
183
 
177
184
  To graph or alarm on metrics you must aggregate them first, using a function
@@ -8926,16 +8933,21 @@ class MathExpression(
8926
8933
 
8927
8934
  Example::
8928
8935
 
8929
- # fn: lambda.Function
8930
-
8936
+ # matchmaking_rule_set: gamelift.MatchmakingRuleSet
8931
8937
 
8932
- all_problems = cloudwatch.MathExpression(
8933
- expression="errors + throttles",
8938
+ # Alarm that triggers when the per-second average of not placed matches exceed 10%
8939
+ rule_evaluation_ratio = cloudwatch.MathExpression(
8940
+ expression="1 - (ruleEvaluationsPassed / ruleEvaluationsFailed)",
8934
8941
  using_metrics={
8935
- "errors": fn.metric_errors(),
8936
- "throttles": fn.metric_throttles()
8942
+ "rule_evaluations_passed": matchmaking_rule_set.metric_rule_evaluations_passed(statistic=cloudwatch.Statistic.SUM),
8943
+ "rule_evaluations_failed": matchmaking_rule_set.metric("ruleEvaluationsFailed")
8937
8944
  }
8938
8945
  )
8946
+ cloudwatch.Alarm(self, "Alarm",
8947
+ metric=rule_evaluation_ratio,
8948
+ threshold=0.1,
8949
+ evaluation_periods=3
8950
+ )
8939
8951
  '''
8940
8952
 
8941
8953
  def __init__(
@@ -8954,7 +8966,7 @@ class MathExpression(
8954
8966
  :param using_metrics: The metrics used in the expression, in a map. The key is the identifier that represents the given metric in the expression, and the value is the actual Metric object. The ``period`` of each metric in ``usingMetrics`` is ignored and instead overridden by the ``period`` specified for the ``MathExpression`` construct. Even if no ``period`` is specified for the ``MathExpression``, it will be overridden by the default value (``Duration.minutes(5)``). Example:: declare const metrics: elbv2.IApplicationLoadBalancerMetrics; new cloudwatch.MathExpression({ expression: 'm1+m2', label: 'AlbErrors', usingMetrics: { m1: metrics.custom('HTTPCode_ELB_500_Count', { period: Duration.minutes(1), // <- This period will be ignored statistic: 'Sum', label: 'HTTPCode_ELB_500_Count', }), m2: metrics.custom('HTTPCode_ELB_502_Count', { period: Duration.minutes(1), // <- This period will be ignored statistic: 'Sum', label: 'HTTPCode_ELB_502_Count', }), }, period: Duration.minutes(3), // <- This overrides the period of each metric in `usingMetrics` // (Even if not specified, it is overridden by the default value) }); Default: - Empty map.
8955
8967
  :param color: Color for this metric when added to a Graph in a Dashboard. Default: - Automatic color
8956
8968
  :param label: Label for this expression when added to a Graph in a Dashboard. If this expression evaluates to more than one time series (for example, through the use of ``METRICS()`` or ``SEARCH()`` expressions), each time series will appear in the graph using a combination of the expression label and the individual metric label. Specify the empty string (``''``) to suppress the expression label and only keep the metric label. You can use `dynamic labels <https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/graph-dynamic-labels.html>`_ to show summary information about the displayed time series in the legend. For example, if you use:: [max: ${MAX}] MyMetric As the metric label, the maximum value in the visible range will be shown next to the time series name in the graph's legend. If the math expression produces more than one time series, the maximum will be shown for each individual time series produce by this math expression. Default: - Expression value is used as label
8957
- :param period: The period over which the expression's statistics are applied. This period overrides all periods in the metrics used in this math expression. Default: Duration.minutes(5)
8969
+ :param period: The period over which the math expression's statistics are applied. This period overrides all periods in the metrics used in this math expression. Default: Duration.minutes(5)
8958
8970
  :param search_account: Account to evaluate search expressions within. Specifying a searchAccount has no effect to the account used for metrics within the expression (passed via usingMetrics). Default: - Deployment account.
8959
8971
  :param search_region: Region to evaluate search expressions within. Specifying a searchRegion has no effect to the region used for metrics within the expression (passed via usingMetrics). Default: - Deployment region.
8960
8972
  '''
@@ -9047,7 +9059,7 @@ class MathExpression(
9047
9059
 
9048
9060
  :param color: Color for this metric when added to a Graph in a Dashboard. Default: - Automatic color
9049
9061
  :param label: Label for this expression when added to a Graph in a Dashboard. If this expression evaluates to more than one time series (for example, through the use of ``METRICS()`` or ``SEARCH()`` expressions), each time series will appear in the graph using a combination of the expression label and the individual metric label. Specify the empty string (``''``) to suppress the expression label and only keep the metric label. You can use `dynamic labels <https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/graph-dynamic-labels.html>`_ to show summary information about the displayed time series in the legend. For example, if you use:: [max: ${MAX}] MyMetric As the metric label, the maximum value in the visible range will be shown next to the time series name in the graph's legend. If the math expression produces more than one time series, the maximum will be shown for each individual time series produce by this math expression. Default: - Expression value is used as label
9050
- :param period: The period over which the expression's statistics are applied. This period overrides all periods in the metrics used in this math expression. Default: Duration.minutes(5)
9062
+ :param period: The period over which the math expression's statistics are applied. This period overrides all periods in the metrics used in this math expression. Default: Duration.minutes(5)
9051
9063
  :param search_account: Account to evaluate search expressions within. Specifying a searchAccount has no effect to the account used for metrics within the expression (passed via usingMetrics). Default: - Deployment account.
9052
9064
  :param search_region: Region to evaluate search expressions within. Specifying a searchRegion has no effect to the region used for metrics within the expression (passed via usingMetrics). Default: - Deployment region.
9053
9065
  '''
@@ -9148,7 +9160,7 @@ class MathExpressionOptions:
9148
9160
 
9149
9161
  :param color: Color for this metric when added to a Graph in a Dashboard. Default: - Automatic color
9150
9162
  :param label: Label for this expression when added to a Graph in a Dashboard. If this expression evaluates to more than one time series (for example, through the use of ``METRICS()`` or ``SEARCH()`` expressions), each time series will appear in the graph using a combination of the expression label and the individual metric label. Specify the empty string (``''``) to suppress the expression label and only keep the metric label. You can use `dynamic labels <https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/graph-dynamic-labels.html>`_ to show summary information about the displayed time series in the legend. For example, if you use:: [max: ${MAX}] MyMetric As the metric label, the maximum value in the visible range will be shown next to the time series name in the graph's legend. If the math expression produces more than one time series, the maximum will be shown for each individual time series produce by this math expression. Default: - Expression value is used as label
9151
- :param period: The period over which the expression's statistics are applied. This period overrides all periods in the metrics used in this math expression. Default: Duration.minutes(5)
9163
+ :param period: The period over which the math expression's statistics are applied. This period overrides all periods in the metrics used in this math expression. Default: Duration.minutes(5)
9152
9164
  :param search_account: Account to evaluate search expressions within. Specifying a searchAccount has no effect to the account used for metrics within the expression (passed via usingMetrics). Default: - Deployment account.
9153
9165
  :param search_region: Region to evaluate search expressions within. Specifying a searchRegion has no effect to the region used for metrics within the expression (passed via usingMetrics). Default: - Deployment region.
9154
9166
 
@@ -9227,7 +9239,7 @@ class MathExpressionOptions:
9227
9239
 
9228
9240
  @builtins.property
9229
9241
  def period(self) -> typing.Optional[_Duration_4839e8c3]:
9230
- '''The period over which the expression's statistics are applied.
9242
+ '''The period over which the math expression's statistics are applied.
9231
9243
 
9232
9244
  This period overrides all periods in the metrics used in this
9233
9245
  math expression.
@@ -9302,7 +9314,7 @@ class MathExpressionProps(MathExpressionOptions):
9302
9314
 
9303
9315
  :param color: Color for this metric when added to a Graph in a Dashboard. Default: - Automatic color
9304
9316
  :param label: Label for this expression when added to a Graph in a Dashboard. If this expression evaluates to more than one time series (for example, through the use of ``METRICS()`` or ``SEARCH()`` expressions), each time series will appear in the graph using a combination of the expression label and the individual metric label. Specify the empty string (``''``) to suppress the expression label and only keep the metric label. You can use `dynamic labels <https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/graph-dynamic-labels.html>`_ to show summary information about the displayed time series in the legend. For example, if you use:: [max: ${MAX}] MyMetric As the metric label, the maximum value in the visible range will be shown next to the time series name in the graph's legend. If the math expression produces more than one time series, the maximum will be shown for each individual time series produce by this math expression. Default: - Expression value is used as label
9305
- :param period: The period over which the expression's statistics are applied. This period overrides all periods in the metrics used in this math expression. Default: Duration.minutes(5)
9317
+ :param period: The period over which the math expression's statistics are applied. This period overrides all periods in the metrics used in this math expression. Default: Duration.minutes(5)
9306
9318
  :param search_account: Account to evaluate search expressions within. Specifying a searchAccount has no effect to the account used for metrics within the expression (passed via usingMetrics). Default: - Deployment account.
9307
9319
  :param search_region: Region to evaluate search expressions within. Specifying a searchRegion has no effect to the region used for metrics within the expression (passed via usingMetrics). Default: - Deployment region.
9308
9320
  :param expression: The expression defining the metric. When an expression contains a SEARCH function, it cannot be used within an Alarm.
@@ -9312,16 +9324,21 @@ class MathExpressionProps(MathExpressionOptions):
9312
9324
 
9313
9325
  Example::
9314
9326
 
9315
- # fn: lambda.Function
9327
+ # matchmaking_rule_set: gamelift.MatchmakingRuleSet
9316
9328
 
9317
-
9318
- all_problems = cloudwatch.MathExpression(
9319
- expression="errors + throttles",
9329
+ # Alarm that triggers when the per-second average of not placed matches exceed 10%
9330
+ rule_evaluation_ratio = cloudwatch.MathExpression(
9331
+ expression="1 - (ruleEvaluationsPassed / ruleEvaluationsFailed)",
9320
9332
  using_metrics={
9321
- "errors": fn.metric_errors(),
9322
- "throttles": fn.metric_throttles()
9333
+ "rule_evaluations_passed": matchmaking_rule_set.metric_rule_evaluations_passed(statistic=cloudwatch.Statistic.SUM),
9334
+ "rule_evaluations_failed": matchmaking_rule_set.metric("ruleEvaluationsFailed")
9323
9335
  }
9324
9336
  )
9337
+ cloudwatch.Alarm(self, "Alarm",
9338
+ metric=rule_evaluation_ratio,
9339
+ threshold=0.1,
9340
+ evaluation_periods=3
9341
+ )
9325
9342
  '''
9326
9343
  if __debug__:
9327
9344
  type_hints = typing.get_type_hints(_typecheckingstub__7cfb588e44acd0977aa0e09f00c3e2435bad84385ab7b6d163b332963d844e0a)
@@ -9387,7 +9404,7 @@ class MathExpressionProps(MathExpressionOptions):
9387
9404
 
9388
9405
  @builtins.property
9389
9406
  def period(self) -> typing.Optional[_Duration_4839e8c3]:
9390
- '''The period over which the expression's statistics are applied.
9407
+ '''The period over which the math expression's statistics are applied.
9391
9408
 
9392
9409
  This period overrides all periods in the metrics used in this
9393
9410
  math expression.
@@ -9595,7 +9612,7 @@ class Metric(metaclass=jsii.JSIIMeta, jsii_type="aws-cdk-lib.aws_cloudwatch.Metr
9595
9612
  :param std_devs: The number of standard deviations to use for the anomaly detection band. The higher the value, the wider the band. - Must be greater than 0. A value of 0 or negative values would not make sense in the context of calculating standard deviations. - There is no strict maximum value defined, as standard deviations can theoretically extend infinitely. However, in practice, values beyond 5 or 6 standard deviations are rarely used, as they would result in an extremely wide anomaly detection band, potentially missing significant anomalies. Default: 2
9596
9613
  :param color: Color for this metric when added to a Graph in a Dashboard. Default: - Automatic color
9597
9614
  :param label: Label for this expression when added to a Graph in a Dashboard. If this expression evaluates to more than one time series (for example, through the use of ``METRICS()`` or ``SEARCH()`` expressions), each time series will appear in the graph using a combination of the expression label and the individual metric label. Specify the empty string (``''``) to suppress the expression label and only keep the metric label. You can use `dynamic labels <https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/graph-dynamic-labels.html>`_ to show summary information about the displayed time series in the legend. For example, if you use:: [max: ${MAX}] MyMetric As the metric label, the maximum value in the visible range will be shown next to the time series name in the graph's legend. If the math expression produces more than one time series, the maximum will be shown for each individual time series produce by this math expression. Default: - Expression value is used as label
9598
- :param period: The period over which the expression's statistics are applied. This period overrides all periods in the metrics used in this math expression. Default: Duration.minutes(5)
9615
+ :param period: The period over which the math expression's statistics are applied. This period overrides all periods in the metrics used in this math expression. Default: Duration.minutes(5)
9599
9616
  :param search_account: Account to evaluate search expressions within. Specifying a searchAccount has no effect to the account used for metrics within the expression (passed via usingMetrics). Default: - Deployment account.
9600
9617
  :param search_region: Region to evaluate search expressions within. Specifying a searchRegion has no effect to the region used for metrics within the expression (passed via usingMetrics). Default: - Deployment region.
9601
9618
 
@@ -9856,6 +9873,7 @@ class Metric(metaclass=jsii.JSIIMeta, jsii_type="aws-cdk-lib.aws_cloudwatch.Metr
9856
9873
  "math_expression": "mathExpression",
9857
9874
  "metric_stat": "metricStat",
9858
9875
  "rendering_properties": "renderingProperties",
9876
+ "search_expression": "searchExpression",
9859
9877
  },
9860
9878
  )
9861
9879
  class MetricConfig:
@@ -9865,12 +9883,14 @@ class MetricConfig:
9865
9883
  math_expression: typing.Optional[typing.Union["MetricExpressionConfig", typing.Dict[builtins.str, typing.Any]]] = None,
9866
9884
  metric_stat: typing.Optional[typing.Union["MetricStatConfig", typing.Dict[builtins.str, typing.Any]]] = None,
9867
9885
  rendering_properties: typing.Optional[typing.Mapping[builtins.str, typing.Any]] = None,
9886
+ search_expression: typing.Optional[typing.Union["MetricExpressionConfig", typing.Dict[builtins.str, typing.Any]]] = None,
9868
9887
  ) -> None:
9869
9888
  '''Properties of a rendered metric.
9870
9889
 
9871
9890
  :param math_expression: In case the metric is a math expression, the details of the math expression. Default: - None
9872
9891
  :param metric_stat: In case the metric represents a query, the details of the query. Default: - None
9873
9892
  :param rendering_properties: Additional properties which will be rendered if the metric is used in a dashboard. Examples are 'label' and 'color', but any key in here will be added to dashboard graphs. Default: - None
9893
+ :param search_expression: In case the metric is a search expression, the details of the search expression. Default: - None
9874
9894
 
9875
9895
  :exampleMetadata: fixture=_generated
9876
9896
 
@@ -9916,18 +9936,32 @@ class MetricConfig:
9916
9936
  ),
9917
9937
  rendering_properties={
9918
9938
  "rendering_properties_key": rendering_properties
9919
- }
9939
+ },
9940
+ search_expression=cloudwatch.MetricExpressionConfig(
9941
+ expression="expression",
9942
+ period=123,
9943
+ using_metrics={
9944
+ "using_metrics_key": metric
9945
+ },
9946
+
9947
+ # the properties below are optional
9948
+ search_account="searchAccount",
9949
+ search_region="searchRegion"
9950
+ )
9920
9951
  )
9921
9952
  '''
9922
9953
  if isinstance(math_expression, dict):
9923
9954
  math_expression = MetricExpressionConfig(**math_expression)
9924
9955
  if isinstance(metric_stat, dict):
9925
9956
  metric_stat = MetricStatConfig(**metric_stat)
9957
+ if isinstance(search_expression, dict):
9958
+ search_expression = MetricExpressionConfig(**search_expression)
9926
9959
  if __debug__:
9927
9960
  type_hints = typing.get_type_hints(_typecheckingstub__2ddb584abe8421d7f77520aa621133794d500e179ff044f43970dac3fd018cca)
9928
9961
  check_type(argname="argument math_expression", value=math_expression, expected_type=type_hints["math_expression"])
9929
9962
  check_type(argname="argument metric_stat", value=metric_stat, expected_type=type_hints["metric_stat"])
9930
9963
  check_type(argname="argument rendering_properties", value=rendering_properties, expected_type=type_hints["rendering_properties"])
9964
+ check_type(argname="argument search_expression", value=search_expression, expected_type=type_hints["search_expression"])
9931
9965
  self._values: typing.Dict[builtins.str, typing.Any] = {}
9932
9966
  if math_expression is not None:
9933
9967
  self._values["math_expression"] = math_expression
@@ -9935,6 +9969,8 @@ class MetricConfig:
9935
9969
  self._values["metric_stat"] = metric_stat
9936
9970
  if rendering_properties is not None:
9937
9971
  self._values["rendering_properties"] = rendering_properties
9972
+ if search_expression is not None:
9973
+ self._values["search_expression"] = search_expression
9938
9974
 
9939
9975
  @builtins.property
9940
9976
  def math_expression(self) -> typing.Optional["MetricExpressionConfig"]:
@@ -9968,6 +10004,15 @@ class MetricConfig:
9968
10004
  result = self._values.get("rendering_properties")
9969
10005
  return typing.cast(typing.Optional[typing.Mapping[builtins.str, typing.Any]], result)
9970
10006
 
10007
+ @builtins.property
10008
+ def search_expression(self) -> typing.Optional["MetricExpressionConfig"]:
10009
+ '''In case the metric is a search expression, the details of the search expression.
10010
+
10011
+ :default: - None
10012
+ '''
10013
+ result = self._values.get("search_expression")
10014
+ return typing.cast(typing.Optional["MetricExpressionConfig"], result)
10015
+
9971
10016
  def __eq__(self, rhs: typing.Any) -> builtins.bool:
9972
10017
  return isinstance(rhs, self.__class__) and rhs._values == self._values
9973
10018
 
@@ -11207,6 +11252,475 @@ class SearchComponents:
11207
11252
  )
11208
11253
 
11209
11254
 
11255
+ @jsii.implements(IMetric)
11256
+ class SearchExpression(
11257
+ metaclass=jsii.JSIIMeta,
11258
+ jsii_type="aws-cdk-lib.aws_cloudwatch.SearchExpression",
11259
+ ):
11260
+ '''A CloudWatch search expression for dynamically finding and graphing multiple related metrics.
11261
+
11262
+ Search expressions allow you to search for and graph multiple related metrics from a single expression.
11263
+ This is particularly useful in dynamic environments where the exact metric names or dimensions
11264
+ may not be known at deployment time.
11265
+
11266
+ Example::
11267
+
11268
+ search_expression = cloudwatch.SearchExpression(
11269
+ expression="SEARCH('{AWS/EC2,InstanceId} CPUUtilization', 'Average', 300)",
11270
+ label="EC2 CPU Utilization",
11271
+ period=Duration.minutes(5)
11272
+ )
11273
+
11274
+ This class does not represent a resource, so hence is not a construct. Instead,
11275
+ SearchExpression is an abstraction that makes it easy to specify metrics for use in graphs.
11276
+
11277
+ :exampleMetadata: infused
11278
+
11279
+ Example::
11280
+
11281
+ cpu_utilization = cloudwatch.SearchExpression(
11282
+ expression="SEARCH('{AWS/EC2,InstanceId} MetricName=\"CPUUtilization\"', 'Average', 900)",
11283
+ label="EC2 CPU Utilization",
11284
+ color="#ff7f0e"
11285
+ )
11286
+ '''
11287
+
11288
+ def __init__(
11289
+ self,
11290
+ *,
11291
+ expression: builtins.str,
11292
+ color: typing.Optional[builtins.str] = None,
11293
+ label: typing.Optional[builtins.str] = None,
11294
+ period: typing.Optional[_Duration_4839e8c3] = None,
11295
+ search_account: typing.Optional[builtins.str] = None,
11296
+ search_region: typing.Optional[builtins.str] = None,
11297
+ ) -> None:
11298
+ '''
11299
+ :param expression: The search expression defining the metrics to be retrieved. A search expression cannot be used within an Alarm. A search expression allows you to retrieve and graph multiple related metrics in a single statement. It can return up to 500 time series. Examples: - ``SEARCH('{AWS/EC2,InstanceId} CPUUtilization', 'Average', 300)`` - ``SEARCH('{AWS/ApplicationELB,LoadBalancer} RequestCount', 'Sum', 60)`` - ``SEARCH('{MyNamespace,ServiceName} Errors', 'Sum')`` For more information about search expression syntax, see: https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/search-expression-syntax.html
11300
+ :param color: Color for the metric produced by the search expression. If the search expression produces more than one time series, the color is assigned to the first one. Other metrics are assigned colors automatically. Default: - Automatically assigned.
11301
+ :param label: Label for this search expression when added to a Graph in a Dashboard. If this expression evaluates to more than one time series, each time series will appear in the graph using a combination of the expression label and the individual metric label. Specify the empty string (``''``) to suppress the expression label and only keep the metric label. You can use `dynamic labels <https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/graph-dynamic-labels.html>`_ to show summary information about the displayed time series in the legend. For example, if you use:: [max: ${MAX}] MyMetric As the metric label, the maximum value in the visible range will be shown next to the time series name in the graph's legend. If the search expression produces more than one time series, the maximum will be shown for each individual time series produce by this search expression. Default: - No label.
11302
+ :param period: The period over which the search expression's statistics are applied. This period overrides the period defined within the search expression. Default: Duration.minutes(5)
11303
+ :param search_account: Account to evaluate search expressions within. Default: - Deployment account.
11304
+ :param search_region: Region to evaluate search expressions within. Default: - Deployment region.
11305
+ '''
11306
+ props = SearchExpressionProps(
11307
+ expression=expression,
11308
+ color=color,
11309
+ label=label,
11310
+ period=period,
11311
+ search_account=search_account,
11312
+ search_region=search_region,
11313
+ )
11314
+
11315
+ jsii.create(self.__class__, self, [props])
11316
+
11317
+ @jsii.member(jsii_name="toMetricConfig")
11318
+ def to_metric_config(self) -> MetricConfig:
11319
+ '''Inspect the details of the metric object.'''
11320
+ return typing.cast(MetricConfig, jsii.invoke(self, "toMetricConfig", []))
11321
+
11322
+ @jsii.member(jsii_name="toString")
11323
+ def to_string(self) -> builtins.str:
11324
+ '''Returns a string representation of an object.'''
11325
+ return typing.cast(builtins.str, jsii.invoke(self, "toString", []))
11326
+
11327
+ @jsii.member(jsii_name="with")
11328
+ def with_(
11329
+ self,
11330
+ *,
11331
+ color: typing.Optional[builtins.str] = None,
11332
+ label: typing.Optional[builtins.str] = None,
11333
+ period: typing.Optional[_Duration_4839e8c3] = None,
11334
+ search_account: typing.Optional[builtins.str] = None,
11335
+ search_region: typing.Optional[builtins.str] = None,
11336
+ ) -> "SearchExpression":
11337
+ '''Return a copy of SearchExpression with properties changed.
11338
+
11339
+ All properties except expression can be changed.
11340
+
11341
+ :param color: Color for the metric produced by the search expression. If the search expression produces more than one time series, the color is assigned to the first one. Other metrics are assigned colors automatically. Default: - Automatically assigned.
11342
+ :param label: Label for this search expression when added to a Graph in a Dashboard. If this expression evaluates to more than one time series, each time series will appear in the graph using a combination of the expression label and the individual metric label. Specify the empty string (``''``) to suppress the expression label and only keep the metric label. You can use `dynamic labels <https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/graph-dynamic-labels.html>`_ to show summary information about the displayed time series in the legend. For example, if you use:: [max: ${MAX}] MyMetric As the metric label, the maximum value in the visible range will be shown next to the time series name in the graph's legend. If the search expression produces more than one time series, the maximum will be shown for each individual time series produce by this search expression. Default: - No label.
11343
+ :param period: The period over which the search expression's statistics are applied. This period overrides the period defined within the search expression. Default: Duration.minutes(5)
11344
+ :param search_account: Account to evaluate search expressions within. Default: - Deployment account.
11345
+ :param search_region: Region to evaluate search expressions within. Default: - Deployment region.
11346
+ '''
11347
+ props = SearchExpressionOptions(
11348
+ color=color,
11349
+ label=label,
11350
+ period=period,
11351
+ search_account=search_account,
11352
+ search_region=search_region,
11353
+ )
11354
+
11355
+ return typing.cast("SearchExpression", jsii.invoke(self, "with", [props]))
11356
+
11357
+ @builtins.property
11358
+ @jsii.member(jsii_name="expression")
11359
+ def expression(self) -> builtins.str:
11360
+ '''The search expression defining the metrics to be retrieved.'''
11361
+ return typing.cast(builtins.str, jsii.get(self, "expression"))
11362
+
11363
+ @builtins.property
11364
+ @jsii.member(jsii_name="period")
11365
+ def period(self) -> _Duration_4839e8c3:
11366
+ '''The aggregation period for the metrics produced by the Search Expression.'''
11367
+ return typing.cast(_Duration_4839e8c3, jsii.get(self, "period"))
11368
+
11369
+ @builtins.property
11370
+ @jsii.member(jsii_name="color")
11371
+ def color(self) -> typing.Optional[builtins.str]:
11372
+ '''Hex color code (e.g. '#00ff00'), to use when rendering the resulting metrics in a graph. If multiple time series are returned, color is assigned to the first metric, color for the other metrics is automatically assigned.'''
11373
+ return typing.cast(typing.Optional[builtins.str], jsii.get(self, "color"))
11374
+
11375
+ @builtins.property
11376
+ @jsii.member(jsii_name="label")
11377
+ def label(self) -> typing.Optional[builtins.str]:
11378
+ '''The label is used as a prefix for the title of each metric returned by the search expression.'''
11379
+ return typing.cast(typing.Optional[builtins.str], jsii.get(self, "label"))
11380
+
11381
+ @builtins.property
11382
+ @jsii.member(jsii_name="searchAccount")
11383
+ def search_account(self) -> typing.Optional[builtins.str]:
11384
+ '''Account to evaluate search expressions within.'''
11385
+ return typing.cast(typing.Optional[builtins.str], jsii.get(self, "searchAccount"))
11386
+
11387
+ @builtins.property
11388
+ @jsii.member(jsii_name="searchRegion")
11389
+ def search_region(self) -> typing.Optional[builtins.str]:
11390
+ '''Region to evaluate search expressions within.'''
11391
+ return typing.cast(typing.Optional[builtins.str], jsii.get(self, "searchRegion"))
11392
+
11393
+ @builtins.property
11394
+ @jsii.member(jsii_name="warnings")
11395
+ def warnings(self) -> typing.Optional[typing.List[builtins.str]]:
11396
+ '''(deprecated) Warnings generated by this search expression.
11397
+
11398
+ :deprecated: - use warningsV2
11399
+
11400
+ :stability: deprecated
11401
+ '''
11402
+ return typing.cast(typing.Optional[typing.List[builtins.str]], jsii.get(self, "warnings"))
11403
+
11404
+ @builtins.property
11405
+ @jsii.member(jsii_name="warningsV2")
11406
+ def warnings_v2(
11407
+ self,
11408
+ ) -> typing.Optional[typing.Mapping[builtins.str, builtins.str]]:
11409
+ '''Warnings generated by this search expression.'''
11410
+ return typing.cast(typing.Optional[typing.Mapping[builtins.str, builtins.str]], jsii.get(self, "warningsV2"))
11411
+
11412
+
11413
+ @jsii.data_type(
11414
+ jsii_type="aws-cdk-lib.aws_cloudwatch.SearchExpressionOptions",
11415
+ jsii_struct_bases=[],
11416
+ name_mapping={
11417
+ "color": "color",
11418
+ "label": "label",
11419
+ "period": "period",
11420
+ "search_account": "searchAccount",
11421
+ "search_region": "searchRegion",
11422
+ },
11423
+ )
11424
+ class SearchExpressionOptions:
11425
+ def __init__(
11426
+ self,
11427
+ *,
11428
+ color: typing.Optional[builtins.str] = None,
11429
+ label: typing.Optional[builtins.str] = None,
11430
+ period: typing.Optional[_Duration_4839e8c3] = None,
11431
+ search_account: typing.Optional[builtins.str] = None,
11432
+ search_region: typing.Optional[builtins.str] = None,
11433
+ ) -> None:
11434
+ '''Configurable options for SearchExpressions.
11435
+
11436
+ :param color: Color for the metric produced by the search expression. If the search expression produces more than one time series, the color is assigned to the first one. Other metrics are assigned colors automatically. Default: - Automatically assigned.
11437
+ :param label: Label for this search expression when added to a Graph in a Dashboard. If this expression evaluates to more than one time series, each time series will appear in the graph using a combination of the expression label and the individual metric label. Specify the empty string (``''``) to suppress the expression label and only keep the metric label. You can use `dynamic labels <https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/graph-dynamic-labels.html>`_ to show summary information about the displayed time series in the legend. For example, if you use:: [max: ${MAX}] MyMetric As the metric label, the maximum value in the visible range will be shown next to the time series name in the graph's legend. If the search expression produces more than one time series, the maximum will be shown for each individual time series produce by this search expression. Default: - No label.
11438
+ :param period: The period over which the search expression's statistics are applied. This period overrides the period defined within the search expression. Default: Duration.minutes(5)
11439
+ :param search_account: Account to evaluate search expressions within. Default: - Deployment account.
11440
+ :param search_region: Region to evaluate search expressions within. Default: - Deployment region.
11441
+
11442
+ :exampleMetadata: fixture=_generated
11443
+
11444
+ Example::
11445
+
11446
+ # The code below shows an example of how to instantiate this type.
11447
+ # The values are placeholders you should change.
11448
+ import aws_cdk as cdk
11449
+ from aws_cdk import aws_cloudwatch as cloudwatch
11450
+
11451
+ search_expression_options = cloudwatch.SearchExpressionOptions(
11452
+ color="color",
11453
+ label="label",
11454
+ period=cdk.Duration.minutes(30),
11455
+ search_account="searchAccount",
11456
+ search_region="searchRegion"
11457
+ )
11458
+ '''
11459
+ if __debug__:
11460
+ type_hints = typing.get_type_hints(_typecheckingstub__9f60f6548f685a7de97fff8e4e2d7ad81a4a32dbef7d990d9298e04900ccf74c)
11461
+ check_type(argname="argument color", value=color, expected_type=type_hints["color"])
11462
+ check_type(argname="argument label", value=label, expected_type=type_hints["label"])
11463
+ check_type(argname="argument period", value=period, expected_type=type_hints["period"])
11464
+ check_type(argname="argument search_account", value=search_account, expected_type=type_hints["search_account"])
11465
+ check_type(argname="argument search_region", value=search_region, expected_type=type_hints["search_region"])
11466
+ self._values: typing.Dict[builtins.str, typing.Any] = {}
11467
+ if color is not None:
11468
+ self._values["color"] = color
11469
+ if label is not None:
11470
+ self._values["label"] = label
11471
+ if period is not None:
11472
+ self._values["period"] = period
11473
+ if search_account is not None:
11474
+ self._values["search_account"] = search_account
11475
+ if search_region is not None:
11476
+ self._values["search_region"] = search_region
11477
+
11478
+ @builtins.property
11479
+ def color(self) -> typing.Optional[builtins.str]:
11480
+ '''Color for the metric produced by the search expression.
11481
+
11482
+ If the search expression produces more than one time series, the color is assigned to the first one.
11483
+ Other metrics are assigned colors automatically.
11484
+
11485
+ :default: - Automatically assigned.
11486
+ '''
11487
+ result = self._values.get("color")
11488
+ return typing.cast(typing.Optional[builtins.str], result)
11489
+
11490
+ @builtins.property
11491
+ def label(self) -> typing.Optional[builtins.str]:
11492
+ '''Label for this search expression when added to a Graph in a Dashboard.
11493
+
11494
+ If this expression evaluates to more than one time series,
11495
+ each time series will appear in the graph using a combination of the
11496
+ expression label and the individual metric label. Specify the empty
11497
+ string (``''``) to suppress the expression label and only keep the
11498
+ metric label.
11499
+
11500
+ You can use `dynamic labels <https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/graph-dynamic-labels.html>`_
11501
+ to show summary information about the displayed time series
11502
+ in the legend. For example, if you use::
11503
+
11504
+ [max: ${MAX}] MyMetric
11505
+
11506
+ As the metric label, the maximum value in the visible range will
11507
+ be shown next to the time series name in the graph's legend. If the
11508
+ search expression produces more than one time series, the maximum
11509
+ will be shown for each individual time series produce by this
11510
+ search expression.
11511
+
11512
+ :default: - No label.
11513
+ '''
11514
+ result = self._values.get("label")
11515
+ return typing.cast(typing.Optional[builtins.str], result)
11516
+
11517
+ @builtins.property
11518
+ def period(self) -> typing.Optional[_Duration_4839e8c3]:
11519
+ '''The period over which the search expression's statistics are applied.
11520
+
11521
+ This period overrides the period defined within the search expression.
11522
+
11523
+ :default: Duration.minutes(5)
11524
+ '''
11525
+ result = self._values.get("period")
11526
+ return typing.cast(typing.Optional[_Duration_4839e8c3], result)
11527
+
11528
+ @builtins.property
11529
+ def search_account(self) -> typing.Optional[builtins.str]:
11530
+ '''Account to evaluate search expressions within.
11531
+
11532
+ :default: - Deployment account.
11533
+ '''
11534
+ result = self._values.get("search_account")
11535
+ return typing.cast(typing.Optional[builtins.str], result)
11536
+
11537
+ @builtins.property
11538
+ def search_region(self) -> typing.Optional[builtins.str]:
11539
+ '''Region to evaluate search expressions within.
11540
+
11541
+ :default: - Deployment region.
11542
+ '''
11543
+ result = self._values.get("search_region")
11544
+ return typing.cast(typing.Optional[builtins.str], result)
11545
+
11546
+ def __eq__(self, rhs: typing.Any) -> builtins.bool:
11547
+ return isinstance(rhs, self.__class__) and rhs._values == self._values
11548
+
11549
+ def __ne__(self, rhs: typing.Any) -> builtins.bool:
11550
+ return not (rhs == self)
11551
+
11552
+ def __repr__(self) -> str:
11553
+ return "SearchExpressionOptions(%s)" % ", ".join(
11554
+ k + "=" + repr(v) for k, v in self._values.items()
11555
+ )
11556
+
11557
+
11558
+ @jsii.data_type(
11559
+ jsii_type="aws-cdk-lib.aws_cloudwatch.SearchExpressionProps",
11560
+ jsii_struct_bases=[SearchExpressionOptions],
11561
+ name_mapping={
11562
+ "color": "color",
11563
+ "label": "label",
11564
+ "period": "period",
11565
+ "search_account": "searchAccount",
11566
+ "search_region": "searchRegion",
11567
+ "expression": "expression",
11568
+ },
11569
+ )
11570
+ class SearchExpressionProps(SearchExpressionOptions):
11571
+ def __init__(
11572
+ self,
11573
+ *,
11574
+ color: typing.Optional[builtins.str] = None,
11575
+ label: typing.Optional[builtins.str] = None,
11576
+ period: typing.Optional[_Duration_4839e8c3] = None,
11577
+ search_account: typing.Optional[builtins.str] = None,
11578
+ search_region: typing.Optional[builtins.str] = None,
11579
+ expression: builtins.str,
11580
+ ) -> None:
11581
+ '''Properties for a SearchExpression.
11582
+
11583
+ :param color: Color for the metric produced by the search expression. If the search expression produces more than one time series, the color is assigned to the first one. Other metrics are assigned colors automatically. Default: - Automatically assigned.
11584
+ :param label: Label for this search expression when added to a Graph in a Dashboard. If this expression evaluates to more than one time series, each time series will appear in the graph using a combination of the expression label and the individual metric label. Specify the empty string (``''``) to suppress the expression label and only keep the metric label. You can use `dynamic labels <https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/graph-dynamic-labels.html>`_ to show summary information about the displayed time series in the legend. For example, if you use:: [max: ${MAX}] MyMetric As the metric label, the maximum value in the visible range will be shown next to the time series name in the graph's legend. If the search expression produces more than one time series, the maximum will be shown for each individual time series produce by this search expression. Default: - No label.
11585
+ :param period: The period over which the search expression's statistics are applied. This period overrides the period defined within the search expression. Default: Duration.minutes(5)
11586
+ :param search_account: Account to evaluate search expressions within. Default: - Deployment account.
11587
+ :param search_region: Region to evaluate search expressions within. Default: - Deployment region.
11588
+ :param expression: The search expression defining the metrics to be retrieved. A search expression cannot be used within an Alarm. A search expression allows you to retrieve and graph multiple related metrics in a single statement. It can return up to 500 time series. Examples: - ``SEARCH('{AWS/EC2,InstanceId} CPUUtilization', 'Average', 300)`` - ``SEARCH('{AWS/ApplicationELB,LoadBalancer} RequestCount', 'Sum', 60)`` - ``SEARCH('{MyNamespace,ServiceName} Errors', 'Sum')`` For more information about search expression syntax, see: https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/search-expression-syntax.html
11589
+
11590
+ :exampleMetadata: infused
11591
+
11592
+ Example::
11593
+
11594
+ cpu_utilization = cloudwatch.SearchExpression(
11595
+ expression="SEARCH('{AWS/EC2,InstanceId} MetricName=\"CPUUtilization\"', 'Average', 900)",
11596
+ label="EC2 CPU Utilization",
11597
+ color="#ff7f0e"
11598
+ )
11599
+ '''
11600
+ if __debug__:
11601
+ type_hints = typing.get_type_hints(_typecheckingstub__ea7b0e5733d6f08911d542fd96929aa00fb8c855f30bc6cce35d09d7e062f08e)
11602
+ check_type(argname="argument color", value=color, expected_type=type_hints["color"])
11603
+ check_type(argname="argument label", value=label, expected_type=type_hints["label"])
11604
+ check_type(argname="argument period", value=period, expected_type=type_hints["period"])
11605
+ check_type(argname="argument search_account", value=search_account, expected_type=type_hints["search_account"])
11606
+ check_type(argname="argument search_region", value=search_region, expected_type=type_hints["search_region"])
11607
+ check_type(argname="argument expression", value=expression, expected_type=type_hints["expression"])
11608
+ self._values: typing.Dict[builtins.str, typing.Any] = {
11609
+ "expression": expression,
11610
+ }
11611
+ if color is not None:
11612
+ self._values["color"] = color
11613
+ if label is not None:
11614
+ self._values["label"] = label
11615
+ if period is not None:
11616
+ self._values["period"] = period
11617
+ if search_account is not None:
11618
+ self._values["search_account"] = search_account
11619
+ if search_region is not None:
11620
+ self._values["search_region"] = search_region
11621
+
11622
+ @builtins.property
11623
+ def color(self) -> typing.Optional[builtins.str]:
11624
+ '''Color for the metric produced by the search expression.
11625
+
11626
+ If the search expression produces more than one time series, the color is assigned to the first one.
11627
+ Other metrics are assigned colors automatically.
11628
+
11629
+ :default: - Automatically assigned.
11630
+ '''
11631
+ result = self._values.get("color")
11632
+ return typing.cast(typing.Optional[builtins.str], result)
11633
+
11634
+ @builtins.property
11635
+ def label(self) -> typing.Optional[builtins.str]:
11636
+ '''Label for this search expression when added to a Graph in a Dashboard.
11637
+
11638
+ If this expression evaluates to more than one time series,
11639
+ each time series will appear in the graph using a combination of the
11640
+ expression label and the individual metric label. Specify the empty
11641
+ string (``''``) to suppress the expression label and only keep the
11642
+ metric label.
11643
+
11644
+ You can use `dynamic labels <https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/graph-dynamic-labels.html>`_
11645
+ to show summary information about the displayed time series
11646
+ in the legend. For example, if you use::
11647
+
11648
+ [max: ${MAX}] MyMetric
11649
+
11650
+ As the metric label, the maximum value in the visible range will
11651
+ be shown next to the time series name in the graph's legend. If the
11652
+ search expression produces more than one time series, the maximum
11653
+ will be shown for each individual time series produce by this
11654
+ search expression.
11655
+
11656
+ :default: - No label.
11657
+ '''
11658
+ result = self._values.get("label")
11659
+ return typing.cast(typing.Optional[builtins.str], result)
11660
+
11661
+ @builtins.property
11662
+ def period(self) -> typing.Optional[_Duration_4839e8c3]:
11663
+ '''The period over which the search expression's statistics are applied.
11664
+
11665
+ This period overrides the period defined within the search expression.
11666
+
11667
+ :default: Duration.minutes(5)
11668
+ '''
11669
+ result = self._values.get("period")
11670
+ return typing.cast(typing.Optional[_Duration_4839e8c3], result)
11671
+
11672
+ @builtins.property
11673
+ def search_account(self) -> typing.Optional[builtins.str]:
11674
+ '''Account to evaluate search expressions within.
11675
+
11676
+ :default: - Deployment account.
11677
+ '''
11678
+ result = self._values.get("search_account")
11679
+ return typing.cast(typing.Optional[builtins.str], result)
11680
+
11681
+ @builtins.property
11682
+ def search_region(self) -> typing.Optional[builtins.str]:
11683
+ '''Region to evaluate search expressions within.
11684
+
11685
+ :default: - Deployment region.
11686
+ '''
11687
+ result = self._values.get("search_region")
11688
+ return typing.cast(typing.Optional[builtins.str], result)
11689
+
11690
+ @builtins.property
11691
+ def expression(self) -> builtins.str:
11692
+ '''The search expression defining the metrics to be retrieved.
11693
+
11694
+ A search expression cannot be used within an Alarm.
11695
+
11696
+ A search expression allows you to retrieve and graph multiple related metrics in a single statement.
11697
+ It can return up to 500 time series.
11698
+
11699
+ Examples:
11700
+
11701
+ - ``SEARCH('{AWS/EC2,InstanceId} CPUUtilization', 'Average', 300)``
11702
+ - ``SEARCH('{AWS/ApplicationELB,LoadBalancer} RequestCount', 'Sum', 60)``
11703
+ - ``SEARCH('{MyNamespace,ServiceName} Errors', 'Sum')``
11704
+
11705
+ For more information about search expression syntax, see:
11706
+ https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/search-expression-syntax.html
11707
+ '''
11708
+ result = self._values.get("expression")
11709
+ assert result is not None, "Required property 'expression' is missing"
11710
+ return typing.cast(builtins.str, result)
11711
+
11712
+ def __eq__(self, rhs: typing.Any) -> builtins.bool:
11713
+ return isinstance(rhs, self.__class__) and rhs._values == self._values
11714
+
11715
+ def __ne__(self, rhs: typing.Any) -> builtins.bool:
11716
+ return not (rhs == self)
11717
+
11718
+ def __repr__(self) -> str:
11719
+ return "SearchExpressionProps(%s)" % ", ".join(
11720
+ k + "=" + repr(v) for k, v in self._values.items()
11721
+ )
11722
+
11723
+
11210
11724
  @jsii.enum(jsii_type="aws-cdk-lib.aws_cloudwatch.Shading")
11211
11725
  class Shading(enum.Enum):
11212
11726
  '''Fill shading options that will be used with a horizontal annotation.'''
@@ -13727,7 +14241,7 @@ class AnomalyDetectionMetricOptions(MathExpressionOptions):
13727
14241
 
13728
14242
  :param color: Color for this metric when added to a Graph in a Dashboard. Default: - Automatic color
13729
14243
  :param label: Label for this expression when added to a Graph in a Dashboard. If this expression evaluates to more than one time series (for example, through the use of ``METRICS()`` or ``SEARCH()`` expressions), each time series will appear in the graph using a combination of the expression label and the individual metric label. Specify the empty string (``''``) to suppress the expression label and only keep the metric label. You can use `dynamic labels <https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/graph-dynamic-labels.html>`_ to show summary information about the displayed time series in the legend. For example, if you use:: [max: ${MAX}] MyMetric As the metric label, the maximum value in the visible range will be shown next to the time series name in the graph's legend. If the math expression produces more than one time series, the maximum will be shown for each individual time series produce by this math expression. Default: - Expression value is used as label
13730
- :param period: The period over which the expression's statistics are applied. This period overrides all periods in the metrics used in this math expression. Default: Duration.minutes(5)
14244
+ :param period: The period over which the math expression's statistics are applied. This period overrides all periods in the metrics used in this math expression. Default: Duration.minutes(5)
13731
14245
  :param search_account: Account to evaluate search expressions within. Specifying a searchAccount has no effect to the account used for metrics within the expression (passed via usingMetrics). Default: - Deployment account.
13732
14246
  :param search_region: Region to evaluate search expressions within. Specifying a searchRegion has no effect to the region used for metrics within the expression (passed via usingMetrics). Default: - Deployment region.
13733
14247
  :param metric: The metric to add the alarm on. Metric objects can be obtained from most resources, or you can construct custom Metric objects by instantiating one.
@@ -13820,7 +14334,7 @@ class AnomalyDetectionMetricOptions(MathExpressionOptions):
13820
14334
 
13821
14335
  @builtins.property
13822
14336
  def period(self) -> typing.Optional[_Duration_4839e8c3]:
13823
- '''The period over which the expression's statistics are applied.
14337
+ '''The period over which the math expression's statistics are applied.
13824
14338
 
13825
14339
  This period overrides all periods in the metrics used in this
13826
14340
  math expression.
@@ -16308,6 +16822,9 @@ __all__ = [
16308
16822
  "PeriodOverride",
16309
16823
  "Row",
16310
16824
  "SearchComponents",
16825
+ "SearchExpression",
16826
+ "SearchExpressionOptions",
16827
+ "SearchExpressionProps",
16311
16828
  "Shading",
16312
16829
  "SingleValueWidget",
16313
16830
  "SingleValueWidgetProps",
@@ -17412,6 +17929,7 @@ def _typecheckingstub__2ddb584abe8421d7f77520aa621133794d500e179ff044f43970dac3f
17412
17929
  math_expression: typing.Optional[typing.Union[MetricExpressionConfig, typing.Dict[builtins.str, typing.Any]]] = None,
17413
17930
  metric_stat: typing.Optional[typing.Union[MetricStatConfig, typing.Dict[builtins.str, typing.Any]]] = None,
17414
17931
  rendering_properties: typing.Optional[typing.Mapping[builtins.str, typing.Any]] = None,
17932
+ search_expression: typing.Optional[typing.Union[MetricExpressionConfig, typing.Dict[builtins.str, typing.Any]]] = None,
17415
17933
  ) -> None:
17416
17934
  """Type checking stubs"""
17417
17935
  pass
@@ -17521,6 +18039,29 @@ def _typecheckingstub__834c69a269555056b1b73146ff2784af68174eb591f39133c58560704
17521
18039
  """Type checking stubs"""
17522
18040
  pass
17523
18041
 
18042
+ def _typecheckingstub__9f60f6548f685a7de97fff8e4e2d7ad81a4a32dbef7d990d9298e04900ccf74c(
18043
+ *,
18044
+ color: typing.Optional[builtins.str] = None,
18045
+ label: typing.Optional[builtins.str] = None,
18046
+ period: typing.Optional[_Duration_4839e8c3] = None,
18047
+ search_account: typing.Optional[builtins.str] = None,
18048
+ search_region: typing.Optional[builtins.str] = None,
18049
+ ) -> None:
18050
+ """Type checking stubs"""
18051
+ pass
18052
+
18053
+ def _typecheckingstub__ea7b0e5733d6f08911d542fd96929aa00fb8c855f30bc6cce35d09d7e062f08e(
18054
+ *,
18055
+ color: typing.Optional[builtins.str] = None,
18056
+ label: typing.Optional[builtins.str] = None,
18057
+ period: typing.Optional[_Duration_4839e8c3] = None,
18058
+ search_account: typing.Optional[builtins.str] = None,
18059
+ search_region: typing.Optional[builtins.str] = None,
18060
+ expression: builtins.str,
18061
+ ) -> None:
18062
+ """Type checking stubs"""
18063
+ pass
18064
+
17524
18065
  def _typecheckingstub__4596565f40195bdcc9fe939fa585a3bdf484f8a4a6817e427c6f9e1e49650041(
17525
18066
  *,
17526
18067
  account_id: typing.Optional[builtins.str] = None,