aws-cdk-lib 2.203.0__py3-none-any.whl → 2.204.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 (33) hide show
  1. aws_cdk/__init__.py +38 -0
  2. aws_cdk/_jsii/__init__.py +1 -1
  3. aws_cdk/_jsii/{aws-cdk-lib@2.203.0.jsii.tgz → aws-cdk-lib@2.204.0.jsii.tgz} +0 -0
  4. aws_cdk/aws_apigateway/__init__.py +164 -0
  5. aws_cdk/aws_apigatewayv2/__init__.py +412 -0
  6. aws_cdk/aws_certificatemanager/__init__.py +28 -0
  7. aws_cdk/aws_chatbot/__init__.py +28 -0
  8. aws_cdk/aws_cloudfront/__init__.py +92 -0
  9. aws_cdk/aws_cloudfront/experimental/__init__.py +32 -0
  10. aws_cdk/aws_cloudwatch/__init__.py +217 -23
  11. aws_cdk/aws_codebuild/__init__.py +84 -0
  12. aws_cdk/aws_dynamodb/__init__.py +316 -2
  13. aws_cdk/aws_ec2/__init__.py +94 -0
  14. aws_cdk/aws_ecs/__init__.py +52 -0
  15. aws_cdk/aws_elasticloadbalancingv2/__init__.py +724 -0
  16. aws_cdk/aws_elasticsearch/__init__.py +260 -0
  17. aws_cdk/aws_kinesis/__init__.py +324 -0
  18. aws_cdk/aws_kinesisfirehose/__init__.py +100 -0
  19. aws_cdk/aws_lambda/__init__.py +144 -0
  20. aws_cdk/aws_logs/__init__.py +58 -0
  21. aws_cdk/aws_opensearchservice/__init__.py +260 -0
  22. aws_cdk/aws_rds/__init__.py +384 -0
  23. aws_cdk/aws_scheduler/__init__.py +210 -0
  24. aws_cdk/aws_sns/__init__.py +164 -0
  25. aws_cdk/aws_sqs/__init__.py +164 -0
  26. aws_cdk/aws_stepfunctions/__init__.py +288 -0
  27. aws_cdk/aws_synthetics/__init__.py +18 -0
  28. {aws_cdk_lib-2.203.0.dist-info → aws_cdk_lib-2.204.0.dist-info}/METADATA +2 -2
  29. {aws_cdk_lib-2.203.0.dist-info → aws_cdk_lib-2.204.0.dist-info}/RECORD +33 -33
  30. {aws_cdk_lib-2.203.0.dist-info → aws_cdk_lib-2.204.0.dist-info}/LICENSE +0 -0
  31. {aws_cdk_lib-2.203.0.dist-info → aws_cdk_lib-2.204.0.dist-info}/NOTICE +0 -0
  32. {aws_cdk_lib-2.203.0.dist-info → aws_cdk_lib-2.204.0.dist-info}/WHEEL +0 -0
  33. {aws_cdk_lib-2.203.0.dist-info → aws_cdk_lib-2.204.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
@@ -6694,6 +6755,7 @@ class Color(metaclass=jsii.JSIIMeta, jsii_type="aws-cdk-lib.aws_cloudwatch.Color
6694
6755
  "account": "account",
6695
6756
  "color": "color",
6696
6757
  "dimensions_map": "dimensionsMap",
6758
+ "id": "id",
6697
6759
  "label": "label",
6698
6760
  "period": "period",
6699
6761
  "region": "region",
@@ -6701,6 +6763,7 @@ class Color(metaclass=jsii.JSIIMeta, jsii_type="aws-cdk-lib.aws_cloudwatch.Color
6701
6763
  "stack_region": "stackRegion",
6702
6764
  "statistic": "statistic",
6703
6765
  "unit": "unit",
6766
+ "visible": "visible",
6704
6767
  },
6705
6768
  )
6706
6769
  class CommonMetricOptions:
@@ -6710,6 +6773,7 @@ class CommonMetricOptions:
6710
6773
  account: typing.Optional[builtins.str] = None,
6711
6774
  color: typing.Optional[builtins.str] = None,
6712
6775
  dimensions_map: typing.Optional[typing.Mapping[builtins.str, builtins.str]] = None,
6776
+ id: typing.Optional[builtins.str] = None,
6713
6777
  label: typing.Optional[builtins.str] = None,
6714
6778
  period: typing.Optional[_Duration_4839e8c3] = None,
6715
6779
  region: typing.Optional[builtins.str] = None,
@@ -6717,12 +6781,14 @@ class CommonMetricOptions:
6717
6781
  stack_region: typing.Optional[builtins.str] = None,
6718
6782
  statistic: typing.Optional[builtins.str] = None,
6719
6783
  unit: typing.Optional["Unit"] = None,
6784
+ visible: typing.Optional[builtins.bool] = None,
6720
6785
  ) -> None:
