aws-cdk-lib 2.203.1__py3-none-any.whl → 2.205.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 (62) hide show
  1. aws_cdk/__init__.py +208 -92
  2. aws_cdk/_jsii/__init__.py +1 -1
  3. aws_cdk/_jsii/{aws-cdk-lib@2.203.1.jsii.tgz → aws-cdk-lib@2.205.0.jsii.tgz} +0 -0
  4. aws_cdk/aws_aiops/__init__.py +89 -39
  5. aws_cdk/aws_apigateway/__init__.py +164 -0
  6. aws_cdk/aws_apigatewayv2/__init__.py +412 -0
  7. aws_cdk/aws_applicationautoscaling/__init__.py +2 -2
  8. aws_cdk/aws_arczonalshift/__init__.py +4 -1
  9. aws_cdk/aws_b2bi/__init__.py +32 -16
  10. aws_cdk/aws_bedrock/__init__.py +198 -10
  11. aws_cdk/aws_cassandra/__init__.py +156 -0
  12. aws_cdk/aws_certificatemanager/__init__.py +28 -0
  13. aws_cdk/aws_chatbot/__init__.py +28 -0
  14. aws_cdk/aws_cloudformation/__init__.py +74 -72
  15. aws_cdk/aws_cloudfront/__init__.py +1273 -485
  16. aws_cdk/aws_cloudfront/experimental/__init__.py +32 -0
  17. aws_cdk/aws_cloudfront_origins/__init__.py +26 -21
  18. aws_cdk/aws_cloudwatch/__init__.py +278 -23
  19. aws_cdk/aws_codebuild/__init__.py +300 -36
  20. aws_cdk/aws_datasync/__init__.py +2 -2
  21. aws_cdk/aws_docdb/__init__.py +78 -0
  22. aws_cdk/aws_dynamodb/__init__.py +523 -37
  23. aws_cdk/aws_ec2/__init__.py +126 -30
  24. aws_cdk/aws_ecs/__init__.py +64 -19
  25. aws_cdk/aws_elasticloadbalancingv2/__init__.py +724 -0
  26. aws_cdk/aws_elasticsearch/__init__.py +260 -0
  27. aws_cdk/aws_emrserverless/__init__.py +5 -5
  28. aws_cdk/aws_events/__init__.py +58 -3
  29. aws_cdk/aws_events_targets/__init__.py +7 -2
  30. aws_cdk/aws_evs/__init__.py +7 -7
  31. aws_cdk/aws_fsx/__init__.py +138 -78
  32. aws_cdk/aws_gamelift/__init__.py +19 -0
  33. aws_cdk/aws_glue/__init__.py +3 -3
  34. aws_cdk/aws_iot/__init__.py +1 -1
  35. aws_cdk/aws_kinesis/__init__.py +391 -13
  36. aws_cdk/aws_kinesisfirehose/__init__.py +128 -1
  37. aws_cdk/aws_lambda/__init__.py +144 -0
  38. aws_cdk/aws_lex/__init__.py +36 -19
  39. aws_cdk/aws_logs/__init__.py +58 -0
  40. aws_cdk/aws_neptune/__init__.py +12 -12
  41. aws_cdk/aws_odb/__init__.py +4049 -0
  42. aws_cdk/aws_omics/__init__.py +1 -1
  43. aws_cdk/aws_opensearchservice/__init__.py +260 -0
  44. aws_cdk/aws_qbusiness/__init__.py +471 -4
  45. aws_cdk/aws_quicksight/__init__.py +185 -16
  46. aws_cdk/aws_rds/__init__.py +553 -17
  47. aws_cdk/aws_redshiftserverless/__init__.py +72 -45
  48. aws_cdk/aws_route53/__init__.py +41 -19
  49. aws_cdk/aws_s3tables/__init__.py +1005 -0
  50. aws_cdk/aws_sagemaker/__init__.py +20 -0
  51. aws_cdk/aws_scheduler/__init__.py +210 -0
  52. aws_cdk/aws_sns/__init__.py +164 -0
  53. aws_cdk/aws_sqs/__init__.py +164 -0
  54. aws_cdk/aws_stepfunctions/__init__.py +288 -0
  55. aws_cdk/aws_synthetics/__init__.py +159 -37
  56. aws_cdk/aws_transfer/__init__.py +23 -1
  57. {aws_cdk_lib-2.203.1.dist-info → aws_cdk_lib-2.205.0.dist-info}/METADATA +2 -2
  58. {aws_cdk_lib-2.203.1.dist-info → aws_cdk_lib-2.205.0.dist-info}/RECORD +62 -61
  59. {aws_cdk_lib-2.203.1.dist-info → aws_cdk_lib-2.205.0.dist-info}/LICENSE +0 -0
  60. {aws_cdk_lib-2.203.1.dist-info → aws_cdk_lib-2.205.0.dist-info}/NOTICE +0 -0
  61. {aws_cdk_lib-2.203.1.dist-info → aws_cdk_lib-2.205.0.dist-info}/WHEEL +0 -0
  62. {aws_cdk_lib-2.203.1.dist-info → aws_cdk_lib-2.205.0.dist-info}/top_level.txt +0 -0
@@ -54,6 +54,41 @@ metric = cloudwatch.Metric(
54
54
  )
55
55
  ```
56
56
 
57
+ ### Metric ID
58
+
59
+ Metrics can be assigned a unique identifier using the `id` property. This is
60
+ useful when referencing metrics in math expressions:
61
+
62
+ ```python
63
+ metric = cloudwatch.Metric(
64
+ namespace="AWS/Lambda",
65
+ metric_name="Invocations",
66
+ dimensions_map={
67
+ "FunctionName": "MyFunction"
68
+ },
69
+ id="invocations"
70
+ )
71
+ ```
72
+
73
+ The `id` must start with a lowercase letter and can only contain letters, numbers, and underscores.
74
+
75
+ ### Metric Visible
76
+
77
+ Metrics can be hidden from dashboard graphs using the `visible` property:
78
+
79
+ ```python
80
+ # fn: lambda.Function
81
+
82
+
83
+ metric = fn.metric_errors(
84
+ visible=False
85
+ )
86
+ ```
87
+
88
+ By default, all metrics are visible (`visible: true`). Setting `visible: false`
89
+ hides the metric from dashboard visualizations while still allowing it to be
90
+ used in math expressions given that it has an `id` set to it.
91
+
57
92
  ### Metric Math
58
93
 
59
94
  Math expressions are supported by instantiating the `MathExpression` class.
@@ -89,6 +124,32 @@ problem_percentage = cloudwatch.MathExpression(
89
124
  )
90
125
  ```
91
126
 
127
+ ### Metric ID Usage in Math Expressions
128
+
129
+ When metrics have custom IDs, you can reference them directly in math expressions.
130
+
131
+ ```python
132
+ # fn: lambda.Function
133
+
134
+
135
+ invocations = fn.metric_invocations(
136
+ id="lambda_invocations"
137
+ )
138
+
139
+ errors = fn.metric_errors(
140
+ id="lambda_errors"
141
+ )
142
+ ```
143
+
144
+ When metrics have predefined IDs, they can be referenced directly in math expressions by their ID without requiring the `usingMetrics` property.
145
+
146
+ ```python
147
+ error_rate = cloudwatch.MathExpression(
148
+ expression="lambda_errors / lambda_invocations * 100",
149
+ label="Error Rate (%)"
150
+ )
151
+ ```
152
+
92
153
  ### Search Expressions
93
154
 
94
155
  Math expressions also support search expressions. For example, the following
@@ -811,6 +872,20 @@ dashboard.add_widgets(cloudwatch.LogQueryWidget(
811
872
  ))
812
873
  ```
813
874
 
875
+ Log Insights QL is the default query language. You may specify an [alternate query language: OpenSearch PPL or SQL](https://aws.amazon.com/blogs/aws/new-amazon-cloudwatch-and-amazon-opensearch-service-launch-an-integrated-analytics-experience/), if desired:
876
+
877
+ ```python
878
+ # dashboard: cloudwatch.Dashboard
879
+
880
+
881
+ dashboard.add_widgets(cloudwatch.LogQueryWidget(
882
+ log_group_names=["my-log-group"],
883
+ view=cloudwatch.LogQueryVisualizationType.TABLE,
884
+ query_string="SELECT count(*) as count FROM 'my-log-group'",
885
+ query_language=cloudwatch.LogQueryLanguage.SQL
886
+ ))
887
+ ```
888
+
814
889
  ### Custom widget
815
890
 
816
891
  A `CustomWidget` shows the result of an AWS Lambda function:
@@ -6694,6 +6769,7 @@ class Color(metaclass=jsii.JSIIMeta, jsii_type="aws-cdk-lib.aws_cloudwatch.Color
6694
6769
  "account": "account",
6695
6770
  "color": "color",
6696
6771
  "dimensions_map": "dimensionsMap",
6772
+ "id": "id",
6697
6773
  "label": "label",
6698
6774
  "period": "period",
6699
6775
  "region": "region",
@@ -6701,6 +6777,7 @@ class Color(metaclass=jsii.JSIIMeta, jsii_type="aws-cdk-lib.aws_cloudwatch.Color
6701
6777
  "stack_region": "stackRegion",
6702
6778
  "statistic": "statistic",
6703
6779
  "unit": "unit",
6780
+ "visible": "visible",
6704
6781
  },
6705
6782
  )
6706
6783
  class CommonMetricOptions:
@@ -6710,6 +6787,7 @@ class CommonMetricOptions:
6710
6787
  account: typing.Optional[builtins.str] = None,
6711
6788
  color: typing.Optional[builtins.str] = None,
6712
6789
  dimensions_map: typing.Optional[typing.Mapping[builtins.str, builtins.str]] = None,
6790
+ id: typing.Optional[builtins.str] = None,
6713
6791
  label: typing.Optional[builtins.str] = None,
6714
6792
  period: typing.Optional[_Duration_4839e8c3] = None,
6715
6793
  region: typing.Optional[builtins.str] = None,
@@ -6717,12 +6795,14 @@ class CommonMetricOptions:
6717
6795
  stack_region: typing.Optional[builtins.str] = None,
6718
6796
  statistic: typing.Optional[builtins.str] = None,
6719
6797
  unit: typing.Optional["Unit"] = None,
6798
+ visible: typing.Optional[builtins.bool] = None,
6720
6799
  ) -> None:
6721
6800
  '''Options shared by most methods accepting metric options.
6722
6801
 
6723
6802
  :param account: Account which this metric comes from. Default: - Deployment account.
6724
6803
  :param color: The hex color code, prefixed with '#' (e.g. '#00ff00'), to use when this metric is rendered on a graph. The ``Color`` class has a set of standard colors that can be used here. Default: - Automatic color
6725
6804
  :param dimensions_map: Dimensions of the metric. Default: - No dimensions.
6805
+ :param id: Unique identifier for this metric when used in dashboard widgets. The id can be used as a variable to represent this metric in math expressions. Valid characters are letters, numbers, and underscore. The first character must be a lowercase letter. Default: - No ID
6726
6806
  :param label: Label for this metric when added to a Graph in a Dashboard. You can use `dynamic labels <https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/graph-dynamic-labels.html>`_ to show summary information about the entire 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. Default: - No label
6727
6807
  :param period: The period over which the specified statistic is applied. Default: Duration.minutes(5)
6728
6808
  :param region: Region which this metric comes from. Default: - Deployment region.
@@ -6730,6 +6810,7 @@ class CommonMetricOptions:
6730
6810
  :param stack_region: Region of the stack this metric is attached to. Default: - Deployment region.
6731
6811
  :param statistic: What function to use for aggregating. Use the ``aws_cloudwatch.Stats`` helper class to construct valid input strings. Can be one of the following: - "Minimum" | "min" - "Maximum" | "max" - "Average" | "avg" - "Sum" | "sum" - "SampleCount | "n" - "pNN.NN" - "tmNN.NN" | "tm(NN.NN%:NN.NN%)" - "iqm" - "wmNN.NN" | "wm(NN.NN%:NN.NN%)" - "tcNN.NN" | "tc(NN.NN%:NN.NN%)" - "tsNN.NN" | "ts(NN.NN%:NN.NN%)" Default: Average
6732
6812
  :param unit: Unit used to filter the metric stream. Only refer to datums emitted to the metric stream with the given unit and ignore all others. Only useful when datums are being emitted to the same metric stream under different units. The default is to use all matric datums in the stream, regardless of unit, which is recommended in nearly all cases. CloudWatch does not honor this property for graphs. Default: - All metric datums in the given metric stream
6813
+ :param visible: Whether this metric should be visible in dashboard graphs. Setting this to false is useful when you want to hide raw metrics that are used in math expressions, and show only the expression results. Default: true
6733
6814
 
6734
6815
  :exampleMetadata: fixture=_generated
6735
6816
 
@@ -6746,13 +6827,15 @@ class CommonMetricOptions:
6746
6827
  dimensions_map={
6747
6828
  "dimensions_map_key": "dimensionsMap"
6748
6829
  },
6830
+ id="id",
6749
6831
  label="label",
6750
6832
  period=cdk.Duration.minutes(30),
6751
6833
  region="region",
6752
6834
  stack_account="stackAccount",
6753
6835
  stack_region="stackRegion",
6754
6836
  statistic="statistic",
6755
- unit=cloudwatch.Unit.SECONDS
6837
+ unit=cloudwatch.Unit.SECONDS,
6838
+ visible=False
6756
6839
  )
6757
6840
  '''
6758
6841
  if __debug__:
@@ -6760,6 +6843,7 @@ class CommonMetricOptions:
6760
6843
  check_type(argname="argument account", value=account, expected_type=type_hints["account"])
6761
6844
  check_type(argname="argument color", value=color, expected_type=type_hints["color"])
6762
6845
  check_type(argname="argument dimensions_map", value=dimensions_map, expected_type=type_hints["dimensions_map"])
6846
+ check_type(argname="argument id", value=id, expected_type=type_hints["id"])
6763
6847
  check_type(argname="argument label", value=label, expected_type=type_hints["label"])
6764
6848
  check_type(argname="argument period", value=period, expected_type=type_hints["period"])
6765
6849
  check_type(argname="argument region", value=region, expected_type=type_hints["region"])
@@ -6767,6 +6851,7 @@ class CommonMetricOptions:
6767
6851
  check_type(argname="argument stack_region", value=stack_region, expected_type=type_hints["stack_region"])
6768
6852
  check_type(argname="argument statistic", value=statistic, expected_type=type_hints["statistic"])
6769
6853
  check_type(argname="argument unit", value=unit, expected_type=type_hints["unit"])
6854
+ check_type(argname="argument visible", value=visible, expected_type=type_hints["visible"])
6770
6855
  self._values: typing.Dict[builtins.str, typing.Any] = {}
6771
6856
  if account is not None:
6772
6857
  self._values["account"] = account
@@ -6774,6 +6859,8 @@ class CommonMetricOptions:
6774
6859
  self._values["color"] = color
6775
6860
  if dimensions_map is not None:
6776
6861
  self._values["dimensions_map"] = dimensions_map
6862
+ if id is not None:
6863
+ self._values["id"] = id
6777
6864
  if label is not None:
6778
6865
  self._values["label"] = label
6779
6866
  if period is not None:
@@ -6788,6 +6875,8 @@ class CommonMetricOptions:
6788
6875
  self._values["statistic"] = statistic
6789
6876
  if unit is not None:
6790
6877
  self._values["unit"] = unit
6878
+ if visible is not None:
6879
+ self._values["visible"] = visible
6791
6880
 
6792
6881
  @builtins.property
6793
6882
  def account(self) -> typing.Optional[builtins.str]:
@@ -6818,6 +6907,19 @@ class CommonMetricOptions:
6818
6907
  result = self._values.get("dimensions_map")
6819
6908
  return typing.cast(typing.Optional[typing.Mapping[builtins.str, builtins.str]], result)
6820
6909
 
6910
+ @builtins.property
6911
+ def id(self) -> typing.Optional[builtins.str]:
6912
+ '''Unique identifier for this metric when used in dashboard widgets.
6913
+
6914
+ The id can be used as a variable to represent this metric in math expressions.
6915
+ Valid characters are letters, numbers, and underscore. The first character
6916
+ must be a lowercase letter.
6917
+
6918
+ :default: - No ID
6919
+ '''
6920
+ result = self._values.get("id")
6921
+ return typing.cast(typing.Optional[builtins.str], result)
6922
+
6821
6923
  @builtins.property
6822
6924
  def label(self) -> typing.Optional[builtins.str]:
6823
6925
  '''Label for this metric when added to a Graph in a Dashboard.
@@ -6915,6 +7017,18 @@ class CommonMetricOptions:
6915
7017
  result = self._values.get("unit")
6916
7018
  return typing.cast(typing.Optional["Unit"], result)
6917
7019
 
7020
+ @builtins.property
7021
+ def visible(self) -> typing.Optional[builtins.bool]:
7022
+ '''Whether this metric should be visible in dashboard graphs.
7023
+
7024
+ Setting this to false is useful when you want to hide raw metrics
7025
+ that are used in math expressions, and show only the expression results.
7026
+
7027
+ :default: true
7028
+ '''
7029
+ result = self._values.get("visible")
7030
+ return typing.cast(typing.Optional[builtins.bool], result)
7031
+
6918
7032
  def __eq__(self, rhs: typing.Any) -> builtins.bool:
6919
7033
  return isinstance(rhs, self.__class__) and rhs._values == self._values
6920
7034
 
@@ -8524,6 +8638,33 @@ class LegendPosition(enum.Enum):
8524
8638
  '''Add shading below the annotation.'''
8525
8639
 
8526
8640
 
8641
+ @jsii.enum(jsii_type="aws-cdk-lib.aws_cloudwatch.LogQueryLanguage")
8642
+ class LogQueryLanguage(enum.Enum):
8643
+ '''Logs Query Language.
8644
+
8645
+ :exampleMetadata: infused
8646
+
8647
+ Example::
8648
+
8649
+ # dashboard: cloudwatch.Dashboard
8650
+
8651
+
8652
+ dashboard.add_widgets(cloudwatch.LogQueryWidget(
8653
+ log_group_names=["my-log-group"],
8654
+ view=cloudwatch.LogQueryVisualizationType.TABLE,
8655
+ query_string="SELECT count(*) as count FROM 'my-log-group'",
8656
+ query_language=cloudwatch.LogQueryLanguage.SQL
8657
+ ))
8658
+ '''
8659
+
8660
+ LOGS_INSIGHTS = "LOGS_INSIGHTS"
8661
+ '''Logs Insights QL.'''
8662
+ SQL = "SQL"
8663
+ '''OpenSearch SQL.'''
8664
+ PPL = "PPL"
8665
+ '''OpenSearch PPL.'''
8666
+
8667
+
8527
8668
  @jsii.enum(jsii_type="aws-cdk-lib.aws_cloudwatch.LogQueryVisualizationType")
8528
8669
  class LogQueryVisualizationType(enum.Enum):
8529
8670
  '''Types of view.
@@ -8563,6 +8704,7 @@ class LogQueryVisualizationType(enum.Enum):
8563
8704
  "log_group_names": "logGroupNames",
8564
8705
  "account_id": "accountId",
8565
8706
  "height": "height",
8707
+ "query_language": "queryLanguage",
8566
8708
  "query_lines": "queryLines",
8567
8709
  "query_string": "queryString",
8568
8710
  "region": "region",
@@ -8578,6 +8720,7 @@ class LogQueryWidgetProps:
8578
8720
  log_group_names: typing.Sequence[builtins.str],
8579
8721
  account_id: typing.Optional[builtins.str] = None,
8580
8722
  height: typing.Optional[jsii.Number] = None,
8723
+ query_language: typing.Optional[LogQueryLanguage] = None,
8581
8724
  query_lines: typing.Optional[typing.Sequence[builtins.str]] = None,
8582
8725
  query_string: typing.Optional[builtins.str] = None,
8583
8726
  region: typing.Optional[builtins.str] = None,
@@ -8590,6 +8733,7 @@ class LogQueryWidgetProps:
8590
8733
  :param log_group_names: Names of log groups to query.
8591
8734
  :param account_id: The AWS account ID where the log groups are located. This enables cross-account functionality for CloudWatch dashboards. Before using this feature, ensure that proper cross-account sharing is configured between the monitoring account and source account. For more information, see: https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/CloudWatch-Unified-Cross-Account.html Default: - Current account
8592
8735
  :param height: Height of the widget. Default: 6
8736
+ :param query_language: The query language to use for the query. Default: LogQueryLanguage.LOGS_INSIGHTS
8593
8737
  :param query_lines: A sequence of lines to use to build the query. The query will be built by joining the lines together using ``\\n|``. Default: - Exactly one of ``queryString``, ``queryLines`` is required.
8594
8738
  :param query_string: Full query string for log insights. Be sure to prepend every new line with a newline and pipe character (``\\n|``). Default: - Exactly one of ``queryString``, ``queryLines`` is required.
8595
8739
  :param region: The region the metrics of this widget should be taken from. Default: Current region
@@ -8617,6 +8761,7 @@ class LogQueryWidgetProps:
8617
8761
  check_type(argname="argument log_group_names", value=log_group_names, expected_type=type_hints["log_group_names"])
8618
8762
  check_type(argname="argument account_id", value=account_id, expected_type=type_hints["account_id"])
8619
8763
  check_type(argname="argument height", value=height, expected_type=type_hints["height"])
8764
+ check_type(argname="argument query_language", value=query_language, expected_type=type_hints["query_language"])
8620
8765
  check_type(argname="argument query_lines", value=query_lines, expected_type=type_hints["query_lines"])
8621
8766
  check_type(argname="argument query_string", value=query_string, expected_type=type_hints["query_string"])
8622
8767
  check_type(argname="argument region", value=region, expected_type=type_hints["region"])
@@ -8630,6 +8775,8 @@ class LogQueryWidgetProps:
8630
8775
  self._values["account_id"] = account_id
8631
8776
  if height is not None:
8632
8777
  self._values["height"] = height
8778
+ if query_language is not None:
8779
+ self._values["query_language"] = query_language
8633
8780
  if query_lines is not None:
8634
8781
  self._values["query_lines"] = query_lines
8635
8782
  if query_string is not None:
@@ -8675,6 +8822,15 @@ class LogQueryWidgetProps:
8675
8822
  result = self._values.get("height")
8676
8823
  return typing.cast(typing.Optional[jsii.Number], result)
8677
8824
 
8825
+ @builtins.property
8826
+ def query_language(self) -> typing.Optional[LogQueryLanguage]:
8827
+ '''The query language to use for the query.
8828
+
8829
+ :default: LogQueryLanguage.LOGS_INSIGHTS
8830
+ '''
8831
+ result = self._values.get("query_language")
8832
+ return typing.cast(typing.Optional[LogQueryLanguage], result)
8833
+
8678
8834
  @builtins.property
8679
8835
  def query_lines(self) -> typing.Optional[typing.List[builtins.str]]:
8680
8836
  '''A sequence of lines to use to build the query.
@@ -8770,21 +8926,16 @@ class MathExpression(
8770
8926
 
8771
8927
  Example::
8772
8928
 
8773
- # matchmaking_rule_set: gamelift.MatchmakingRuleSet
8929
+ # fn: lambda.Function
8774
8930
 
8775
- # Alarm that triggers when the per-second average of not placed matches exceed 10%
8776
- rule_evaluation_ratio = cloudwatch.MathExpression(
8777
- expression="1 - (ruleEvaluationsPassed / ruleEvaluationsFailed)",
8931
+
8932
+ all_problems = cloudwatch.MathExpression(
8933
+ expression="errors + throttles",
8778
8934
  using_metrics={
8779
- "rule_evaluations_passed": matchmaking_rule_set.metric_rule_evaluations_passed(statistic=cloudwatch.Statistic.SUM),
8780
- "rule_evaluations_failed": matchmaking_rule_set.metric("ruleEvaluationsFailed")
8935
+ "errors": fn.metric_errors(),
8936
+ "throttles": fn.metric_throttles()
8781
8937
  }
8782
8938
  )
8783
- cloudwatch.Alarm(self, "Alarm",
8784
- metric=rule_evaluation_ratio,
8785
- threshold=0.1,
8786
- evaluation_periods=3
8787
- )
8788
8939
  '''
8789
8940
 
8790
8941
  def __init__(
@@ -9161,21 +9312,16 @@ class MathExpressionProps(MathExpressionOptions):
9161
9312
 
9162
9313
  Example::
9163
9314
 
9164
- # matchmaking_rule_set: gamelift.MatchmakingRuleSet
9315
+ # fn: lambda.Function
9316
+
9165
9317
 
9166
- # Alarm that triggers when the per-second average of not placed matches exceed 10%
9167
- rule_evaluation_ratio = cloudwatch.MathExpression(
9168
- expression="1 - (ruleEvaluationsPassed / ruleEvaluationsFailed)",
9318
+ all_problems = cloudwatch.MathExpression(
9319
+ expression="errors + throttles",
9169
9320
  using_metrics={
9170
- "rule_evaluations_passed": matchmaking_rule_set.metric_rule_evaluations_passed(statistic=cloudwatch.Statistic.SUM),
9171
- "rule_evaluations_failed": matchmaking_rule_set.metric("ruleEvaluationsFailed")
9321
+ "errors": fn.metric_errors(),
9322
+ "throttles": fn.metric_throttles()
9172
9323
  }
9173
9324
  )
9174
- cloudwatch.Alarm(self, "Alarm",
9175
- metric=rule_evaluation_ratio,
9176
- threshold=0.1,
9177
- evaluation_periods=3
9178
- )
9179
9325
  '''
9180
9326
  if __debug__:
9181
9327
  type_hints = typing.get_type_hints(_typecheckingstub__7cfb588e44acd0977aa0e09f00c3e2435bad84385ab7b6d163b332963d844e0a)
@@ -9385,6 +9531,7 @@ class Metric(metaclass=jsii.JSIIMeta, jsii_type="aws-cdk-lib.aws_cloudwatch.Metr
9385
9531
  account: typing.Optional[builtins.str] = None,
9386
9532
  color: typing.Optional[builtins.str] = None,
9387
9533
  dimensions_map: typing.Optional[typing.Mapping[builtins.str, builtins.str]] = None,
9534
+ id: typing.Optional[builtins.str] = None,
9388
9535
  label: typing.Optional[builtins.str] = None,
9389
9536
  period: typing.Optional[_Duration_4839e8c3] = None,
9390
9537
  region: typing.Optional[builtins.str] = None,
@@ -9392,6 +9539,7 @@ class Metric(metaclass=jsii.JSIIMeta, jsii_type="aws-cdk-lib.aws_cloudwatch.Metr
9392
9539
  stack_region: typing.Optional[builtins.str] = None,
9393
9540
  statistic: typing.Optional[builtins.str] = None,
9394
9541
  unit: typing.Optional["Unit"] = None,
9542
+ visible: typing.Optional[builtins.bool] = None,
9395
9543
  ) -> None:
9396
9544
  '''
9397
9545
  :param metric_name: Name of the metric.
@@ -9399,6 +9547,7 @@ class Metric(metaclass=jsii.JSIIMeta, jsii_type="aws-cdk-lib.aws_cloudwatch.Metr
9399
9547
  :param account: Account which this metric comes from. Default: - Deployment account.
9400
9548
  :param color: The hex color code, prefixed with '#' (e.g. '#00ff00'), to use when this metric is rendered on a graph. The ``Color`` class has a set of standard colors that can be used here. Default: - Automatic color
9401
9549
  :param dimensions_map: Dimensions of the metric. Default: - No dimensions.
9550
+ :param id: Unique identifier for this metric when used in dashboard widgets. The id can be used as a variable to represent this metric in math expressions. Valid characters are letters, numbers, and underscore. The first character must be a lowercase letter. Default: - No ID
9402
9551
  :param label: Label for this metric when added to a Graph in a Dashboard. You can use `dynamic labels <https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/graph-dynamic-labels.html>`_ to show summary information about the entire 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. Default: - No label
9403
9552
  :param period: The period over which the specified statistic is applied. Default: Duration.minutes(5)
9404
9553
  :param region: Region which this metric comes from. Default: - Deployment region.
@@ -9406,6 +9555,7 @@ class Metric(metaclass=jsii.JSIIMeta, jsii_type="aws-cdk-lib.aws_cloudwatch.Metr
9406
9555
  :param stack_region: Region of the stack this metric is attached to. Default: - Deployment region.
9407
9556
  :param statistic: What function to use for aggregating. Use the ``aws_cloudwatch.Stats`` helper class to construct valid input strings. Can be one of the following: - "Minimum" | "min" - "Maximum" | "max" - "Average" | "avg" - "Sum" | "sum" - "SampleCount | "n" - "pNN.NN" - "tmNN.NN" | "tm(NN.NN%:NN.NN%)" - "iqm" - "wmNN.NN" | "wm(NN.NN%:NN.NN%)" - "tcNN.NN" | "tc(NN.NN%:NN.NN%)" - "tsNN.NN" | "ts(NN.NN%:NN.NN%)" Default: Average
9408
9557
  :param unit: Unit used to filter the metric stream. Only refer to datums emitted to the metric stream with the given unit and ignore all others. Only useful when datums are being emitted to the same metric stream under different units. The default is to use all matric datums in the stream, regardless of unit, which is recommended in nearly all cases. CloudWatch does not honor this property for graphs. Default: - All metric datums in the given metric stream
9558
+ :param visible: Whether this metric should be visible in dashboard graphs. Setting this to false is useful when you want to hide raw metrics that are used in math expressions, and show only the expression results. Default: true
9409
9559
  '''
9410
9560
  props = MetricProps(
9411
9561
  metric_name=metric_name,
@@ -9413,6 +9563,7 @@ class Metric(metaclass=jsii.JSIIMeta, jsii_type="aws-cdk-lib.aws_cloudwatch.Metr
9413
9563
  account=account,
9414
9564
  color=color,
9415
9565
  dimensions_map=dimensions_map,
9566
+ id=id,
9416
9567
  label=label,
9417
9568
  period=period,
9418
9569
  region=region,
@@ -9420,6 +9571,7 @@ class Metric(metaclass=jsii.JSIIMeta, jsii_type="aws-cdk-lib.aws_cloudwatch.Metr
9420
9571
  stack_region=stack_region,
9421
9572
  statistic=statistic,
9422
9573
  unit=unit,
9574
+ visible=visible,
9423
9575
  )
9424
9576
 
9425
9577
  jsii.create(self.__class__, self, [props])
@@ -9561,6 +9713,7 @@ class Metric(metaclass=jsii.JSIIMeta, jsii_type="aws-cdk-lib.aws_cloudwatch.Metr
9561
9713
  account: typing.Optional[builtins.str] = None,
9562
9714
  color: typing.Optional[builtins.str] = None,
9563
9715
  dimensions_map: typing.Optional[typing.Mapping[builtins.str, builtins.str]] = None,
9716
+ id: typing.Optional[builtins.str] = None,
9564
9717
  label: typing.Optional[builtins.str] = None,
9565
9718
  period: typing.Optional[_Duration_4839e8c3] = None,
9566
9719
  region: typing.Optional[builtins.str] = None,
@@ -9568,6 +9721,7 @@ class Metric(metaclass=jsii.JSIIMeta, jsii_type="aws-cdk-lib.aws_cloudwatch.Metr
9568
9721
  stack_region: typing.Optional[builtins.str] = None,
9569
9722
  statistic: typing.Optional[builtins.str] = None,
9570
9723
  unit: typing.Optional["Unit"] = None,
9724
+ visible: typing.Optional[builtins.bool] = None,
9571
9725
  ) -> "Metric":
9572
9726
  '''Return a copy of Metric ``with`` properties changed.
9573
9727
 
@@ -9576,6 +9730,7 @@ class Metric(metaclass=jsii.JSIIMeta, jsii_type="aws-cdk-lib.aws_cloudwatch.Metr
9576
9730
  :param account: Account which this metric comes from. Default: - Deployment account.
9577
9731
  :param color: The hex color code, prefixed with '#' (e.g. '#00ff00'), to use when this metric is rendered on a graph. The ``Color`` class has a set of standard colors that can be used here. Default: - Automatic color
9578
9732
  :param dimensions_map: Dimensions of the metric. Default: - No dimensions.
9733
+ :param id: Unique identifier for this metric when used in dashboard widgets. The id can be used as a variable to represent this metric in math expressions. Valid characters are letters, numbers, and underscore. The first character must be a lowercase letter. Default: - No ID
9579
9734
  :param label: Label for this metric when added to a Graph in a Dashboard. You can use `dynamic labels <https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/graph-dynamic-labels.html>`_ to show summary information about the entire 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. Default: - No label
9580
9735
  :param period: The period over which the specified statistic is applied. Default: Duration.minutes(5)
9581
9736
  :param region: Region which this metric comes from. Default: - Deployment region.
@@ -9583,11 +9738,13 @@ class Metric(metaclass=jsii.JSIIMeta, jsii_type="aws-cdk-lib.aws_cloudwatch.Metr
9583
9738
  :param stack_region: Region of the stack this metric is attached to. Default: - Deployment region.
9584
9739
  :param statistic: What function to use for aggregating. Use the ``aws_cloudwatch.Stats`` helper class to construct valid input strings. Can be one of the following: - "Minimum" | "min" - "Maximum" | "max" - "Average" | "avg" - "Sum" | "sum" - "SampleCount | "n" - "pNN.NN" - "tmNN.NN" | "tm(NN.NN%:NN.NN%)" - "iqm" - "wmNN.NN" | "wm(NN.NN%:NN.NN%)" - "tcNN.NN" | "tc(NN.NN%:NN.NN%)" - "tsNN.NN" | "ts(NN.NN%:NN.NN%)" Default: Average
9585
9740
  :param unit: Unit used to filter the metric stream. Only refer to datums emitted to the metric stream with the given unit and ignore all others. Only useful when datums are being emitted to the same metric stream under different units. The default is to use all matric datums in the stream, regardless of unit, which is recommended in nearly all cases. CloudWatch does not honor this property for graphs. Default: - All metric datums in the given metric stream
9741
+ :param visible: Whether this metric should be visible in dashboard graphs. Setting this to false is useful when you want to hide raw metrics that are used in math expressions, and show only the expression results. Default: true
9586
9742
  '''
9587
9743
  props = MetricOptions(
9588
9744
  account=account,
9589
9745
  color=color,
9590
9746
  dimensions_map=dimensions_map,
9747
+ id=id,
9591
9748
  label=label,
9592
9749
  period=period,
9593
9750
  region=region,
@@ -9595,6 +9752,7 @@ class Metric(metaclass=jsii.JSIIMeta, jsii_type="aws-cdk-lib.aws_cloudwatch.Metr
9595
9752
  stack_region=stack_region,
9596
9753
  statistic=statistic,
9597
9754
  unit=unit,
9755
+ visible=visible,
9598
9756
  )
9599
9757
 
9600
9758
  return typing.cast("Metric", jsii.invoke(self, "with", [props]))
@@ -9641,6 +9799,12 @@ class Metric(metaclass=jsii.JSIIMeta, jsii_type="aws-cdk-lib.aws_cloudwatch.Metr
9641
9799
  '''Dimensions of this metric.'''
9642
9800
  return typing.cast(typing.Optional[typing.Mapping[builtins.str, typing.Any]], jsii.get(self, "dimensions"))
9643
9801
 
9802
+ @builtins.property
9803
+ @jsii.member(jsii_name="id")
9804
+ def id(self) -> typing.Optional[builtins.str]:
9805
+ '''Unique identifier for this metric when used in dashboard widgets.'''
9806
+ return typing.cast(typing.Optional[builtins.str], jsii.get(self, "id"))
9807
+
9644
9808
  @builtins.property
9645
9809
  @jsii.member(jsii_name="label")
9646
9810
  def label(self) -> typing.Optional[builtins.str]:
@@ -9659,6 +9823,12 @@ class Metric(metaclass=jsii.JSIIMeta, jsii_type="aws-cdk-lib.aws_cloudwatch.Metr
9659
9823
  '''Unit of the metric.'''
9660
9824
  return typing.cast(typing.Optional["Unit"], jsii.get(self, "unit"))
9661
9825
 
9826
+ @builtins.property
9827
+ @jsii.member(jsii_name="visible")
9828
+ def visible(self) -> typing.Optional[builtins.bool]:
9829
+ '''Whether this metric should be visible in dashboard graphs.'''
9830
+ return typing.cast(typing.Optional[builtins.bool], jsii.get(self, "visible"))
9831
+
9662
9832
  @builtins.property
9663
9833
  @jsii.member(jsii_name="warnings")
9664
9834
  def warnings(self) -> typing.Optional[typing.List[builtins.str]]:
@@ -9936,6 +10106,7 @@ class MetricExpressionConfig:
9936
10106
  "account": "account",
9937
10107
  "color": "color",
9938
10108
  "dimensions_map": "dimensionsMap",
10109
+ "id": "id",
9939
10110
  "label": "label",
9940
10111
  "period": "period",
9941
10112
  "region": "region",
@@ -9943,6 +10114,7 @@ class MetricExpressionConfig:
9943
10114
  "stack_region": "stackRegion",
9944
10115
  "statistic": "statistic",
9945
10116
  "unit": "unit",
10117
+ "visible": "visible",
9946
10118
  },
9947
10119
  )
9948
10120
  class MetricOptions(CommonMetricOptions):
@@ -9952,6 +10124,7 @@ class MetricOptions(CommonMetricOptions):
9952
10124
  account: typing.Optional[builtins.str] = None,
9953
10125
  color: typing.Optional[builtins.str] = None,
9954
10126
  dimensions_map: typing.Optional[typing.Mapping[builtins.str, builtins.str]] = None,
10127
+ id: typing.Optional[builtins.str] = None,
9955
10128
  label: typing.Optional[builtins.str] = None,
9956
10129
  period: typing.Optional[_Duration_4839e8c3] = None,
9957
10130
  region: typing.Optional[builtins.str] = None,
@@ -9959,12 +10132,14 @@ class MetricOptions(CommonMetricOptions):
9959
10132
  stack_region: typing.Optional[builtins.str] = None,
9960
10133
  statistic: typing.Optional[builtins.str] = None,
9961
10134
  unit: typing.Optional["Unit"] = None,
10135
+ visible: typing.Optional[builtins.bool] = None,
9962
10136
  ) -> None:
9963
10137
  '''Properties of a metric that can be changed.
9964
10138
 
9965
10139
  :param account: Account which this metric comes from. Default: - Deployment account.
9966
10140
  :param color: The hex color code, prefixed with '#' (e.g. '#00ff00'), to use when this metric is rendered on a graph. The ``Color`` class has a set of standard colors that can be used here. Default: - Automatic color
9967
10141
  :param dimensions_map: Dimensions of the metric. Default: - No dimensions.
10142
+ :param id: Unique identifier for this metric when used in dashboard widgets. The id can be used as a variable to represent this metric in math expressions. Valid characters are letters, numbers, and underscore. The first character must be a lowercase letter. Default: - No ID
9968
10143
  :param label: Label for this metric when added to a Graph in a Dashboard. You can use `dynamic labels <https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/graph-dynamic-labels.html>`_ to show summary information about the entire 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. Default: - No label
9969
10144
  :param period: The period over which the specified statistic is applied. Default: Duration.minutes(5)
9970
10145
  :param region: Region which this metric comes from. Default: - Deployment region.
@@ -9972,6 +10147,7 @@ class MetricOptions(CommonMetricOptions):
9972
10147
  :param stack_region: Region of the stack this metric is attached to. Default: - Deployment region.
9973
10148
  :param statistic: What function to use for aggregating. Use the ``aws_cloudwatch.Stats`` helper class to construct valid input strings. Can be one of the following: - "Minimum" | "min" - "Maximum" | "max" - "Average" | "avg" - "Sum" | "sum" - "SampleCount | "n" - "pNN.NN" - "tmNN.NN" | "tm(NN.NN%:NN.NN%)" - "iqm" - "wmNN.NN" | "wm(NN.NN%:NN.NN%)" - "tcNN.NN" | "tc(NN.NN%:NN.NN%)" - "tsNN.NN" | "ts(NN.NN%:NN.NN%)" Default: Average
9974
10149
  :param unit: Unit used to filter the metric stream. Only refer to datums emitted to the metric stream with the given unit and ignore all others. Only useful when datums are being emitted to the same metric stream under different units. The default is to use all matric datums in the stream, regardless of unit, which is recommended in nearly all cases. CloudWatch does not honor this property for graphs. Default: - All metric datums in the given metric stream
10150
+ :param visible: Whether this metric should be visible in dashboard graphs. Setting this to false is useful when you want to hide raw metrics that are used in math expressions, and show only the expression results. Default: true
9975
10151
 
9976
10152
  :exampleMetadata: infused
9977
10153
 
@@ -10002,6 +10178,7 @@ class MetricOptions(CommonMetricOptions):
10002
10178
  check_type(argname="argument account", value=account, expected_type=type_hints["account"])
10003
10179
  check_type(argname="argument color", value=color, expected_type=type_hints["color"])
10004
10180
  check_type(argname="argument dimensions_map", value=dimensions_map, expected_type=type_hints["dimensions_map"])
10181
+ check_type(argname="argument id", value=id, expected_type=type_hints["id"])
10005
10182
  check_type(argname="argument label", value=label, expected_type=type_hints["label"])
10006
10183
  check_type(argname="argument period", value=period, expected_type=type_hints["period"])
10007
10184
  check_type(argname="argument region", value=region, expected_type=type_hints["region"])
@@ -10009,6 +10186,7 @@ class MetricOptions(CommonMetricOptions):
10009
10186
  check_type(argname="argument stack_region", value=stack_region, expected_type=type_hints["stack_region"])
10010
10187
  check_type(argname="argument statistic", value=statistic, expected_type=type_hints["statistic"])
10011
10188
  check_type(argname="argument unit", value=unit, expected_type=type_hints["unit"])
10189
+ check_type(argname="argument visible", value=visible, expected_type=type_hints["visible"])
10012
10190
  self._values: typing.Dict[builtins.str, typing.Any] = {}
10013
10191
  if account is not None:
10014
10192
  self._values["account"] = account
@@ -10016,6 +10194,8 @@ class MetricOptions(CommonMetricOptions):
10016
10194
  self._values["color"] = color
10017
10195
  if dimensions_map is not None:
10018
10196
  self._values["dimensions_map"] = dimensions_map
10197
+ if id is not None:
10198
+ self._values["id"] = id
10019
10199
  if label is not None:
10020
10200
  self._values["label"] = label
10021
10201
  if period is not None:
@@ -10030,6 +10210,8 @@ class MetricOptions(CommonMetricOptions):
10030
10210
  self._values["statistic"] = statistic
10031
10211
  if unit is not None:
10032
10212
  self._values["unit"] = unit
10213
+ if visible is not None:
10214
+ self._values["visible"] = visible
10033
10215
 
10034
10216
  @builtins.property
10035
10217
  def account(self) -> typing.Optional[builtins.str]:
@@ -10060,6 +10242,19 @@ class MetricOptions(CommonMetricOptions):
10060
10242
  result = self._values.get("dimensions_map")
10061
10243
  return typing.cast(typing.Optional[typing.Mapping[builtins.str, builtins.str]], result)
10062
10244
 
10245
+ @builtins.property
10246
+ def id(self) -> typing.Optional[builtins.str]:
10247
+ '''Unique identifier for this metric when used in dashboard widgets.
10248
+
10249
+ The id can be used as a variable to represent this metric in math expressions.
10250
+ Valid characters are letters, numbers, and underscore. The first character
10251
+ must be a lowercase letter.
10252
+
10253
+ :default: - No ID
10254
+ '''
10255
+ result = self._values.get("id")
10256
+ return typing.cast(typing.Optional[builtins.str], result)
10257
+
10063
10258
  @builtins.property
10064
10259
  def label(self) -> typing.Optional[builtins.str]:
10065
10260
  '''Label for this metric when added to a Graph in a Dashboard.
@@ -10157,6 +10352,18 @@ class MetricOptions(CommonMetricOptions):
10157
10352
  result = self._values.get("unit")
10158
10353
  return typing.cast(typing.Optional["Unit"], result)
10159
10354
 
10355
+ @builtins.property
10356
+ def visible(self) -> typing.Optional[builtins.bool]:
10357
+ '''Whether this metric should be visible in dashboard graphs.
10358
+
10359
+ Setting this to false is useful when you want to hide raw metrics
10360
+ that are used in math expressions, and show only the expression results.
10361
+
10362
+ :default: true
10363
+ '''
10364
+ result = self._values.get("visible")
10365
+ return typing.cast(typing.Optional[builtins.bool], result)
10366
+
10160
10367
  def __eq__(self, rhs: typing.Any) -> builtins.bool:
10161
10368
  return isinstance(rhs, self.__class__) and rhs._values == self._values
10162
10369
 
@@ -10176,6 +10383,7 @@ class MetricOptions(CommonMetricOptions):
10176
10383
  "account": "account",
10177
10384
  "color": "color",
10178
10385
  "dimensions_map": "dimensionsMap",
10386
+ "id": "id",
10179
10387
  "label": "label",
10180
10388
  "period": "period",
10181
10389
  "region": "region",
@@ -10183,6 +10391,7 @@ class MetricOptions(CommonMetricOptions):
10183
10391
  "stack_region": "stackRegion",
10184
10392
  "statistic": "statistic",
10185
10393
  "unit": "unit",
10394
+ "visible": "visible",
10186
10395
  "metric_name": "metricName",
10187
10396
  "namespace": "namespace",
10188
10397
  },
@@ -10194,6 +10403,7 @@ class MetricProps(CommonMetricOptions):
10194
10403
  account: typing.Optional[builtins.str] = None,
10195
10404
  color: typing.Optional[builtins.str] = None,
10196
10405
  dimensions_map: typing.Optional[typing.Mapping[builtins.str, builtins.str]] = None,
10406
+ id: typing.Optional[builtins.str] = None,
10197
10407
  label: typing.Optional[builtins.str] = None,
10198
10408
  period: typing.Optional[_Duration_4839e8c3] = None,
10199
10409
  region: typing.Optional[builtins.str] = None,
@@ -10201,6 +10411,7 @@ class MetricProps(CommonMetricOptions):
10201
10411
  stack_region: typing.Optional[builtins.str] = None,
10202
10412
  statistic: typing.Optional[builtins.str] = None,
10203
10413
  unit: typing.Optional["Unit"] = None,
10414
+ visible: typing.Optional[builtins.bool] = None,
10204
10415
  metric_name: builtins.str,
10205
10416
  namespace: builtins.str,
10206
10417
  ) -> None:
@@ -10209,6 +10420,7 @@ class MetricProps(CommonMetricOptions):
10209
10420
  :param account: Account which this metric comes from. Default: - Deployment account.
10210
10421
  :param color: The hex color code, prefixed with '#' (e.g. '#00ff00'), to use when this metric is rendered on a graph. The ``Color`` class has a set of standard colors that can be used here. Default: - Automatic color
10211
10422
  :param dimensions_map: Dimensions of the metric. Default: - No dimensions.
10423
+ :param id: Unique identifier for this metric when used in dashboard widgets. The id can be used as a variable to represent this metric in math expressions. Valid characters are letters, numbers, and underscore. The first character must be a lowercase letter. Default: - No ID
10212
10424
  :param label: Label for this metric when added to a Graph in a Dashboard. You can use `dynamic labels <https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/graph-dynamic-labels.html>`_ to show summary information about the entire 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. Default: - No label
10213
10425
  :param period: The period over which the specified statistic is applied. Default: Duration.minutes(5)
10214
10426
  :param region: Region which this metric comes from. Default: - Deployment region.
@@ -10216,6 +10428,7 @@ class MetricProps(CommonMetricOptions):
10216
10428
  :param stack_region: Region of the stack this metric is attached to. Default: - Deployment region.
10217
10429
  :param statistic: What function to use for aggregating. Use the ``aws_cloudwatch.Stats`` helper class to construct valid input strings. Can be one of the following: - "Minimum" | "min" - "Maximum" | "max" - "Average" | "avg" - "Sum" | "sum" - "SampleCount | "n" - "pNN.NN" - "tmNN.NN" | "tm(NN.NN%:NN.NN%)" - "iqm" - "wmNN.NN" | "wm(NN.NN%:NN.NN%)" - "tcNN.NN" | "tc(NN.NN%:NN.NN%)" - "tsNN.NN" | "ts(NN.NN%:NN.NN%)" Default: Average
10218
10430
  :param unit: Unit used to filter the metric stream. Only refer to datums emitted to the metric stream with the given unit and ignore all others. Only useful when datums are being emitted to the same metric stream under different units. The default is to use all matric datums in the stream, regardless of unit, which is recommended in nearly all cases. CloudWatch does not honor this property for graphs. Default: - All metric datums in the given metric stream
10431
+ :param visible: Whether this metric should be visible in dashboard graphs. Setting this to false is useful when you want to hide raw metrics that are used in math expressions, and show only the expression results. Default: true
10219
10432
  :param metric_name: Name of the metric.
10220
10433
  :param namespace: Namespace of the metric.
10221
10434
 
@@ -10248,6 +10461,7 @@ class MetricProps(CommonMetricOptions):
10248
10461
  check_type(argname="argument account", value=account, expected_type=type_hints["account"])
10249
10462
  check_type(argname="argument color", value=color, expected_type=type_hints["color"])
10250
10463
  check_type(argname="argument dimensions_map", value=dimensions_map, expected_type=type_hints["dimensions_map"])
10464
+ check_type(argname="argument id", value=id, expected_type=type_hints["id"])
10251
10465
  check_type(argname="argument label", value=label, expected_type=type_hints["label"])
10252
10466
  check_type(argname="argument period", value=period, expected_type=type_hints["period"])
10253
10467
  check_type(argname="argument region", value=region, expected_type=type_hints["region"])
@@ -10255,6 +10469,7 @@ class MetricProps(CommonMetricOptions):
10255
10469
  check_type(argname="argument stack_region", value=stack_region, expected_type=type_hints["stack_region"])
10256
10470
  check_type(argname="argument statistic", value=statistic, expected_type=type_hints["statistic"])
10257
10471
  check_type(argname="argument unit", value=unit, expected_type=type_hints["unit"])
10472
+ check_type(argname="argument visible", value=visible, expected_type=type_hints["visible"])
10258
10473
  check_type(argname="argument metric_name", value=metric_name, expected_type=type_hints["metric_name"])
10259
10474
  check_type(argname="argument namespace", value=namespace, expected_type=type_hints["namespace"])
10260
10475
  self._values: typing.Dict[builtins.str, typing.Any] = {
@@ -10267,6 +10482,8 @@ class MetricProps(CommonMetricOptions):
10267
10482
  self._values["color"] = color
10268
10483
  if dimensions_map is not None:
10269
10484
  self._values["dimensions_map"] = dimensions_map
10485
+ if id is not None:
10486
+ self._values["id"] = id
10270
10487
  if label is not None:
10271
10488
  self._values["label"] = label
10272
10489
  if period is not None:
@@ -10281,6 +10498,8 @@ class MetricProps(CommonMetricOptions):
10281
10498
  self._values["statistic"] = statistic
10282
10499
  if unit is not None:
10283
10500
  self._values["unit"] = unit
10501
+ if visible is not None:
10502
+ self._values["visible"] = visible
10284
10503
 
10285
10504
  @builtins.property
10286
10505
  def account(self) -> typing.Optional[builtins.str]:
@@ -10311,6 +10530,19 @@ class MetricProps(CommonMetricOptions):
10311
10530
  result = self._values.get("dimensions_map")
10312
10531
  return typing.cast(typing.Optional[typing.Mapping[builtins.str, builtins.str]], result)
10313
10532
 
10533
+ @builtins.property
10534
+ def id(self) -> typing.Optional[builtins.str]:
10535
+ '''Unique identifier for this metric when used in dashboard widgets.
10536
+
10537
+ The id can be used as a variable to represent this metric in math expressions.
10538
+ Valid characters are letters, numbers, and underscore. The first character
10539
+ must be a lowercase letter.
10540
+
10541
+ :default: - No ID
10542
+ '''
10543
+ result = self._values.get("id")
10544
+ return typing.cast(typing.Optional[builtins.str], result)
10545
+
10314
10546
  @builtins.property
10315
10547
  def label(self) -> typing.Optional[builtins.str]:
10316
10548
  '''Label for this metric when added to a Graph in a Dashboard.
@@ -10408,6 +10640,18 @@ class MetricProps(CommonMetricOptions):
10408
10640
  result = self._values.get("unit")
10409
10641
  return typing.cast(typing.Optional["Unit"], result)
10410
10642
 
10643
+ @builtins.property
10644
+ def visible(self) -> typing.Optional[builtins.bool]:
10645
+ '''Whether this metric should be visible in dashboard graphs.
10646
+
10647
+ Setting this to false is useful when you want to hide raw metrics
10648
+ that are used in math expressions, and show only the expression results.
10649
+
10650
+ :default: true
10651
+ '''
10652
+ result = self._values.get("visible")
10653
+ return typing.cast(typing.Optional[builtins.bool], result)
10654
+
10411
10655
  @builtins.property
10412
10656
  def metric_name(self) -> builtins.str:
10413
10657
  '''Name of the metric.'''
@@ -14980,6 +15224,7 @@ class LogQueryWidget(
14980
15224
  log_group_names: typing.Sequence[builtins.str],
14981
15225
  account_id: typing.Optional[builtins.str] = None,
14982
15226
  height: typing.Optional[jsii.Number] = None,
15227
+ query_language: typing.Optional[LogQueryLanguage] = None,
14983
15228
  query_lines: typing.Optional[typing.Sequence[builtins.str]] = None,
14984
15229
  query_string: typing.Optional[builtins.str] = None,
14985
15230
  region: typing.Optional[builtins.str] = None,
@@ -14991,6 +15236,7 @@ class LogQueryWidget(
14991
15236
  :param log_group_names: Names of log groups to query.
14992
15237
  :param account_id: The AWS account ID where the log groups are located. This enables cross-account functionality for CloudWatch dashboards. Before using this feature, ensure that proper cross-account sharing is configured between the monitoring account and source account. For more information, see: https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/CloudWatch-Unified-Cross-Account.html Default: - Current account
14993
15238
  :param height: Height of the widget. Default: 6
15239
+ :param query_language: The query language to use for the query. Default: LogQueryLanguage.LOGS_INSIGHTS
14994
15240
  :param query_lines: A sequence of lines to use to build the query. The query will be built by joining the lines together using ``\\n|``. Default: - Exactly one of ``queryString``, ``queryLines`` is required.
14995
15241
  :param query_string: Full query string for log insights. Be sure to prepend every new line with a newline and pipe character (``\\n|``). Default: - Exactly one of ``queryString``, ``queryLines`` is required.
14996
15242
  :param region: The region the metrics of this widget should be taken from. Default: Current region
@@ -15002,6 +15248,7 @@ class LogQueryWidget(
15002
15248
  log_group_names=log_group_names,
15003
15249
  account_id=account_id,
15004
15250
  height=height,
15251
+ query_language=query_language,
15005
15252
  query_lines=query_lines,
15006
15253
  query_string=query_string,
15007
15254
  region=region,
@@ -16044,6 +16291,7 @@ __all__ = [
16044
16291
  "IVariable",
16045
16292
  "IWidget",
16046
16293
  "LegendPosition",
16294
+ "LogQueryLanguage",
16047
16295
  "LogQueryVisualizationType",
16048
16296
  "LogQueryWidget",
16049
16297
  "LogQueryWidgetProps",
@@ -16925,6 +17173,7 @@ def _typecheckingstub__dd18f372aac3bb8d4a678dd4ee7a3b5bd34447637695b896086139ee2
16925
17173
  account: typing.Optional[builtins.str] = None,
16926
17174
  color: typing.Optional[builtins.str] = None,
16927
17175
  dimensions_map: typing.Optional[typing.Mapping[builtins.str, builtins.str]] = None,
17176
+ id: typing.Optional[builtins.str] = None,
16928
17177
  label: typing.Optional[builtins.str] = None,
16929
17178
  period: typing.Optional[_Duration_4839e8c3] = None,
16930
17179
  region: typing.Optional[builtins.str] = None,
@@ -16932,6 +17181,7 @@ def _typecheckingstub__dd18f372aac3bb8d4a678dd4ee7a3b5bd34447637695b896086139ee2
16932
17181
  stack_region: typing.Optional[builtins.str] = None,
16933
17182
  statistic: typing.Optional[builtins.str] = None,
16934
17183
  unit: typing.Optional[Unit] = None,
17184
+ visible: typing.Optional[builtins.bool] = None,
16935
17185
  ) -> None:
16936
17186
  """Type checking stubs"""
16937
17187
  pass
@@ -17076,6 +17326,7 @@ def _typecheckingstub__b7d4a308b1274696259a35b14b5ae833f34881f95eaba521bb47a74b3
17076
17326
  log_group_names: typing.Sequence[builtins.str],
17077
17327
  account_id: typing.Optional[builtins.str] = None,
17078
17328
  height: typing.Optional[jsii.Number] = None,
17329
+ query_language: typing.Optional[LogQueryLanguage] = None,
17079
17330
  query_lines: typing.Optional[typing.Sequence[builtins.str]] = None,
17080
17331
  query_string: typing.Optional[builtins.str] = None,
17081
17332
  region: typing.Optional[builtins.str] = None,
@@ -17181,6 +17432,7 @@ def _typecheckingstub__0dbe737a4d124c27184430b7c20048e16171cb8b5b94bdac632b26d84
17181
17432
  account: typing.Optional[builtins.str] = None,
17182
17433
  color: typing.Optional[builtins.str] = None,
17183
17434
  dimensions_map: typing.Optional[typing.Mapping[builtins.str, builtins.str]] = None,
17435
+ id: typing.Optional[builtins.str] = None,
17184
17436
  label: typing.Optional[builtins.str] = None,
17185
17437
  period: typing.Optional[_Duration_4839e8c3] = None,
17186
17438
  region: typing.Optional[builtins.str] = None,
@@ -17188,6 +17440,7 @@ def _typecheckingstub__0dbe737a4d124c27184430b7c20048e16171cb8b5b94bdac632b26d84
17188
17440
  stack_region: typing.Optional[builtins.str] = None,
17189
17441
  statistic: typing.Optional[builtins.str] = None,
17190
17442
  unit: typing.Optional[Unit] = None,
17443
+ visible: typing.Optional[builtins.bool] = None,
17191
17444
  ) -> None:
17192
17445
  """Type checking stubs"""
17193
17446
  pass
@@ -17197,6 +17450,7 @@ def _typecheckingstub__5e1e153a11ab88ed91297aedb5d7a78a81e7bf88f8aeda51bc11ff42e
17197
17450
  account: typing.Optional[builtins.str] = None,
17198
17451
  color: typing.Optional[builtins.str] = None,
17199
17452
  dimensions_map: typing.Optional[typing.Mapping[builtins.str, builtins.str]] = None,
17453
+ id: typing.Optional[builtins.str] = None,
17200
17454
  label: typing.Optional[builtins.str] = None,
17201
17455
  period: typing.Optional[_Duration_4839e8c3] = None,
17202
17456
  region: typing.Optional[builtins.str] = None,
@@ -17204,6 +17458,7 @@ def _typecheckingstub__5e1e153a11ab88ed91297aedb5d7a78a81e7bf88f8aeda51bc11ff42e
17204
17458
  stack_region: typing.Optional[builtins.str] = None,
17205
17459
  statistic: typing.Optional[builtins.str] = None,
17206
17460
  unit: typing.Optional[Unit] = None,
17461
+ visible: typing.Optional[builtins.bool] = None,
17207
17462
  metric_name: builtins.str,
17208
17463
  namespace: builtins.str,
17209
17464
  ) -> None: