aws-cdk-lib 2.176.0__py3-none-any.whl → 2.178.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 (120) hide show
  1. aws_cdk/__init__.py +106 -62
  2. aws_cdk/_jsii/__init__.py +1 -1
  3. aws_cdk/_jsii/{aws-cdk-lib@2.176.0.jsii.tgz → aws-cdk-lib@2.178.0.jsii.tgz} +0 -0
  4. aws_cdk/aws_amplifyuibuilder/__init__.py +8 -8
  5. aws_cdk/aws_apigateway/__init__.py +97 -97
  6. aws_cdk/aws_apigatewayv2/__init__.py +35 -10
  7. aws_cdk/aws_apigatewayv2_integrations/__init__.py +2 -2
  8. aws_cdk/aws_appconfig/__init__.py +10 -10
  9. aws_cdk/aws_appflow/__init__.py +20 -20
  10. aws_cdk/aws_applicationsignals/__init__.py +8 -8
  11. aws_cdk/aws_appmesh/__init__.py +8 -8
  12. aws_cdk/aws_appsync/__init__.py +10387 -7038
  13. aws_cdk/aws_apptest/__init__.py +4 -4
  14. aws_cdk/aws_aps/__init__.py +135 -0
  15. aws_cdk/aws_athena/__init__.py +10 -10
  16. aws_cdk/aws_backup/__init__.py +14 -14
  17. aws_cdk/aws_batch/__init__.py +189 -24
  18. aws_cdk/aws_bcmdataexports/__init__.py +4 -4
  19. aws_cdk/aws_bedrock/__init__.py +5494 -2518
  20. aws_cdk/aws_certificatemanager/__init__.py +15 -14
  21. aws_cdk/aws_chatbot/__init__.py +4 -4
  22. aws_cdk/aws_cloudformation/__init__.py +22 -18
  23. aws_cdk/aws_cloudfront/__init__.py +686 -9
  24. aws_cdk/aws_cloudfront_origins/__init__.py +73 -2
  25. aws_cdk/aws_cloudtrail/__init__.py +4 -4
  26. aws_cdk/aws_cloudwatch/__init__.py +53 -53
  27. aws_cdk/aws_codedeploy/__init__.py +2 -2
  28. aws_cdk/aws_codepipeline/__init__.py +59 -6
  29. aws_cdk/aws_codepipeline_actions/__init__.py +2 -2
  30. aws_cdk/aws_cognito/__init__.py +204 -159
  31. aws_cdk/aws_connect/__init__.py +4 -4
  32. aws_cdk/aws_customerprofiles/__init__.py +6 -4
  33. aws_cdk/aws_databrew/__init__.py +16 -16
  34. aws_cdk/aws_datasync/__init__.py +14 -11
  35. aws_cdk/aws_datazone/__init__.py +199 -129
  36. aws_cdk/aws_dms/__init__.py +4 -4
  37. aws_cdk/aws_dynamodb/__init__.py +267 -25
  38. aws_cdk/aws_ec2/__init__.py +1142 -184
  39. aws_cdk/aws_ecs/__init__.py +767 -124
  40. aws_cdk/aws_ecs_patterns/__init__.py +49 -0
  41. aws_cdk/aws_efs/__init__.py +8 -8
  42. aws_cdk/aws_eks/__init__.py +55 -35
  43. aws_cdk/aws_elasticache/__init__.py +10 -10
  44. aws_cdk/aws_elasticloadbalancingv2/__init__.py +47 -18
  45. aws_cdk/aws_elasticsearch/__init__.py +10 -10
  46. aws_cdk/aws_emr/__init__.py +16 -16
  47. aws_cdk/aws_emrserverless/__init__.py +93 -4
  48. aws_cdk/aws_entityresolution/__init__.py +31 -17
  49. aws_cdk/aws_events/__init__.py +12 -12
  50. aws_cdk/aws_fis/__init__.py +16 -16
  51. aws_cdk/aws_fms/__init__.py +46 -0
  52. aws_cdk/aws_gamelift/__init__.py +8 -10
  53. aws_cdk/aws_glue/__init__.py +1326 -7
  54. aws_cdk/aws_greengrassv2/__init__.py +8 -8
  55. aws_cdk/aws_guardduty/__init__.py +521 -0
  56. aws_cdk/aws_healthlake/__init__.py +10 -2
  57. aws_cdk/aws_iam/__init__.py +8 -0
  58. aws_cdk/aws_imagebuilder/__init__.py +88 -74
  59. aws_cdk/aws_iot/__init__.py +40 -40
  60. aws_cdk/aws_iotanalytics/__init__.py +4 -4
  61. aws_cdk/aws_iotfleetwise/__init__.py +424 -10
  62. aws_cdk/aws_iotsitewise/__init__.py +84 -13
  63. aws_cdk/aws_iottwinmaker/__init__.py +18 -18
  64. aws_cdk/aws_iotwireless/__init__.py +4 -4
  65. aws_cdk/aws_kafkaconnect/__init__.py +10 -10
  66. aws_cdk/aws_kendra/__init__.py +0 -10
  67. aws_cdk/aws_kinesisanalytics/__init__.py +4 -4
  68. aws_cdk/aws_kinesisanalyticsv2/__init__.py +4 -4
  69. aws_cdk/aws_kinesisfirehose/__init__.py +4544 -183
  70. aws_cdk/aws_kms/__init__.py +11 -10
  71. aws_cdk/aws_lambda/__init__.py +47 -4
  72. aws_cdk/aws_lambda_nodejs/__init__.py +24 -5
  73. aws_cdk/aws_launchwizard/__init__.py +10 -10
  74. aws_cdk/aws_logs/__init__.py +78 -74
  75. aws_cdk/aws_mediaconnect/__init__.py +509 -12
  76. aws_cdk/aws_medialive/__init__.py +16 -16
  77. aws_cdk/aws_mediatailor/__init__.py +10 -10
  78. aws_cdk/aws_networkfirewall/__init__.py +12 -12
  79. aws_cdk/aws_notifications/__init__.py +1927 -0
  80. aws_cdk/aws_notificationscontacts/__init__.py +593 -0
  81. aws_cdk/aws_omics/__init__.py +4 -4
  82. aws_cdk/aws_opensearchservice/__init__.py +10 -10
  83. aws_cdk/aws_opsworks/__init__.py +58 -58
  84. aws_cdk/aws_personalize/__init__.py +8 -8
  85. aws_cdk/aws_pipes/__init__.py +20 -20
  86. aws_cdk/aws_qbusiness/__init__.py +119 -0
  87. aws_cdk/aws_quicksight/__init__.py +247 -92
  88. aws_cdk/aws_rds/__init__.py +37 -37
  89. aws_cdk/aws_redshift/__init__.py +19 -15
  90. aws_cdk/aws_resiliencehub/__init__.py +0 -41
  91. aws_cdk/aws_route53/__init__.py +10 -4
  92. aws_cdk/aws_route53_targets/__init__.py +15 -15
  93. aws_cdk/aws_rum/__init__.py +4 -4
  94. aws_cdk/aws_s3/__init__.py +801 -2
  95. aws_cdk/aws_s3_notifications/__init__.py +5 -5
  96. aws_cdk/aws_s3tables/__init__.py +2 -2
  97. aws_cdk/aws_sagemaker/__init__.py +84 -60
  98. aws_cdk/aws_sam/__init__.py +48 -48
  99. aws_cdk/aws_secretsmanager/__init__.py +30 -14
  100. aws_cdk/aws_securityhub/__init__.py +12 -12
  101. aws_cdk/aws_sns/__init__.py +137 -12
  102. aws_cdk/aws_ssm/__init__.py +5 -5
  103. aws_cdk/aws_ssmquicksetup/__init__.py +10 -10
  104. aws_cdk/aws_stepfunctions/__init__.py +13207 -4740
  105. aws_cdk/aws_stepfunctions_tasks/__init__.py +77615 -22817
  106. aws_cdk/aws_synthetics/__init__.py +109 -36
  107. aws_cdk/aws_timestream/__init__.py +41 -0
  108. aws_cdk/aws_transfer/__init__.py +9 -10
  109. aws_cdk/aws_wafv2/__init__.py +24 -22
  110. aws_cdk/aws_wisdom/__init__.py +8 -8
  111. aws_cdk/aws_workspacesweb/__init__.py +60 -60
  112. aws_cdk/aws_xray/__init__.py +8 -8
  113. aws_cdk/cloud_assembly_schema/__init__.py +63 -4
  114. aws_cdk/cx_api/__init__.py +62 -4
  115. {aws_cdk_lib-2.176.0.dist-info → aws_cdk_lib-2.178.0.dist-info}/METADATA +3 -3
  116. {aws_cdk_lib-2.176.0.dist-info → aws_cdk_lib-2.178.0.dist-info}/RECORD +120 -118
  117. {aws_cdk_lib-2.176.0.dist-info → aws_cdk_lib-2.178.0.dist-info}/LICENSE +0 -0
  118. {aws_cdk_lib-2.176.0.dist-info → aws_cdk_lib-2.178.0.dist-info}/NOTICE +0 -0
  119. {aws_cdk_lib-2.176.0.dist-info → aws_cdk_lib-2.178.0.dist-info}/WHEEL +0 -0
  120. {aws_cdk_lib-2.176.0.dist-info → aws_cdk_lib-2.178.0.dist-info}/top_level.txt +0 -0
@@ -74,7 +74,7 @@ cloudfront.Distribution(self, "myDist",
74
74
 
75
75
  When creating a standard S3 origin using `origins.S3BucketOrigin.withOriginAccessControl()`, an [Origin Access Control resource](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-originaccesscontrol-originaccesscontrolconfig.html) is automatically created with the origin type set to `s3` and signing behavior set to `always`.
76
76
 
77
- You can grant read, write or delete access to the OAC using the `originAccessLevels` property:
77
+ You can grant read, list, write or delete access to the OAC using the `originAccessLevels` property:
78
78
 
79
79
  ```python
80
80
  my_bucket = s3.Bucket(self, "myBucket")
@@ -83,6 +83,8 @@ s3_origin = origins.S3BucketOrigin.with_origin_access_control(my_bucket,
83
83
  )
84
84
  ```
85
85
 
86
+ For details of list permission, see [Setting up OAC with LIST permission](#setting-up-oac-with-list-permission).
87
+
86
88
  You can also pass in a custom S3 origin access control:
87
89
 
88
90
  ```python
@@ -336,6 +338,29 @@ See CloudFront docs on [Giving the origin access control permission to access th
336
338
  > Note: If your bucket previously used OAI, you will need to manually remove the policy statement
337
339
  > that gives the OAI access to your bucket after setting up OAC.
338
340
 
341
+ #### Setting up OAC with LIST permission
342
+
343
+ By default, S3 origin returns 403 Forbidden HTTP response when the requested object does not exist.
344
+ When you want to receive 404 Not Found, specify `AccessLevel.LIST` in `originAccessLevels` to add `s3:ListBucket` permission in the bucket policy.
345
+
346
+ This is useful to distinguish between responses blocked by WAF (403) and responses where the file does not exist (404).
347
+
348
+ ```python
349
+ my_bucket = s3.Bucket(self, "myBucket")
350
+ s3_origin = origins.S3BucketOrigin.with_origin_access_control(my_bucket,
351
+ origin_access_levels=[cloudfront.AccessLevel.READ, cloudfront.AccessLevel.LIST]
352
+ )
353
+ cloudfront.Distribution(self, "distribution",
354
+ default_behavior=cloudfront.BehaviorOptions(
355
+ origin=s3_origin
356
+ ),
357
+ default_root_object="index.html"
358
+ )
359
+ ```
360
+
361
+ When the origin is associated to the default behavior, it is highly recommended to specify `defaultRootObject` distribution property.
362
+ Without it, the root path `https://xxxx.cloudfront.net/` will return the list of the S3 object keys.
363
+
339
364
  #### Setting up an OAI (legacy)
340
365
 
341
366
  Setup an S3 origin with origin access identity (legacy) as follows:
@@ -595,6 +620,24 @@ cloudfront.Distribution(self, "myDist",
595
620
  )
596
621
  ```
597
622
 
623
+ ### Selection Criteria: Media Quality Based with AWS Elemental MediaPackageV2
624
+
625
+ You can setup your origin group to be configured for media quality based failover with your AWS Elemental MediaPackageV2 endpoints.
626
+ You can achieve this behavior in the CDK, again using the `OriginGroup` class:
627
+
628
+ ```python
629
+ cloudfront.Distribution(self, "myDist",
630
+ default_behavior=cloudfront.BehaviorOptions(
631
+ origin=origins.OriginGroup(
632
+ primary_origin=origins.HttpOrigin("<AWS Elemental MediaPackageV2 origin 1>"),
633
+ fallback_origin=origins.HttpOrigin("<AWS Elemental MediaPackageV2 origin 2>"),
634
+ fallback_status_codes=[404],
635
+ selection_criteria=cloudfront.OriginSelectionCriteria.MEDIA_QUALITY_BASED
636
+ )
637
+ )
638
+ )
639
+ ```
640
+
598
641
  ## From an API Gateway REST API
599
642
 
600
643
  Origins can be created from an API Gateway REST API. It is recommended to use a
@@ -727,6 +770,7 @@ from ..aws_cloudfront import (
727
770
  OriginBindOptions as _OriginBindOptions_088c2b51,
728
771
  OriginProps as _OriginProps_0675928d,
729
772
  OriginProtocolPolicy as _OriginProtocolPolicy_967ed73c,
773
+ OriginSelectionCriteria as _OriginSelectionCriteria_ba6d3e21,
730
774
  OriginSslPolicy as _OriginSslPolicy_d65cede2,
731
775
  )
732
776
  from ..aws_elasticloadbalancingv2 import ILoadBalancerV2 as _ILoadBalancerV2_4c5c0fbb
@@ -2311,16 +2355,19 @@ class OriginGroup(
2311
2355
  fallback_origin: _IOrigin_83d4c1fa,
2312
2356
  primary_origin: _IOrigin_83d4c1fa,
2313
2357
  fallback_status_codes: typing.Optional[typing.Sequence[jsii.Number]] = None,
2358
+ selection_criteria: typing.Optional[_OriginSelectionCriteria_ba6d3e21] = None,
2314
2359
  ) -> None:
2315
2360
  '''
2316
2361
  :param fallback_origin: The fallback origin that should serve requests when the primary fails.
2317
2362
  :param primary_origin: The primary origin that should serve requests for this group.
2318
2363
  :param fallback_status_codes: The list of HTTP status codes that, when returned from the primary origin, would cause querying the fallback origin. Default: - 500, 502, 503 and 504
2364
+ :param selection_criteria: The selection criteria for the origin group. Default: - OriginSelectionCriteria.DEFAULT
2319
2365
  '''
2320
2366
  props = OriginGroupProps(
2321
2367
  fallback_origin=fallback_origin,
2322
2368
  primary_origin=primary_origin,
2323
2369
  fallback_status_codes=fallback_status_codes,
2370
+ selection_criteria=selection_criteria,
2324
2371
  )
2325
2372
 
2326
2373
  jsii.create(self.__class__, self, [props])
@@ -2356,6 +2403,7 @@ class OriginGroup(
2356
2403
  "fallback_origin": "fallbackOrigin",
2357
2404
  "primary_origin": "primaryOrigin",
2358
2405
  "fallback_status_codes": "fallbackStatusCodes",
2406
+ "selection_criteria": "selectionCriteria",
2359
2407
  },
2360
2408
  )
2361
2409
  class OriginGroupProps:
@@ -2365,12 +2413,14 @@ class OriginGroupProps:
2365
2413
  fallback_origin: _IOrigin_83d4c1fa,
2366
2414
  primary_origin: _IOrigin_83d4c1fa,
2367
2415
  fallback_status_codes: typing.Optional[typing.Sequence[jsii.Number]] = None,
2416
+ selection_criteria: typing.Optional[_OriginSelectionCriteria_ba6d3e21] = None,
2368
2417
  ) -> None:
2369
2418
  '''Construction properties for ``OriginGroup``.
2370
2419
 
2371
2420
  :param fallback_origin: The fallback origin that should serve requests when the primary fails.
2372
2421
  :param primary_origin: The primary origin that should serve requests for this group.
2373
2422
  :param fallback_status_codes: The list of HTTP status codes that, when returned from the primary origin, would cause querying the fallback origin. Default: - 500, 502, 503 and 504
2423
+ :param selection_criteria: The selection criteria for the origin group. Default: - OriginSelectionCriteria.DEFAULT
2374
2424
 
2375
2425
  :exampleMetadata: infused
2376
2426
 
@@ -2393,12 +2443,15 @@ class OriginGroupProps:
2393
2443
  check_type(argname="argument fallback_origin", value=fallback_origin, expected_type=type_hints["fallback_origin"])
2394
2444
  check_type(argname="argument primary_origin", value=primary_origin, expected_type=type_hints["primary_origin"])
2395
2445
  check_type(argname="argument fallback_status_codes", value=fallback_status_codes, expected_type=type_hints["fallback_status_codes"])
2446
+ check_type(argname="argument selection_criteria", value=selection_criteria, expected_type=type_hints["selection_criteria"])
2396
2447
  self._values: typing.Dict[builtins.str, typing.Any] = {
2397
2448
  "fallback_origin": fallback_origin,
2398
2449
  "primary_origin": primary_origin,
2399
2450
  }
2400
2451
  if fallback_status_codes is not None:
2401
2452
  self._values["fallback_status_codes"] = fallback_status_codes
2453
+ if selection_criteria is not None:
2454
+ self._values["selection_criteria"] = selection_criteria
2402
2455
 
2403
2456
  @builtins.property
2404
2457
  def fallback_origin(self) -> _IOrigin_83d4c1fa:
@@ -2423,6 +2476,17 @@ class OriginGroupProps:
2423
2476
  result = self._values.get("fallback_status_codes")
2424
2477
  return typing.cast(typing.Optional[typing.List[jsii.Number]], result)
2425
2478
 
2479
+ @builtins.property
2480
+ def selection_criteria(self) -> typing.Optional[_OriginSelectionCriteria_ba6d3e21]:
2481
+ '''The selection criteria for the origin group.
2482
+
2483
+ :default: - OriginSelectionCriteria.DEFAULT
2484
+
2485
+ :see: https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/high_availability_origin_failover.html#concept_origin_groups.creating
2486
+ '''
2487
+ result = self._values.get("selection_criteria")
2488
+ return typing.cast(typing.Optional[_OriginSelectionCriteria_ba6d3e21], result)
2489
+
2426
2490
  def __eq__(self, rhs: typing.Any) -> builtins.bool:
2427
2491
  return isinstance(rhs, self.__class__) and rhs._values == self._values
2428
2492
 
@@ -3171,7 +3235,13 @@ class S3BucketOriginWithOACProps(S3BucketOriginBaseProps):
3171
3235
 
3172
3236
  my_bucket = s3.Bucket(self, "myBucket")
3173
3237
  s3_origin = origins.S3BucketOrigin.with_origin_access_control(my_bucket,
3174
- origin_access_levels=[cloudfront.AccessLevel.READ, cloudfront.AccessLevel.WRITE, cloudfront.AccessLevel.DELETE]
3238
+ origin_access_levels=[cloudfront.AccessLevel.READ, cloudfront.AccessLevel.LIST]
3239
+ )
3240
+ cloudfront.Distribution(self, "distribution",
3241
+ default_behavior=cloudfront.BehaviorOptions(
3242
+ origin=s3_origin
3243
+ ),
3244
+ default_root_object="index.html"
3175
3245
  )
3176
3246
  '''
3177
3247
  if __debug__:
@@ -4404,6 +4474,7 @@ def _typecheckingstub__3d6baf80fcac5a22fc2c985c83f9022e23b11075b338c076ac86172ff
4404
4474
  fallback_origin: _IOrigin_83d4c1fa,
4405
4475
  primary_origin: _IOrigin_83d4c1fa,
4406
4476
  fallback_status_codes: typing.Optional[typing.Sequence[jsii.Number]] = None,
4477
+ selection_criteria: typing.Optional[_OriginSelectionCriteria_ba6d3e21] = None,
4407
4478
  ) -> None:
4408
4479
  """Type checking stubs"""
4409
4480
  pass
@@ -1170,7 +1170,7 @@ class CfnDashboard(
1170
1170
  *,
1171
1171
  query_statement: builtins.str,
1172
1172
  query_parameters: typing.Optional[typing.Sequence[builtins.str]] = None,
1173
- view_properties: typing.Optional[typing.Union[_IResolvable_da3f097b, typing.Mapping[builtins.str, builtins.str]]] = None,
1173
+ view_properties: typing.Optional[typing.Union[typing.Mapping[builtins.str, builtins.str], _IResolvable_da3f097b]] = None,
1174
1174
  ) -> None:
1175
1175
  '''Contains information about a widget on a CloudTrail Lake dashboard.
1176
1176
 
@@ -1239,7 +1239,7 @@ class CfnDashboard(
1239
1239
  @builtins.property
1240
1240
  def view_properties(
1241
1241
  self,
1242
- ) -> typing.Optional[typing.Union[_IResolvable_da3f097b, typing.Mapping[builtins.str, builtins.str]]]:
1242
+ ) -> typing.Optional[typing.Union[typing.Mapping[builtins.str, builtins.str], _IResolvable_da3f097b]]:
1243
1243
  '''The view properties for the widget.
1244
1244
 
1245
1245
  For more information about view properties, see `View properties for widgets <https://docs.aws.amazon.com/awscloudtrail/latest/userguide/lake-widget-properties.html>`_ in the *AWS CloudTrail User Guide* .
@@ -1247,7 +1247,7 @@ class CfnDashboard(
1247
1247
  :see: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudtrail-dashboard-widget.html#cfn-cloudtrail-dashboard-widget-viewproperties
1248
1248
  '''
1249
1249
  result = self._values.get("view_properties")
1250
- return typing.cast(typing.Optional[typing.Union[_IResolvable_da3f097b, typing.Mapping[builtins.str, builtins.str]]], result)
1250
+ return typing.cast(typing.Optional[typing.Union[typing.Mapping[builtins.str, builtins.str], _IResolvable_da3f097b]], result)
1251
1251
 
1252
1252
  def __eq__(self, rhs: typing.Any) -> builtins.bool:
1253
1253
  return isinstance(rhs, self.__class__) and rhs._values == self._values
@@ -5277,7 +5277,7 @@ def _typecheckingstub__dc8abf1361e0023c8b0a4cba28dced78eff4f36aa3c868efa3feed153
5277
5277
  *,
5278
5278
  query_statement: builtins.str,
5279
5279
  query_parameters: typing.Optional[typing.Sequence[builtins.str]] = None,
5280
- view_properties: typing.Optional[typing.Union[_IResolvable_da3f097b, typing.Mapping[builtins.str, builtins.str]]] = None,
5280
+ view_properties: typing.Optional[typing.Union[typing.Mapping[builtins.str, builtins.str], _IResolvable_da3f097b]] = None,
5281
5281
  ) -> None:
5282
5282
  """Type checking stubs"""
5283
5283
  pass
@@ -1194,7 +1194,7 @@ class AlarmStatusWidgetProps:
1194
1194
  :param alarms: CloudWatch Alarms to show in widget.
1195
1195
  :param height: Height of the widget. Default: 3
1196
1196
  :param sort_by: Specifies how to sort the alarms in the widget. Default: - alphabetical order
1197
- :param states: Use this field to filter the list of alarms displayed in the widget to only those alarms currently in the specified states. You can specify one or more alarm states in the value for this field. The alarm states that you can specify are ALARM, INSUFFICIENT_DATA, and OK. If you omit this field or specify an empty array, all the alarms specifed in alarms are displayed. Default: - all the alarms specified in alarms are displayed.
1197
+ :param states: Use this field to filter the list of alarms displayed in the widget to only those alarms currently in the specified states. You can specify one or more alarm states in the value for this field. The alarm states that you can specify are ALARM, INSUFFICIENT_DATA, and OK. If you omit this field or specify an empty array, all the alarms specified in alarms are displayed. Default: - all the alarms specified in alarms are displayed.
1198
1198
  :param title: The title of the widget. Default: 'Alarm Status'
1199
1199
  :param width: Width of the widget, in a grid of 24 units wide. Default: 6
1200
1200
 
@@ -1265,7 +1265,7 @@ class AlarmStatusWidgetProps:
1265
1265
  You can specify one or more alarm states in the value for this field.
1266
1266
  The alarm states that you can specify are ALARM, INSUFFICIENT_DATA, and OK.
1267
1267
 
1268
- If you omit this field or specify an empty array, all the alarms specifed in alarms are displayed.
1268
+ If you omit this field or specify an empty array, all the alarms specified in alarms are displayed.
1269
1269
 
1270
1270
  :default: - all the alarms specified in alarms are displayed.
1271
1271
  '''
@@ -10847,19 +10847,23 @@ class Statistic(enum.Enum):
10847
10847
 
10848
10848
  Example::
10849
10849
 
10850
- # matchmaking_rule_set: gamelift.MatchmakingRuleSet
10850
+ import aws_cdk.aws_cloudwatch as cloudwatch
10851
10851
 
10852
- # Alarm that triggers when the per-second average of not placed matches exceed 10%
10853
- rule_evaluation_ratio = cloudwatch.MathExpression(
10854
- expression="1 - (ruleEvaluationsPassed / ruleEvaluationsFailed)",
10852
+ # delivery_stream: firehose.DeliveryStream
10853
+
10854
+
10855
+ # Alarm that triggers when the per-second average of incoming bytes exceeds 90% of the current service limit
10856
+ incoming_bytes_percent_of_limit = cloudwatch.MathExpression(
10857
+ expression="incomingBytes / 300 / bytePerSecLimit",
10855
10858
  using_metrics={
10856
- "rule_evaluations_passed": matchmaking_rule_set.metric_rule_evaluations_passed(statistic=cloudwatch.Statistic.SUM),
10857
- "rule_evaluations_failed": matchmaking_rule_set.metric("ruleEvaluationsFailed")
10859
+ "incoming_bytes": delivery_stream.metric_incoming_bytes(statistic=cloudwatch.Statistic.SUM),
10860
+ "byte_per_sec_limit": delivery_stream.metric("BytesPerSecondLimit")
10858
10861
  }
10859
10862
  )
10863
+
10860
10864
  cloudwatch.Alarm(self, "Alarm",
10861
- metric=rule_evaluation_ratio,
10862
- threshold=0.1,
10865
+ metric=incoming_bytes_percent_of_limit,
10866
+ threshold=0.9,
10863
10867
  evaluation_periods=3
10864
10868
  )
10865
10869
  '''
@@ -12590,31 +12594,29 @@ class AlarmProps(CreateAlarmOptions):
12590
12594
 
12591
12595
  Example::
12592
12596
 
12593
- import aws_cdk.aws_cloudwatch as cloudwatch
12597
+ # log_group: logs.LogGroup
12594
12598
 
12595
- # alias: lambda.Alias
12599
+ mf = logs.MetricFilter(self, "MetricFilter",
12600
+ log_group=log_group,
12601
+ metric_namespace="MyApp",
12602
+ metric_name="Latency",
12603
+ filter_pattern=logs.FilterPattern.exists("$.latency"),
12604
+ metric_value="$.latency",
12605
+ dimensions={
12606
+ "ErrorCode": "$.errorCode"
12607
+ },
12608
+ unit=cloudwatch.Unit.MILLISECONDS
12609
+ )
12596
12610
 
12597
- # or add alarms to an existing group
12598
- # blue_green_alias: lambda.Alias
12611
+ # expose a metric from the metric filter
12612
+ metric = mf.metric()
12599
12613
 
12600
- alarm = cloudwatch.Alarm(self, "Errors",
12601
- comparison_operator=cloudwatch.ComparisonOperator.GREATER_THAN_THRESHOLD,
12602
- threshold=1,
12603
- evaluation_periods=1,
12604
- metric=alias.metric_errors()
12605
- )
12606
- deployment_group = codedeploy.LambdaDeploymentGroup(self, "BlueGreenDeployment",
12607
- alias=alias,
12608
- deployment_config=codedeploy.LambdaDeploymentConfig.LINEAR_10PERCENT_EVERY_1MINUTE,
12609
- alarms=[alarm
12610
- ]
12614
+ # you can use the metric to create a new alarm
12615
+ cloudwatch.Alarm(self, "alarm from metric filter",
12616
+ metric=metric,
12617
+ threshold=100,
12618
+ evaluation_periods=2
12611
12619
  )
12612
- deployment_group.add_alarm(cloudwatch.Alarm(self, "BlueGreenErrors",
12613
- comparison_operator=cloudwatch.ComparisonOperator.GREATER_THAN_THRESHOLD,
12614
- threshold=1,
12615
- evaluation_periods=1,
12616
- metric=blue_green_alias.metric_errors()
12617
- ))
12618
12620
  '''
12619
12621
  if __debug__:
12620
12622
  type_hints = typing.get_type_hints(_typecheckingstub__b2e7c873c118fbc1f6cf26e1bb5bd3d8549040c626a6450f2d686bb07b87266b)
@@ -14628,7 +14630,7 @@ class AlarmStatusWidget(
14628
14630
  :param alarms: CloudWatch Alarms to show in widget.
14629
14631
  :param height: Height of the widget. Default: 3
14630
14632
  :param sort_by: Specifies how to sort the alarms in the widget. Default: - alphabetical order
14631
- :param states: Use this field to filter the list of alarms displayed in the widget to only those alarms currently in the specified states. You can specify one or more alarm states in the value for this field. The alarm states that you can specify are ALARM, INSUFFICIENT_DATA, and OK. If you omit this field or specify an empty array, all the alarms specifed in alarms are displayed. Default: - all the alarms specified in alarms are displayed.
14633
+ :param states: Use this field to filter the list of alarms displayed in the widget to only those alarms currently in the specified states. You can specify one or more alarm states in the value for this field. The alarm states that you can specify are ALARM, INSUFFICIENT_DATA, and OK. If you omit this field or specify an empty array, all the alarms specified in alarms are displayed. Default: - all the alarms specified in alarms are displayed.
14632
14634
  :param title: The title of the widget. Default: 'Alarm Status'
14633
14635
  :param width: Width of the widget, in a grid of 24 units wide. Default: 6
14634
14636
  '''
@@ -14859,31 +14861,29 @@ class Alarm(
14859
14861
 
14860
14862
  Example::
14861
14863
 
14862
- import aws_cdk.aws_cloudwatch as cloudwatch
14864
+ # log_group: logs.LogGroup
14863
14865
 
14864
- # alias: lambda.Alias
14866
+ mf = logs.MetricFilter(self, "MetricFilter",
14867
+ log_group=log_group,
14868
+ metric_namespace="MyApp",
14869
+ metric_name="Latency",
14870
+ filter_pattern=logs.FilterPattern.exists("$.latency"),
14871
+ metric_value="$.latency",
14872
+ dimensions={
14873
+ "ErrorCode": "$.errorCode"
14874
+ },
14875
+ unit=cloudwatch.Unit.MILLISECONDS
14876
+ )
14865
14877
 
14866
- # or add alarms to an existing group
14867
- # blue_green_alias: lambda.Alias
14878
+ # expose a metric from the metric filter
14879
+ metric = mf.metric()
14868
14880
 
14869
- alarm = cloudwatch.Alarm(self, "Errors",
14870
- comparison_operator=cloudwatch.ComparisonOperator.GREATER_THAN_THRESHOLD,
14871
- threshold=1,
14872
- evaluation_periods=1,
14873
- metric=alias.metric_errors()
14874
- )
14875
- deployment_group = codedeploy.LambdaDeploymentGroup(self, "BlueGreenDeployment",
14876
- alias=alias,
14877
- deployment_config=codedeploy.LambdaDeploymentConfig.LINEAR_10PERCENT_EVERY_1MINUTE,
14878
- alarms=[alarm
14879
- ]
14881
+ # you can use the metric to create a new alarm
14882
+ cloudwatch.Alarm(self, "alarm from metric filter",
14883
+ metric=metric,
14884
+ threshold=100,
14885
+ evaluation_periods=2
14880
14886
  )
14881
- deployment_group.add_alarm(cloudwatch.Alarm(self, "BlueGreenErrors",
14882
- comparison_operator=cloudwatch.ComparisonOperator.GREATER_THAN_THRESHOLD,
14883
- threshold=1,
14884
- evaluation_periods=1,
14885
- metric=blue_green_alias.metric_errors()
14886
- ))
14887
14887
  '''
14888
14888
 
14889
14889
  def __init__(
@@ -5893,7 +5893,7 @@ class EcsBlueGreenDeploymentConfig:
5893
5893
  :param listener: The load balancer listener used to serve production traffic and to shift production traffic from the 'blue' ECS task set to the 'green' ECS task set during a blue-green deployment.
5894
5894
  :param deployment_approval_wait_time: Specify how long CodeDeploy waits for approval to continue a blue-green deployment before it stops the deployment. After provisioning the 'green' ECS task set and re-routing test traffic, CodeDeploy can wait for approval before continuing the deployment and re-routing production traffic. During this wait time, validation such as manual testing or running integration tests can occur using the test traffic port, prior to exposing the new 'green' task set to production traffic. To approve the deployment, validation steps use the CodeDeploy [ContinueDeployment API(https://docs.aws.amazon.com/codedeploy/latest/APIReference/API_ContinueDeployment.html). If the ContinueDeployment API is not called within the wait time period, CodeDeploy will stop the deployment. By default, CodeDeploy will not wait for deployment approval. After re-routing test traffic to the 'green' ECS task set and running any 'AfterAllowTestTraffic' and 'BeforeAllowTraffic' lifecycle hooks, the deployment will immediately re-route production traffic to the 'green' ECS task set. Default: 0
5895
5895
  :param termination_wait_time: Specify how long CodeDeploy waits before it terminates the original 'blue' ECS task set when a blue-green deployment is complete. During this wait time, CodeDeploy will continue to monitor any CloudWatch alarms specified for the deployment group, and the deployment group can be configured to automatically roll back if those alarms fire. Once CodeDeploy begins to terminate the 'blue' ECS task set, the deployment can no longer be rolled back, manually or automatically. By default, the deployment will immediately terminate the 'blue' ECS task set after production traffic is successfully routed to the 'green' ECS task set. Default: 0
5896
- :param test_listener: The load balancer listener used to route test traffic to the 'green' ECS task set during a blue-green deployment. During a blue-green deployment, validation can occur after test traffic has been re-routed and before production traffic has been re-routed to the 'green' ECS task set. You can specify one or more Lambda funtions in the deployment's AppSpec file that run during the AfterAllowTestTraffic hook. The functions can run validation tests. If a validation test fails, a deployment rollback is triggered. If the validation tests succeed, the next hook in the deployment lifecycle, BeforeAllowTraffic, is triggered. If a test listener is not specified, the deployment will proceed to routing the production listener to the 'green' ECS task set and will skip the AfterAllowTestTraffic hook. Default: No test listener will be added
5896
+ :param test_listener: The load balancer listener used to route test traffic to the 'green' ECS task set during a blue-green deployment. During a blue-green deployment, validation can occur after test traffic has been re-routed and before production traffic has been re-routed to the 'green' ECS task set. You can specify one or more Lambda functions in the deployment's AppSpec file that run during the AfterAllowTestTraffic hook. The functions can run validation tests. If a validation test fails, a deployment rollback is triggered. If the validation tests succeed, the next hook in the deployment lifecycle, BeforeAllowTraffic, is triggered. If a test listener is not specified, the deployment will proceed to routing the production listener to the 'green' ECS task set and will skip the AfterAllowTestTraffic hook. Default: No test listener will be added
5897
5897
 
5898
5898
  :see: https://docs.aws.amazon.com/codedeploy/latest/userguide/reference-appspec-file-structure-hooks.html#appspec-hooks-ecs
5899
5899
  :exampleMetadata: infused
@@ -6008,7 +6008,7 @@ class EcsBlueGreenDeploymentConfig:
6008
6008
  '''The load balancer listener used to route test traffic to the 'green' ECS task set during a blue-green deployment.
6009
6009
 
6010
6010
  During a blue-green deployment, validation can occur after test traffic has been re-routed and before production
6011
- traffic has been re-routed to the 'green' ECS task set. You can specify one or more Lambda funtions in the
6011
+ traffic has been re-routed to the 'green' ECS task set. You can specify one or more Lambda functions in the
6012
6012
  deployment's AppSpec file that run during the AfterAllowTestTraffic hook. The functions can run validation tests.
6013
6013
  If a validation test fails, a deployment rollback is triggered. If the validation tests succeed, the next hook in
6014
6014
  the deployment lifecycle, BeforeAllowTraffic, is triggered.