6721
6786
  '''Options shared by most methods accepting metric options.
6722
6787
 
6723
6788
  :param account: Account which this metric comes from. Default: - Deployment account.
6724
6789
  :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
6790
  :param dimensions_map: Dimensions of the metric. Default: - No dimensions.
6791
+ :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
6792
  :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
6793
  :param period: The period over which the specified statistic is applied. Default: Duration.minutes(5)
6728
6794
  :param region: Region which this metric comes from. Default: - Deployment region.
@@ -6730,6 +6796,7 @@ class CommonMetricOptions:
6730
6796
  :param stack_region: Region of the stack this metric is attached to. Default: - Deployment region.
6731
6797
  :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
6798
  :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
6799
+ :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
6800
 
6734
6801
  :exampleMetadata: fixture=_generated
6735
6802
 
@@ -6746,13 +6813,15 @@ class CommonMetricOptions:
6746
6813
  dimensions_map={
6747
6814
  "dimensions_map_key": "dimensionsMap"
6748
6815
  },
6816
+ id="id",
6749
6817
  label="label",
6750
6818
  period=cdk.Duration.minutes(30),
6751
6819
  region="region",
6752
6820
  stack_account="stackAccount",
6753
6821
  stack_region="stackRegion",
6754
6822
  statistic="statistic",
6755
- unit=cloudwatch.Unit.SECONDS
6823
+ unit=cloudwatch.Unit.SECONDS,
6824
+ visible=False
6756
6825
  )
6757
6826
  '''
6758
6827
  if __debug__:
@@ -6760,6 +6829,7 @@ class CommonMetricOptions:
6760
6829
  check_type(argname="argument account", value=account, expected_type=type_hints["account"])
6761
6830
  check_type(argname="argument color", value=color, expected_type=type_hints["color"])
6762
6831
  check_type(argname="argument dimensions_map", value=dimensions_map, expected_type=type_hints["dimensions_map"])
6832
+ check_type(argname="argument id", value=id, expected_type=type_hints["id"])
6763
6833
  check_type(argname="argument label", value=label, expected_type=type_hints["label"])
6764
6834
  check_type(argname="argument period", value=period, expected_type=type_hints["period"])
6765
6835
  check_type(argname="argument region", value=region, expected_type=type_hints["region"])
@@ -6767,6 +6837,7 @@ class CommonMetricOptions:
6767
6837
  check_type(argname="argument stack_region", value=stack_region, expected_type=type_hints["stack_region"])
6768
6838
  check_type(argname="argument statistic", value=statistic, expected_type=type_hints["statistic"])
6769
6839
  check_type(argname="argument unit", value=unit, expected_type=type_hints["unit"])
6840
+ check_type(argname="argument visible", value=visible, expected_type=type_hints["visible"])
6770
6841
  self._values: typing.Dict[builtins.str, typing.Any] = {}
6771
6842
  if account is not None:
6772
6843
  self._values["account"] = account
@@ -6774,6 +6845,8 @@ class CommonMetricOptions:
6774
6845
  self._values["color"] = color
6775
6846
  if dimensions_map is not None:
6776
6847
  self._values["dimensions_map"] = dimensions_map
6848
+ if id is not None:
6849
+ self._values["id"] = id
6777
6850
  if label is not None:
6778
6851
  self._values["label"] = label
6779
6852
  if period is not None:
@@ -6788,6 +6861,8 @@ class CommonMetricOptions:
6788
6861
  self._values["statistic"] = statistic
6789
6862
  if unit is not None:
6790
6863
  self._values["unit"] = unit
6864
+ if visible is not None:
6865
+ self._values["visible"] = visible
6791
6866
 
6792
6867
  @builtins.property
6793
6868
  def account(self) -> typing.Optional[builtins.str]:
@@ -6818,6 +6893,19 @@ class CommonMetricOptions:
6818
6893
  result = self._values.get("dimensions_map")
6819
6894
  return typing.cast(typing.Optional[typing.Mapping[builtins.str, builtins.str]], result)
6820
6895
 
6896
+ @builtins.property
6897
+ def id(self) -> typing.Optional[builtins.str]:
6898
+ '''Unique identifier for this metric when used in dashboard widgets.
6899
+
6900
+ The id can be used as a variable to represent this metric in math expressions.
6901
+ Valid characters are letters, numbers, and underscore. The first character
6902
+ must be a lowercase letter.
6903
+
6904
+ :default: - No ID
6905
+ '''
6906
+ result = self._values.get("id")
6907
+ return typing.cast(typing.Optional[builtins.str], result)
6908
+
6821
6909
  @builtins.property
6822
6910
  def label(self) -> typing.Optional[builtins.str]:
6823
6911
  '''Label for this metric when added to a Graph in a Dashboard.
@@ -6915,6 +7003,18 @@ class CommonMetricOptions:
6915
7003
  result = self._values.get("unit")
6916
7004
  return typing.cast(typing.Optional["Unit"], result)
6917
7005
 
7006
+ @builtins.property
7007
+ def visible(self) -> typing.Optional[builtins.bool]:
7008
+ '''Whether this metric should be visible in dashboard graphs.
7009
+
7010
+ Setting this to false is useful when you want to hide raw metrics
7011
+ that are used in math expressions, and show only the expression results.
7012
+
7013
+ :default: true
7014
+ '''
7015
+ result = self._values.get("visible")
7016
+ return typing.cast(typing.Optional[builtins.bool], result)
7017
+
6918
7018
  def __eq__(self, rhs: typing.Any) -> builtins.bool:
6919
7019
  return isinstance(rhs, self.__class__) and rhs._values == self._values
6920
7020
 
@@ -8770,21 +8870,16 @@ class MathExpression(
8770
8870
 
8771
8871
  Example::
8772
8872
 
8773
- # matchmaking_rule_set: gamelift.MatchmakingRuleSet
8873
+ # fn: lambda.Function
8774
8874
 
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)",
8875
+
8876
+ all_problems = cloudwatch.MathExpression(
8877
+ expression="errors + throttles",
8778
8878
  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")
8879
+ "errors": fn.metric_errors(),
8880
+ "throttles": fn.metric_throttles()
8781
8881
  }
8782
8882
  )
8783
- cloudwatch.Alarm(self, "Alarm",
8784
- metric=rule_evaluation_ratio,
8785
- threshold=0.1,
8786
- evaluation_periods=3
8787
- )
8788
8883
  '''
8789
8884
 
8790
8885
  def __init__(
@@ -9161,21 +9256,16 @@ class MathExpressionProps(MathExpressionOptions):
9161
9256
 
9162
9257
  Example::
9163
9258
 
9164
- # matchmaking_rule_set: gamelift.MatchmakingRuleSet
9259
+ # fn: lambda.Function
9260
+
9165
9261
 
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)",
9262
+ all_problems = cloudwatch.MathExpression(
9263
+ expression="errors + throttles",
9169
9264
  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")
9265
+ "errors": fn.metric_errors(),
9266
+ "throttles": fn.metric_throttles()
9172
9267
  }
9173
9268
  )
9174
- cloudwatch.Alarm(self, "Alarm",
9175
- metric=rule_evaluation_ratio,
9176
- threshold=0.1,
9177
- evaluation_periods=3
9178
- )
9179
9269
  '''
9180
9270
  if __debug__:
9181
9271
  type_hints = typing.get_type_hints(_typecheckingstub__7cfb588e44acd0977aa0e09f00c3e2435bad84385ab7b6d163b332963d844e0a)
@@ -9385,6 +9475,7 @@ class Metric(metaclass=jsii.JSIIMeta, jsii_type="aws-cdk-lib.aws_cloudwatch.Metr
9385
9475
  account: typing.Optional[builtins.str] = None,
9386
9476
  color: typing.Optional[builtins.str] = None,
9387
9477
  dimensions_map: typing.Optional[typing.Mapping[builtins.str, builtins.str]] = None,
9478
+ id: typing.Optional[builtins.str] = None,
9388
9479
  label: typing.Optional[builtins.str] = None,
9389
9480
  period: typing.Optional[_Duration_4839e8c3] = None,
9390
9481
  region: typing.Optional[builtins.str] = None,
@@ -9392,6 +9483,7 @@ class Metric(metaclass=jsii.JSIIMeta, jsii_type="aws-cdk-lib.aws_cloudwatch.Metr
9392
9483
  stack_region: typing.Optional[builtins.str] = None,
9393
9484
  statistic: typing.Optional[builtins.str] = None,
9394
9485
  unit: typing.Optional["Unit"] = None,
9486
+ visible: typing.Optional[builtins.bool] = None,
9395
9487
  ) -> None:
9396
9488
  '''
9397
9489
  :param metric_name: Name of the metric.
@@ -9399,6 +9491,7 @@ class Metric(metaclass=jsii.JSIIMeta, jsii_type="aws-cdk-lib.aws_cloudwatch.Metr
9399
9491
  :param account: Account which this metric comes from. Default: - Deployment account.
9400
9492
  :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
9493
  :param dimensions_map: Dimensions of the metric. Default: - No dimensions.
9494
+ :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
9495
  :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
9496
  :param period: The period over which the specified statistic is applied. Default: Duration.minutes(5)
9404
9497
  :param region: Region which this metric comes from. Default: - Deployment region.
@@ -9406,6 +9499,7 @@ class Metric(metaclass=jsii.JSIIMeta, jsii_type="aws-cdk-lib.aws_cloudwatch.Metr
9406
9499
  :param stack_region: Region of the stack this metric is attached to. Default: - Deployment region.
9407
9500
  :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
9501
  :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
9502
+ :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
9503
  '''
9410
9504
  props = MetricProps(
9411
9505
  metric_name=metric_name,
@@ -9413,6 +9507,7 @@ class Metric(metaclass=jsii.JSIIMeta, jsii_type="aws-cdk-lib.aws_cloudwatch.Metr
9413
9507
  account=account,
9414
9508
  color=color,
9415
9509
  dimensions_map=dimensions_map,
9510
+ id=id,
9416
9511
  label=label,
9417
9512
  period=period,
9418
9513
  region=region,
@@ -9420,6 +9515,7 @@ class Metric(metaclass=jsii.JSIIMeta, jsii_type="aws-cdk-lib.aws_cloudwatch.Metr
9420
9515
  stack_region=stack_region,
9421
9516
  statistic=statistic,
9422
9517
  unit=unit,
9518
+ visible=visible,
9423
9519
  )
9424
9520
 
9425
9521
  jsii.create(self.__class__, self, [props])
@@ -9561,6 +9657,7 @@ class Metric(metaclass=jsii.JSIIMeta, jsii_type="aws-cdk-lib.aws_cloudwatch.Metr
9561
9657
  account: typing.Optional[builtins.str] = None,
9562
9658
  color: typing.Optional[builtins.str] = None,
9563
9659
  dimensions_map: typing.Optional[typing.Mapping[builtins.str, builtins.str]] = None,
9660
+ id: typing.Optional[builtins.str] = None,
9564
9661
  label: typing.Optional[builtins.str] = None,
9565
9662
  period: typing.Optional[_Duration_4839e8c3] = None,
9566
9663
  region: typing.Optional[builtins.str] = None,
@@ -9568,6 +9665,7 @@ class Metric(metaclass=jsii.JSIIMeta, jsii_type="aws-cdk-lib.aws_cloudwatch.Metr
9568
9665
  stack_region: typing.Optional[builtins.str] = None,
9569
9666
  statistic: typing.Optional[builtins.str] = None,
9570
9667
  unit: typing.Optional["Unit"] = None,
9668
+ visible: typing.Optional[builtins.bool] = None,
9571
9669
  ) -> "Metric":
9572
9670
  '''Return a copy of Metric ``with`` properties changed.
9573
9671
 
@@ -9576,6 +9674,7 @@ class Metric(metaclass=jsii.JSIIMeta, jsii_type="aws-cdk-lib.aws_cloudwatch.Metr
9576
9674
  :param account: Account which this metric comes from. Default: - Deployment account.
9577
9675
  :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
9676
  :param dimensions_map: Dimensions of the metric. Default: - No dimensions.
9677
+ :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
9678
  :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
9679
  :param period: The period over which the specified statistic is applied. Default: Duration.minutes(5)
9581
9680
  :param region: Region which this metric comes from. Default: - Deployment region.
@@ -9583,11 +9682,13 @@ class Metric(metaclass=jsii.JSIIMeta, jsii_type="aws-cdk-lib.aws_cloudwatch.Metr
9583
9682
  :param stack_region: Region of the stack this metric is attached to. Default: - Deployment region.
9584
9683
  :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
9684
  :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
9685
+ :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
9686
  '''
9587
9687
  props = MetricOptions(
9588
9688
  account=account,
9589
9689
  color=color,
9590
9690
  dimensions_map=dimensions_map,
9691
+ id=id,
9591
9692
  label=label,
9592
9693
  period=period,
9593
9694
  region=region,
@@ -9595,6 +9696,7 @@ class Metric(metaclass=jsii.JSIIMeta, jsii_type="aws-cdk-lib.aws_cloudwatch.Metr
9595
9696
  stack_region=stack_region,
9596
9697
  statistic=statistic,
9597
9698
  unit=unit,
9699
+ visible=visible,
9598
9700
  )
9599
9701
 
9600
9702
  return typing.cast("Metric", jsii.invoke(self, "with", [props]))
@@ -9641,6 +9743,12 @@ class Metric(metaclass=jsii.JSIIMeta, jsii_type="aws-cdk-lib.aws_cloudwatch.Metr
9641
9743
  '''Dimensions of this metric.'''
9642
9744
  return typing.cast(typing.Optional[typing.Mapping[builtins.str, typing.Any]], jsii.get(self, "dimensions"))
9643
9745
 
9746
+ @builtins.property
9747
+ @jsii.member(jsii_name="id")
9748
+ def id(self) -> typing.Optional[builtins.str]:
9749
+ '''Unique identifier for this metric when used in dashboard widgets.'''
9750
+ return typing.cast(typing.Optional[builtins.str], jsii.get(self, "id"))
9751
+
9644
9752
  @builtins.property
9645
9753
  @jsii.member(jsii_name="label")
9646
9754
  def label(self) -> typing.Optional[builtins.str]:
@@ -9659,6 +9767,12 @@ class Metric(metaclass=jsii.JSIIMeta, jsii_type="aws-cdk-lib.aws_cloudwatch.Metr
9659
9767
  '''Unit of the metric.'''
9660
9768
  return typing.cast(typing.Optional["Unit"], jsii.get(self, "unit"))
9661
9769
 
9770
+ @builtins.property
9771
+ @jsii.member(jsii_name="visible")
9772
+ def visible(self) -> typing.Optional[builtins.bool]:
9773
+ '''Whether this metric should be visible in dashboard graphs.'''
9774
+ return typing.cast(typing.Optional[builtins.bool], jsii.get(self, "visible"))
9775
+
9662
9776
  @builtins.property
9663
9777
  @jsii.member(jsii_name="warnings")
9664
9778
  def warnings(self) -> typing.Optional[typing.List[builtins.str]]:
@@ -9936,6 +10050,7 @@ class MetricExpressionConfig:
9936
10050
  "account": "account",
9937
10051
  "color": "color",
9938
10052
  "dimensions_map": "dimensionsMap",
10053
+ "id": "id",
9939
10054
  "label": "label",
9940
10055
  "period": "period",
9941
10056
  "region": "region",
@@ -9943,6 +10058,7 @@ class MetricExpressionConfig:
9943
10058
  "stack_region": "stackRegion",
9944
10059
  "statistic": "statistic",
9945
10060
  "unit": "unit",
10061
+ "visible": "visible",
9946
10062
  },
9947
10063
  )
9948
10064
  class MetricOptions(CommonMetricOptions):
@@ -9952,6 +10068,7 @@ class MetricOptions(CommonMetricOptions):
9952
10068
  account: typing.Optional[builtins.str] = None,
9953
10069
  color: typing.Optional[builtins.str] = None,
9954
10070
  dimensions_map: typing.Optional[typing.Mapping[builtins.str, builtins.str]] = None,
10071
+ id: typing.Optional[builtins.str] = None,
9955
10072
  label: typing.Optional[builtins.str] = None,
9956
10073
  period: typing.Optional[_Duration_4839e8c3] = None,
9957
10074
  region: typing.Optional[builtins.str] = None,
@@ -9959,12 +10076,14 @@ class MetricOptions(CommonMetricOptions):
9959
10076
  stack_region: typing.Optional[builtins.str] = None,
9960
10077
  statistic: typing.Optional[builtins.str] = None,
9961
10078
  unit: typing.Optional["Unit"] = None,
10079
+ visible: typing.Optional[builtins.bool] = None,
9962
10080
  ) -> None:
9963
10081
  '''Properties of a metric that can be changed.
9964
10082
 
9965
10083
  :param account: Account which this metric comes from. Default: - Deployment account.
9966
10084
  :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
10085
  :param dimensions_map: Dimensions of the metric. Default: - No dimensions.
10086
+ :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
10087
  :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
10088
  :param period: The period over which the specified statistic is applied. Default: Duration.minutes(5)
9970
10089
  :param region: Region which this metric comes from. Default: - Deployment region.
@@ -9972,6 +10091,7 @@ class MetricOptions(CommonMetricOptions):
9972
10091
  :param stack_region: Region of the stack this metric is attached to. Default: - Deployment region.
9973
10092
  :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
10093
  :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
10094
+ :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
10095
 
9976
10096
  :exampleMetadata: infused
9977
10097
 
@@ -10002,6 +10122,7 @@ class MetricOptions(CommonMetricOptions):
10002
10122
  check_type(argname="argument account", value=account, expected_type=type_hints["account"])
10003
10123
  check_type(argname="argument color", value=color, expected_type=type_hints["color"])
10004
10124
  check_type(argname="argument dimensions_map", value=dimensions_map, expected_type=type_hints["dimensions_map"])
10125
+ check_type(argname="argument id", value=id, expected_type=type_hints["id"])
10005
10126
  check_type(argname="argument label", value=label, expected_type=type_hints["label"])
10006
10127
  check_type(argname="argument period", value=period, expected_type=type_hints["period"])
10007
10128
  check_type(argname="argument region", value=region, expected_type=type_hints["region"])
@@ -10009,6 +10130,7 @@ class MetricOptions(CommonMetricOptions):
10009
10130
  check_type(argname="argument stack_region", value=stack_region, expected_type=type_hints["stack_region"])
10010
10131
  check_type(argname="argument statistic", value=statistic, expected_type=type_hints["statistic"])
10011
10132
  check_type(argname="argument unit", value=unit, expected_type=type_hints["unit"])
10133
+ check_type(argname="argument visible", value=visible, expected_type=type_hints["visible"])
10012
10134
  self._values: typing.Dict[builtins.str, typing.Any] = {}
10013
10135
  if account is not None:
10014
10136
  self._values["account"] = account
@@ -10016,6 +10138,8 @@ class MetricOptions(CommonMetricOptions):
10016
10138
  self._values["color"] = color
10017
10139
  if dimensions_map is not None:
10018
10140
  self._values["dimensions_map"] = dimensions_map
10141
+ if id is not None:
10142
+ self._values["id"] = id
10019
10143
  if label is not None:
10020
10144
  self._values["label"] = label
10021
10145
  if period is not None:
@@ -10030,6 +10154,8 @@ class MetricOptions(CommonMetricOptions):
10030
10154
  self._values["statistic"] = statistic
10031
10155
  if unit is not None:
10032
10156
  self._values["unit"] = unit
10157
+ if visible is not None:
10158
+ self._values["visible"] = visible
10033
10159
 
10034
10160
  @builtins.property
10035
10161
  def account(self) -> typing.Optional[builtins.str]:
@@ -10060,6 +10186,19 @@ class MetricOptions(CommonMetricOptions):
10060
10186
  result = self._values.get("dimensions_map")
10061
10187
  return typing.cast(typing.Optional[typing.Mapping[builtins.str, builtins.str]], result)
10062
10188
 
10189
+ @builtins.property
10190
+ def id(self) -> typing.Optional[builtins.str]:
10191
+ '''Unique identifier for this metric when used in dashboard widgets.
10192
+
10193
+ The id can be used as a variable to represent this metric in math expressions.
10194
+ Valid characters are letters, numbers, and underscore. The first character
10195
+ must be a lowercase letter.
10196
+
10197
+ :default: - No ID
10198
+ '''
10199
+ result = self._values.get("id")
10200
+ return typing.cast(typing.Optional[builtins.str], result)
10201
+
10063
10202
  @builtins.property
10064
10203
  def label(self) -> typing.Optional[builtins.str]:
10065
10204
  '''Label for this metric when added to a Graph in a Dashboard.
@@ -10157,6 +10296,18 @@ class MetricOptions(CommonMetricOptions):
10157
10296
  result = self._values.get("unit")
10158
10297
  return typing.cast(typing.Optional["Unit"], result)
10159
10298
 
10299
+ @builtins.property
10300
+ def visible(self) -> typing.Optional[builtins.bool]:
10301
+ '''Whether this metric should be visible in dashboard graphs.
10302
+
10303
+ Setting this to false is useful when you want to hide raw metrics
10304
+ that are used in math expressions, and show only the expression results.
10305
+
10306
+ :default: true
10307
+ '''
10308
+ result = self._values.get("visible")
10309
+ return typing.cast(typing.Optional[builtins.bool], result)
10310
+
10160
10311
  def __eq__(self, rhs: typing.Any) -> builtins.bool:
10161
10312
  return isinstance(rhs, self.__class__) and rhs._values == self._values
10162
10313
 
@@ -10176,6 +10327,7 @@ class MetricOptions(CommonMetricOptions):
10176
10327
  "account": "account",
10177
10328
  "color": "color",
10178
10329
  "dimensions_map": "dimensionsMap",
10330
+ "id": "id",
10179
10331
  "label": "label",
10180
10332
  "period": "period",
10181
10333
  "region": "region",
@@ -10183,6 +10335,7 @@ class MetricOptions(CommonMetricOptions):
10183
10335
  "stack_region": "stackRegion",
10184
10336
  "statistic": "statistic",
10185
10337
  "unit": "unit",
10338
+ "visible": "visible",
10186
10339
  "metric_name": "metricName",
10187
10340
  "namespace": "namespace",
10188
10341
  },
@@ -10194,6 +10347,7 @@ class MetricProps(CommonMetricOptions):
10194
10347
  account: typing.Optional[builtins.str] = None,
10195
10348
  color: typing.Optional[builtins.str] = None,
10196
10349
  dimensions_map: typing.Optional[typing.Mapping[builtins.str, builtins.str]] = None,
10350
+ id: typing.Optional[builtins.str] = None,
10197
10351
  label: typing.Optional[builtins.str] = None,
10198
10352
  period: typing.Optional[_Duration_4839e8c3] = None,
10199
10353
  region: typing.Optional[builtins.str] = None,
@@ -10201,6 +10355,7 @@ class MetricProps(CommonMetricOptions):
10201
10355
  stack_region: typing.Optional[builtins.str] = None,
10202
10356
  statistic: typing.Optional[builtins.str] = None,
10203
10357
  unit: typing.Optional["Unit"] = None,
10358
+ visible: typing.Optional[builtins.bool] = None,
10204
10359
  metric_name: builtins.str,
10205
10360
  namespace: builtins.str,
10206
10361
  ) -> None:
@@ -10209,6 +10364,7 @@ class MetricProps(CommonMetricOptions):
10209
10364
  :param account: Account which this metric comes from. Default: - Deployment account.
10210
10365
  :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
10366
  :param dimensions_map: Dimensions of the metric. Default: - No dimensions.
10367
+ :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
10368
  :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
10369
  :param period: The period over which the specified statistic is applied. Default: Duration.minutes(5)
10214
10370
  :param region: Region which this metric comes from. Default: - Deployment region.
@@ -10216,6 +10372,7 @@ class MetricProps(CommonMetricOptions):
10216
10372
  :param stack_region: Region of the stack this metric is attached to. Default: - Deployment region.
10217
10373
  :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
10374
  :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
10375
+ :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
10376
  :param metric_name: Name of the metric.
10220
10377
  :param namespace: Namespace of the metric.
10221
10378
 
@@ -10248,6 +10405,7 @@ class MetricProps(CommonMetricOptions):
10248
10405
  check_type(argname="argument account", value=account, expected_type=type_hints["account"])
10249
10406
  check_type(argname="argument color", value=color, expected_type=type_hints["color"])
10250
10407
  check_type(argname="argument dimensions_map", value=dimensions_map, expected_type=type_hints["dimensions_map"])
10408
+ check_type(argname="argument id", value=id, expected_type=type_hints["id"])
10251
10409
  check_type(argname="argument label", value=label, expected_type=type_hints["label"])
10252
10410
  check_type(argname="argument period", value=period, expected_type=type_hints["period"])
10253
10411
  check_type(argname="argument region", value=region, expected_type=type_hints["region"])
@@ -10255,6 +10413,7 @@ class MetricProps(CommonMetricOptions):
10255
10413
  check_type(argname="argument stack_region", value=stack_region, expected_type=type_hints["stack_region"])
10256
10414
  check_type(argname="argument statistic", value=statistic, expected_type=type_hints["statistic"])
10257
10415
  check_type(argname="argument unit", value=unit, expected_type=type_hints["unit"])
10416
+ check_type(argname="argument visible", value=visible, expected_type=type_hints["visible"])
10258
10417
  check_type(argname="argument metric_name", value=metric_name, expected_type=type_hints["metric_name"])
10259
10418
  check_type(argname="argument namespace", value=namespace, expected_type=type_hints["namespace"])
10260
10419
  self._values: typing.Dict[builtins.str, typing.Any] = {
@@ -10267,6 +10426,8 @@ class MetricProps(CommonMetricOptions):
10267
10426
  self._values["color"] = color
10268
10427
  if dimensions_map is not None:
10269
10428
  self._values["dimensions_map"] = dimensions_map
10429
+ if id is not None:
10430
+ self._values["id"] = id
10270
10431
  if label is not None:
10271
10432
  self._values["label"] = label
10272
10433
  if period is not None:
@@ -10281,6 +10442,8 @@ class MetricProps(CommonMetricOptions):
10281
10442
  self._values["statistic"] = statistic
10282
10443
  if unit is not None:
10283
10444
  self._values["unit"] = unit
10445
+ if visible is not None:
10446
+ self._values["visible"] = visible
10284
10447
 
10285
10448
  @builtins.property
10286
10449
  def account(self) -> typing.Optional[builtins.str]:
@@ -10311,6 +10474,19 @@ class MetricProps(CommonMetricOptions):
10311
10474
  result = self._values.get("dimensions_map")
10312
10475
  return typing.cast(typing.Optional[typing.Mapping[builtins.str, builtins.str]], result)
10313
10476
 
10477
+ @builtins.property
10478
+ def id(self) -> typing.Optional[builtins.str]:
10479
+ '''Unique identifier for this metric when used in dashboard widgets.
10480
+
10481
+ The id can be used as a variable to represent this metric in math expressions.
10482
+ Valid characters are letters, numbers, and underscore. The first character
10483
+ must be a lowercase letter.
10484
+
10485
+ :default: - No ID
10486
+ '''
10487
+ result = self._values.get("id")
10488
+ return typing.cast(typing.Optional[builtins.str], result)
10489
+
10314
10490
  @builtins.property
10315
10491
  def label(self) -> typing.Optional[builtins.str]:
10316
10492
  '''Label for this metric when added to a Graph in a Dashboard.
@@ -10408,6 +10584,18 @@ class MetricProps(CommonMetricOptions):
10408
10584
  result = self._values.get("unit")
10409
10585
  return typing.cast(typing.Optional["Unit"], result)
10410
10586
 
10587
+ @builtins.property
10588
+ def visible(self) -> typing.Optional[builtins.bool]:
10589
+ '''Whether this metric should be visible in dashboard graphs.
10590
+
10591
+ Setting this to false is useful when you want to hide raw metrics
10592
+ that are used in math expressions, and show only the expression results.
10593
+
10594
+ :default: true
10595
+ '''
10596
+ result = self._values.get("visible")
10597
+ return typing.cast(typing.Optional[builtins.bool], result)
10598
+
10411
10599
  @builtins.property
10412
10600
  def metric_name(self) -> builtins.str:
10413
10601
  '''Name of the metric.'''
@@ -16925,6 +17113,7 @@ def _typecheckingstub__dd18f372aac3bb8d4a678dd4ee7a3b5bd34447637695b896086139ee2
16925
17113
  account: typing.Optional[builtins.str] = None,
16926
17114
  color: typing.Optional[builtins.str] = None,
16927
17115
  dimensions_map: typing.Optional[typing.Mapping[builtins.str, builtins.str]] = None,
17116
+ id: typing.Optional[builtins.str] = None,
16928
17117
  label: typing.Optional[builtins.str] = None,
16929
17118
  period: typing.Optional[_Duration_4839e8c3] = None,
16930
17119
  region: typing.Optional[builtins.str] = None,
@@ -16932,6 +17121,7 @@ def _typecheckingstub__dd18f372aac3bb8d4a678dd4ee7a3b5bd34447637695b896086139ee2
16932
17121
  stack_region: typing.Optional[builtins.str] = None,
16933
17122
  statistic: typing.Optional[builtins.str] = None,
16934
17123
  unit: typing.Optional[Unit] = None,
17124
+ visible: typing.Optional[builtins.bool] = None,
16935
17125
  ) -> None:
16936
17126
  """Type checking stubs"""
16937
17127
  pass
@@ -17181,6 +17371,7 @@ def _typecheckingstub__0dbe737a4d124c27184430b7c20048e16171cb8b5b94bdac632b26d84
17181
17371
  account: typing.Optional[builtins.str] = None,
17182
17372
  color: typing.Optional[builtins.str] = None,
17183
17373
  dimensions_map: typing.Optional[typing.Mapping[builtins.str, builtins.str]] = None,
17374
+ id: typing.Optional[builtins.str] = None,
17184
17375
  label: typing.Optional[builtins.str] = None,
17185
17376
  period: typing.Optional[_Duration_4839e8c3] = None,
17186
17377
  region: typing.Optional[builtins.str] = None,
@@ -17188,6 +17379,7 @@ def _typecheckingstub__0dbe737a4d124c27184430b7c20048e16171cb8b5b94bdac632b26d84
17188
17379
  stack_region: typing.Optional[builtins.str] = None,
17189
17380
  statistic: typing.Optional[builtins.str] = None,
17190
17381
  unit: typing.Optional[Unit] = None,
17382
+ visible: typing.Optional[builtins.bool] = None,
17191
17383
  ) -> None:
17192
17384
  """Type checking stubs"""
17193
17385
  pass
@@ -17197,6 +17389,7 @@ def _typecheckingstub__5e1e153a11ab88ed91297aedb5d7a78a81e7bf88f8aeda51bc11ff42e
17197
17389
  account: typing.Optional[builtins.str] = None,
17198
17390
  color: typing.Optional[builtins.str] = None,
17199
17391
  dimensions_map: typing.Optional[typing.Mapping[builtins.str, builtins.str]] = None,
17392
+ id: typing.Optional[builtins.str] = None,
17200
17393
  label: typing.Optional[builtins.str] = None,
17201
17394
  period: typing.Optional[_Duration_4839e8c3] = None,
17202
17395
  region: typing.Optional[builtins.str] = None,
@@ -17204,6 +17397,7 @@ def _typecheckingstub__5e1e153a11ab88ed91297aedb5d7a78a81e7bf88f8aeda51bc11ff42e
17204
17397
  stack_region: typing.Optional[builtins.str] = None,
17205
17398
  statistic: typing.Optional[builtins.str] = None,
17206
17399
  unit: typing.Optional[Unit] = None,
17400
+ visible: typing.Optional[builtins.bool] = None,
17207
17401
  metric_name: builtins.str,
17208
17402
  namespace: builtins.str,
17209
17403
  ) -> None: