aws-cdk-lib 2.212.0__py3-none-any.whl → 2.214.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 (65) hide show
  1. aws_cdk/__init__.py +23 -3
  2. aws_cdk/_jsii/__init__.py +1 -1
  3. aws_cdk/_jsii/{aws-cdk-lib@2.212.0.jsii.tgz → aws-cdk-lib@2.214.0.jsii.tgz} +0 -0
  4. aws_cdk/aws_appconfig/__init__.py +18 -6
  5. aws_cdk/aws_appintegrations/__init__.py +4 -4
  6. aws_cdk/aws_apprunner/__init__.py +5 -8
  7. aws_cdk/aws_aps/__init__.py +243 -10
  8. aws_cdk/aws_b2bi/__init__.py +1015 -128
  9. aws_cdk/aws_batch/__init__.py +33 -11
  10. aws_cdk/aws_bedrock/__init__.py +22 -216
  11. aws_cdk/aws_budgets/__init__.py +18 -0
  12. aws_cdk/aws_certificatemanager/__init__.py +96 -15
  13. aws_cdk/aws_cloudformation/__init__.py +3 -3
  14. aws_cdk/aws_cloudwatch/__init__.py +80 -49
  15. aws_cdk/aws_cognito/__init__.py +76 -5
  16. aws_cdk/aws_connect/__init__.py +188 -2
  17. aws_cdk/aws_datazone/__init__.py +2267 -0
  18. aws_cdk/aws_deadline/__init__.py +6 -5
  19. aws_cdk/aws_dynamodb/__init__.py +418 -56
  20. aws_cdk/aws_ec2/__init__.py +51 -10
  21. aws_cdk/aws_ecs/__init__.py +288 -25
  22. aws_cdk/aws_ecs_patterns/__init__.py +2 -0
  23. aws_cdk/aws_eks/__init__.py +124 -0
  24. aws_cdk/aws_elasticloadbalancingv2/__init__.py +6 -2
  25. aws_cdk/aws_entityresolution/__init__.py +107 -0
  26. aws_cdk/aws_events/__init__.py +153 -55
  27. aws_cdk/aws_events_targets/__init__.py +87 -36
  28. aws_cdk/aws_fsx/__init__.py +62 -0
  29. aws_cdk/aws_gameliftstreams/__init__.py +1 -1
  30. aws_cdk/aws_glue/__init__.py +205 -23
  31. aws_cdk/aws_guardduty/__init__.py +205 -100
  32. aws_cdk/aws_iam/__init__.py +18 -0
  33. aws_cdk/aws_inspectorv2/__init__.py +125 -80
  34. aws_cdk/aws_iot/__init__.py +37 -19
  35. aws_cdk/aws_iotsitewise/__init__.py +111 -75
  36. aws_cdk/aws_ivs/__init__.py +17 -17
  37. aws_cdk/aws_kinesisanalytics/__init__.py +122 -3
  38. aws_cdk/aws_kinesisanalyticsv2/__init__.py +122 -3
  39. aws_cdk/aws_lambda/__init__.py +23 -2
  40. aws_cdk/aws_logs/__init__.py +20 -15
  41. aws_cdk/aws_mediapackagev2/__init__.py +2 -2
  42. aws_cdk/aws_networkfirewall/__init__.py +6 -6
  43. aws_cdk/aws_omics/__init__.py +477 -2
  44. aws_cdk/aws_qbusiness/__init__.py +4 -2
  45. aws_cdk/aws_rds/__init__.py +132 -4
  46. aws_cdk/aws_route53/__init__.py +18 -11
  47. aws_cdk/aws_s3/__init__.py +4 -4
  48. aws_cdk/aws_s3_deployment/__init__.py +45 -0
  49. aws_cdk/aws_sagemaker/__init__.py +653 -0
  50. aws_cdk/aws_servicediscovery/__init__.py +22 -37
  51. aws_cdk/aws_sns/__init__.py +12 -2
  52. aws_cdk/aws_sns_subscriptions/__init__.py +3 -1
  53. aws_cdk/aws_sqs/__init__.py +5 -5
  54. aws_cdk/aws_ssm/__init__.py +8 -3
  55. aws_cdk/aws_ssmquicksetup/__init__.py +2 -2
  56. aws_cdk/aws_synthetics/__init__.py +222 -12
  57. aws_cdk/aws_transfer/__init__.py +15 -2
  58. aws_cdk/aws_vpclattice/__init__.py +41 -0
  59. aws_cdk/aws_workspacesweb/__init__.py +71 -41
  60. {aws_cdk_lib-2.212.0.dist-info → aws_cdk_lib-2.214.0.dist-info}/METADATA +2 -2
  61. {aws_cdk_lib-2.212.0.dist-info → aws_cdk_lib-2.214.0.dist-info}/RECORD +65 -65
  62. {aws_cdk_lib-2.212.0.dist-info → aws_cdk_lib-2.214.0.dist-info}/LICENSE +0 -0
  63. {aws_cdk_lib-2.212.0.dist-info → aws_cdk_lib-2.214.0.dist-info}/NOTICE +0 -0
  64. {aws_cdk_lib-2.212.0.dist-info → aws_cdk_lib-2.214.0.dist-info}/WHEEL +0 -0
  65. {aws_cdk_lib-2.212.0.dist-info → aws_cdk_lib-2.214.0.dist-info}/top_level.txt +0 -0
@@ -335,8 +335,31 @@ events.EventBus(self, "Bus",
335
335
  )
336
336
  ```
337
337
 
338
- **Note**: Archives and schema discovery are not supported for event buses encrypted using a customer managed key.
339
- To enable archives or schema discovery on an event bus, choose to use an AWS owned key.
338
+ To use a customer managed key for an archive, use the `kmsKey` attribute.
339
+
340
+ Note: When you attach a customer managed key to either an EventBus or an Archive, a policy that allows EventBridge to interact with your resource will be added.
341
+
342
+ ```python
343
+ import aws_cdk.aws_kms as kms
344
+ from aws_cdk.aws_events import Archive, EventBus
345
+
346
+ # kms_key: kms.IKey
347
+
348
+
349
+ stack = Stack()
350
+
351
+ event_bus = EventBus(stack, "Bus")
352
+
353
+ archive = Archive(stack, "Archive",
354
+ kms_key=kms_key,
355
+ source_event_bus=event_bus,
356
+ event_pattern=events.EventPattern(
357
+ source=["aws.ec2"]
358
+ )
359
+ )
360
+ ```
361
+
362
+ To enable archives or schema discovery on an event bus, customers has the choice of using either an AWS owned key or a customer managed key.
340
363
  For more information, see [KMS key options for event bus encryption](https://docs.aws.amazon.com/eventbridge/latest/userguide/eb-encryption-at-rest-key-options.html).
341
364
  '''
342
365
  from pkgutil import extend_path
@@ -630,38 +653,26 @@ class Archive(
630
653
  '''Define an EventBridge Archive.
631
654
 
632
655
  :resource: AWS::Events::Archive
633
- :exampleMetadata: fixture=_generated
656
+ :exampleMetadata: infused
634
657
 
635
658
  Example::
636
659
 
637
- # The code below shows an example of how to instantiate this type.
638
- # The values are placeholders you should change.
639
- import aws_cdk as cdk
640
- from aws_cdk import aws_events as events
660
+ import aws_cdk.aws_kms as kms
661
+ from aws_cdk.aws_events import Archive, EventBus
641
662
 
642
- # detail: Any
643
- # event_bus: events.EventBus
663
+ # kms_key: kms.IKey
644
664
 
645
- archive = events.Archive(self, "MyArchive",
646
- event_pattern=events.EventPattern(
647
- account=["account"],
648
- detail={
649
- "detail_key": detail
650
- },
651
- detail_type=["detailType"],
652
- id=["id"],
653
- region=["region"],
654
- resources=["resources"],
655
- source=["source"],
656
- time=["time"],
657
- version=["version"]
658
- ),
659
- source_event_bus=event_bus,
660
665
 
661
- # the properties below are optional
662
- archive_name="archiveName",
663
- description="description",
664
- retention=cdk.Duration.minutes(30)
666
+ stack = Stack()
667
+
668
+ event_bus = EventBus(stack, "Bus")
669
+
670
+ archive = Archive(stack, "Archive",
671
+ kms_key=kms_key,
672
+ source_event_bus=event_bus,
673
+ event_pattern=events.EventPattern(
674
+ source=["aws.ec2"]
675
+ )
665
676
  )
666
677
  '''
667
678
 
@@ -674,6 +685,7 @@ class Archive(
674
685
  event_pattern: typing.Union["EventPattern", typing.Dict[builtins.str, typing.Any]],
675
686
  archive_name: typing.Optional[builtins.str] = None,
676
687
  description: typing.Optional[builtins.str] = None,
688
+ kms_key: typing.Optional[_IKey_5f11635f] = None,
677
689
  retention: typing.Optional[_Duration_4839e8c3] = None,
678
690
  ) -> None:
679
691
  '''
@@ -683,6 +695,7 @@ class Archive(
683
695
  :param event_pattern: An event pattern to use to filter events sent to the archive.
684
696
  :param archive_name: The name of the archive. Default: - Automatically generated
685
697
  :param description: A description for the archive. Default: - none
698
+ :param kms_key: The customer managed key that encrypts this archive. Default: - Use an AWS managed key
686
699
  :param retention: The number of days to retain events for. Default value is 0. If set to 0, events are retained indefinitely. Default: - Infinite
687
700
  '''
688
701
  if __debug__:
@@ -694,6 +707,7 @@ class Archive(
694
707
  event_pattern=event_pattern,
695
708
  archive_name=archive_name,
696
709
  description=description,
710
+ kms_key=kms_key,
697
711
  retention=retention,
698
712
  )
699
713
 
@@ -843,6 +857,7 @@ typing.cast(typing.Any, Authorization).__jsii_proxy_class__ = lambda : _Authoriz
843
857
  "event_pattern": "eventPattern",
844
858
  "archive_name": "archiveName",
845
859
  "description": "description",
860
+ "kms_key": "kmsKey",
846
861
  "retention": "retention",
847
862
  },
848
863
  )
@@ -853,6 +868,7 @@ class BaseArchiveProps:
853
868
  event_pattern: typing.Union["EventPattern", typing.Dict[builtins.str, typing.Any]],
854
869
  archive_name: typing.Optional[builtins.str] = None,
855
870
  description: typing.Optional[builtins.str] = None,
871
+ kms_key: typing.Optional[_IKey_5f11635f] = None,
856
872
  retention: typing.Optional[_Duration_4839e8c3] = None,
857
873
  ) -> None:
858
874
  '''The event archive base properties.
@@ -860,6 +876,7 @@ class BaseArchiveProps:
860
876
  :param event_pattern: An event pattern to use to filter events sent to the archive.
861
877
  :param archive_name: The name of the archive. Default: - Automatically generated
862
878
  :param description: A description for the archive. Default: - none
879
+ :param kms_key: The customer managed key that encrypts this archive. Default: - Use an AWS managed key
863
880
  :param retention: The number of days to retain events for. Default value is 0. If set to 0, events are retained indefinitely. Default: - Infinite
864
881
 
865
882
  :exampleMetadata: infused
@@ -887,6 +904,7 @@ class BaseArchiveProps:
887
904
  check_type(argname="argument event_pattern", value=event_pattern, expected_type=type_hints["event_pattern"])
888
905
  check_type(argname="argument archive_name", value=archive_name, expected_type=type_hints["archive_name"])
889
906
  check_type(argname="argument description", value=description, expected_type=type_hints["description"])
907
+ check_type(argname="argument kms_key", value=kms_key, expected_type=type_hints["kms_key"])
890
908
  check_type(argname="argument retention", value=retention, expected_type=type_hints["retention"])
891
909
  self._values: typing.Dict[builtins.str, typing.Any] = {
892
910
  "event_pattern": event_pattern,
@@ -895,6 +913,8 @@ class BaseArchiveProps:
895
913
  self._values["archive_name"] = archive_name
896
914
  if description is not None:
897
915
  self._values["description"] = description
916
+ if kms_key is not None:
917
+ self._values["kms_key"] = kms_key
898
918
  if retention is not None:
899
919
  self._values["retention"] = retention
900
920
 
@@ -923,6 +943,15 @@ class BaseArchiveProps:
923
943
  result = self._values.get("description")
924
944
  return typing.cast(typing.Optional[builtins.str], result)
925
945
 
946
+ @builtins.property
947
+ def kms_key(self) -> typing.Optional[_IKey_5f11635f]:
948
+ '''The customer managed key that encrypts this archive.
949
+
950
+ :default: - Use an AWS managed key
951
+ '''
952
+ result = self._values.get("kms_key")
953
+ return typing.cast(typing.Optional[_IKey_5f11635f], result)
954
+
926
955
  @builtins.property
927
956
  def retention(self) -> typing.Optional[_Duration_4839e8c3]:
928
957
  '''The number of days to retain events for.
@@ -5065,7 +5094,7 @@ class CfnEventBusProps:
5065
5094
  )
5066
5095
 
5067
5096
 
5068
- @jsii.implements(_IInspectable_c2943556)
5097
+ @jsii.implements(_IInspectable_c2943556, _ITaggableV2_4e6798f8)
5069
5098
  class CfnRule(
5070
5099
  _CfnResource_9df397a6,
5071
5100
  metaclass=jsii.JSIIMeta,
@@ -5114,6 +5143,10 @@ class CfnRule(
5114
5143
  role_arn="roleArn",
5115
5144
  schedule_expression="scheduleExpression",
5116
5145
  state="state",
5146
+ tags=[CfnTag(
5147
+ key="key",
5148
+ value="value"
5149
+ )],
5117
5150
  targets=[events.CfnRule.TargetProperty(
5118
5151
  arn="arn",
5119
5152
  id="id",
@@ -5247,6 +5280,7 @@ class CfnRule(
5247
5280
  role_arn: typing.Optional[builtins.str] = None,
5248
5281
  schedule_expression: typing.Optional[builtins.str] = None,
5249
5282
  state: typing.Optional[builtins.str] = None,
5283
+ tags: typing.Optional[typing.Sequence[typing.Union[_CfnTag_f6864754, typing.Dict[builtins.str, typing.Any]]]] = None,
5250
5284
  targets: typing.Optional[typing.Union[_IResolvable_da3f097b, typing.Sequence[typing.Union[_IResolvable_da3f097b, typing.Union["CfnRule.TargetProperty", typing.Dict[builtins.str, typing.Any]]]]]] = None,
5251
5285
  ) -> None:
5252
5286
  '''
@@ -5259,6 +5293,7 @@ class CfnRule(
5259
5293
  :param role_arn: The Amazon Resource Name (ARN) of the role that is used for target invocation. If you're setting an event bus in another account as the target and that account granted permission to your account through an organization instead of directly by the account ID, you must specify a ``RoleArn`` with proper permissions in the ``Target`` structure, instead of here in this parameter.
5260
5294
  :param schedule_expression: The scheduling expression. For example, "cron(0 20 * * ? *)", "rate(5 minutes)". For more information, see `Creating an Amazon EventBridge rule that runs on a schedule <https://docs.aws.amazon.com/eventbridge/latest/userguide/eb-create-rule-schedule.html>`_ .
5261
5295
  :param state: The state of the rule. Valid values include: - ``DISABLED`` : The rule is disabled. EventBridge does not match any events against the rule. - ``ENABLED`` : The rule is enabled. EventBridge matches events against the rule, *except* for AWS management events delivered through CloudTrail. - ``ENABLED_WITH_ALL_CLOUDTRAIL_MANAGEMENT_EVENTS`` : The rule is enabled for all events, including AWS management events delivered through CloudTrail. Management events provide visibility into management operations that are performed on resources in your AWS account. These are also known as control plane operations. For more information, see `Logging management events <https://docs.aws.amazon.com/awscloudtrail/latest/userguide/logging-management-events-with-cloudtrail.html#logging-management-events>`_ in the *CloudTrail User Guide* , and `Filtering management events from AWS services <https://docs.aws.amazon.com/eventbridge/latest/userguide/eb-service-event.html#eb-service-event-cloudtrail>`_ in the **Amazon EventBridge User Guide** . This value is only valid for rules on the `default <https://docs.aws.amazon.com/eventbridge/latest/userguide/eb-what-is-how-it-works-concepts.html#eb-bus-concepts-buses>`_ event bus or `custom event buses <https://docs.aws.amazon.com/eventbridge/latest/userguide/eb-create-event-bus.html>`_ . It does not apply to `partner event buses <https://docs.aws.amazon.com/eventbridge/latest/userguide/eb-saas.html>`_ .
5296
+ :param tags: Any tags assigned to the event rule.
5262
5297
  :param targets: Adds the specified targets to the specified rule, or updates the targets if they are already associated with the rule. Targets are the resources that are invoked when a rule is triggered. The maximum number of entries per request is 10. .. epigraph:: Each rule can have up to five (5) targets associated with it at one time. For a list of services you can configure as targets for events, see `EventBridge targets <https://docs.aws.amazon.com/eventbridge/latest/userguide/eb-targets.html>`_ in the **Amazon EventBridge User Guide** . Creating rules with built-in targets is supported only in the AWS Management Console . The built-in targets are: - ``Amazon EBS CreateSnapshot API call`` - ``Amazon EC2 RebootInstances API call`` - ``Amazon EC2 StopInstances API call`` - ``Amazon EC2 TerminateInstances API call`` For some target types, ``PutTargets`` provides target-specific parameters. If the target is a Kinesis data stream, you can optionally specify which shard the event goes to by using the ``KinesisParameters`` argument. To invoke a command on multiple EC2 instances with one rule, you can use the ``RunCommandParameters`` field. To be able to make API calls against the resources that you own, Amazon EventBridge needs the appropriate permissions: - For AWS Lambda and Amazon SNS resources, EventBridge relies on resource-based policies. - For EC2 instances, Kinesis Data Streams, AWS Step Functions state machines and API Gateway APIs, EventBridge relies on IAM roles that you specify in the ``RoleARN`` argument in ``PutTargets`` . For more information, see `Authentication and Access Control <https://docs.aws.amazon.com/eventbridge/latest/userguide/auth-and-access-control-eventbridge.html>`_ in the **Amazon EventBridge User Guide** . If another AWS account is in the same region and has granted you permission (using ``PutPermission`` ), you can send events to that account. Set that account's event bus as a target of the rules in your account. To send the matched events to the other account, specify that account's event bus as the ``Arn`` value when you run ``PutTargets`` . If your account sends events to another account, your account is charged for each sent event. Each event sent to another account is charged as a custom event. The account receiving the event is not charged. For more information, see `Amazon EventBridge Pricing <https://docs.aws.amazon.com/eventbridge/pricing/>`_ . .. epigraph:: ``Input`` , ``InputPath`` , and ``InputTransformer`` are not available with ``PutTarget`` if the target is an event bus of a different AWS account. If you are setting the event bus of another account as the target, and that account granted permission to your account through an organization instead of directly by the account ID, then you must specify a ``RoleArn`` with proper permissions in the ``Target`` structure. For more information, see `Sending and Receiving Events Between AWS Accounts <https://docs.aws.amazon.com/eventbridge/latest/userguide/eventbridge-cross-account-event-delivery.html>`_ in the *Amazon EventBridge User Guide* . .. epigraph:: If you have an IAM role on a cross-account event bus target, a ``PutTargets`` call without a role on the same target (same ``Id`` and ``Arn`` ) will not remove the role. For more information about enabling cross-account events, see `PutPermission <https://docs.aws.amazon.com/eventbridge/latest/APIReference/API_PutPermission.html>`_ . *Input* , *InputPath* , and *InputTransformer* are mutually exclusive and optional parameters of a target. When a rule is triggered due to a matched event: - If none of the following arguments are specified for a target, then the entire event is passed to the target in JSON format (unless the target is Amazon EC2 Run Command or Amazon ECS task, in which case nothing from the event is passed to the target). - If *Input* is specified in the form of valid JSON, then the matched event is overridden with this constant. - If *InputPath* is specified in the form of JSONPath (for example, ``$.detail`` ), then only the part of the event specified in the path is passed to the target (for example, only the detail part of the event is passed). - If *InputTransformer* is specified, then one or more specified JSONPaths are extracted from the event and used as values in a template that you specify as the input to the target. When you specify ``InputPath`` or ``InputTransformer`` , you must use JSON dot notation, not bracket notation. When you add targets to a rule and the associated rule triggers soon after, new or updated targets might not be immediately invoked. Allow a short period of time for changes to take effect. This action can partially fail if too many requests are made at the same time. If that happens, ``FailedEntryCount`` is non-zero in the response and each entry in ``FailedEntries`` provides the ID of the failed target and the error code.
5263
5298
  '''
5264
5299
  if __debug__:
@@ -5273,6 +5308,7 @@ class CfnRule(
5273
5308
  role_arn=role_arn,
5274
5309
  schedule_expression=schedule_expression,
5275
5310
  state=state,
5311
+ tags=tags,
5276
5312
  targets=targets,
5277
5313
  )
5278
5314
 
@@ -5317,6 +5353,12 @@ class CfnRule(
5317
5353
  '''
5318
5354
  return typing.cast(builtins.str, jsii.get(self, "attrArn"))
5319
5355
 
5356
+ @builtins.property
5357
+ @jsii.member(jsii_name="cdkTagManager")
5358
+ def cdk_tag_manager(self) -> _TagManager_0a598cb3:
5359
+ '''Tag Manager which manages the tags for this resource.'''
5360
+ return typing.cast(_TagManager_0a598cb3, jsii.get(self, "cdkTagManager"))
5361
+
5320
5362
  @builtins.property
5321
5363
  @jsii.member(jsii_name="cfnProperties")
5322
5364
  def _cfn_properties(self) -> typing.Mapping[builtins.str, typing.Any]:
@@ -5413,6 +5455,19 @@ class CfnRule(
5413
5455
  check_type(argname="argument value", value=value, expected_type=type_hints["value"])
5414
5456
  jsii.set(self, "state", value) # pyright: ignore[reportArgumentType]
5415
5457
 
5458
+ @builtins.property
5459
+ @jsii.member(jsii_name="tags")
5460
+ def tags(self) -> typing.Optional[typing.List[_CfnTag_f6864754]]:
5461
+ '''Any tags assigned to the event rule.'''
5462
+ return typing.cast(typing.Optional[typing.List[_CfnTag_f6864754]], jsii.get(self, "tags"))
5463
+
5464
+ @tags.setter
5465
+ def tags(self, value: typing.Optional[typing.List[_CfnTag_f6864754]]) -> None:
5466
+ if __debug__:
5467
+ type_hints = typing.get_type_hints(_typecheckingstub__4daedf0bf9c9ce5671a843d87568d852259b36183898da9f395d6fb1b1a1e974)
5468
+ check_type(argname="argument value", value=value, expected_type=type_hints["value"])
5469
+ jsii.set(self, "tags", value) # pyright: ignore[reportArgumentType]
5470
+
5416
5471
  @builtins.property
5417
5472
  @jsii.member(jsii_name="targets")
5418
5473
  def targets(
@@ -7912,6 +7967,7 @@ class CfnRule(
7912
7967
  "role_arn": "roleArn",
7913
7968
  "schedule_expression": "scheduleExpression",
7914
7969
  "state": "state",
7970
+ "tags": "tags",
7915
7971
  "targets": "targets",
7916
7972
  },
7917
7973
  )
@@ -7926,6 +7982,7 @@ class CfnRuleProps:
7926
7982
  role_arn: typing.Optional[builtins.str] = None,
7927
7983
  schedule_expression: typing.Optional[builtins.str] = None,
7928
7984
  state: typing.Optional[builtins.str] = None,
7985
+ tags: typing.Optional[typing.Sequence[typing.Union[_CfnTag_f6864754, typing.Dict[builtins.str, typing.Any]]]] = None,
7929
7986
  targets: typing.Optional[typing.Union[_IResolvable_da3f097b, typing.Sequence[typing.Union[_IResolvable_da3f097b, typing.Union[CfnRule.TargetProperty, typing.Dict[builtins.str, typing.Any]]]]]] = None,
7930
7987
  ) -> None:
7931
7988
  '''Properties for defining a ``CfnRule``.
@@ -7937,6 +7994,7 @@ class CfnRuleProps:
7937
7994
  :param role_arn: The Amazon Resource Name (ARN) of the role that is used for target invocation. If you're setting an event bus in another account as the target and that account granted permission to your account through an organization instead of directly by the account ID, you must specify a ``RoleArn`` with proper permissions in the ``Target`` structure, instead of here in this parameter.
7938
7995
  :param schedule_expression: The scheduling expression. For example, "cron(0 20 * * ? *)", "rate(5 minutes)". For more information, see `Creating an Amazon EventBridge rule that runs on a schedule <https://docs.aws.amazon.com/eventbridge/latest/userguide/eb-create-rule-schedule.html>`_ .
7939
7996
  :param state: The state of the rule. Valid values include: - ``DISABLED`` : The rule is disabled. EventBridge does not match any events against the rule. - ``ENABLED`` : The rule is enabled. EventBridge matches events against the rule, *except* for AWS management events delivered through CloudTrail. - ``ENABLED_WITH_ALL_CLOUDTRAIL_MANAGEMENT_EVENTS`` : The rule is enabled for all events, including AWS management events delivered through CloudTrail. Management events provide visibility into management operations that are performed on resources in your AWS account. These are also known as control plane operations. For more information, see `Logging management events <https://docs.aws.amazon.com/awscloudtrail/latest/userguide/logging-management-events-with-cloudtrail.html#logging-management-events>`_ in the *CloudTrail User Guide* , and `Filtering management events from AWS services <https://docs.aws.amazon.com/eventbridge/latest/userguide/eb-service-event.html#eb-service-event-cloudtrail>`_ in the **Amazon EventBridge User Guide** . This value is only valid for rules on the `default <https://docs.aws.amazon.com/eventbridge/latest/userguide/eb-what-is-how-it-works-concepts.html#eb-bus-concepts-buses>`_ event bus or `custom event buses <https://docs.aws.amazon.com/eventbridge/latest/userguide/eb-create-event-bus.html>`_ . It does not apply to `partner event buses <https://docs.aws.amazon.com/eventbridge/latest/userguide/eb-saas.html>`_ .
7997
+ :param tags: Any tags assigned to the event rule.
7940
7998
  :param targets: Adds the specified targets to the specified rule, or updates the targets if they are already associated with the rule. Targets are the resources that are invoked when a rule is triggered. The maximum number of entries per request is 10. .. epigraph:: Each rule can have up to five (5) targets associated with it at one time. For a list of services you can configure as targets for events, see `EventBridge targets <https://docs.aws.amazon.com/eventbridge/latest/userguide/eb-targets.html>`_ in the **Amazon EventBridge User Guide** . Creating rules with built-in targets is supported only in the AWS Management Console . The built-in targets are: - ``Amazon EBS CreateSnapshot API call`` - ``Amazon EC2 RebootInstances API call`` - ``Amazon EC2 StopInstances API call`` - ``Amazon EC2 TerminateInstances API call`` For some target types, ``PutTargets`` provides target-specific parameters. If the target is a Kinesis data stream, you can optionally specify which shard the event goes to by using the ``KinesisParameters`` argument. To invoke a command on multiple EC2 instances with one rule, you can use the ``RunCommandParameters`` field. To be able to make API calls against the resources that you own, Amazon EventBridge needs the appropriate permissions: - For AWS Lambda and Amazon SNS resources, EventBridge relies on resource-based policies. - For EC2 instances, Kinesis Data Streams, AWS Step Functions state machines and API Gateway APIs, EventBridge relies on IAM roles that you specify in the ``RoleARN`` argument in ``PutTargets`` . For more information, see `Authentication and Access Control <https://docs.aws.amazon.com/eventbridge/latest/userguide/auth-and-access-control-eventbridge.html>`_ in the **Amazon EventBridge User Guide** . If another AWS account is in the same region and has granted you permission (using ``PutPermission`` ), you can send events to that account. Set that account's event bus as a target of the rules in your account. To send the matched events to the other account, specify that account's event bus as the ``Arn`` value when you run ``PutTargets`` . If your account sends events to another account, your account is charged for each sent event. Each event sent to another account is charged as a custom event. The account receiving the event is not charged. For more information, see `Amazon EventBridge Pricing <https://docs.aws.amazon.com/eventbridge/pricing/>`_ . .. epigraph:: ``Input`` , ``InputPath`` , and ``InputTransformer`` are not available with ``PutTarget`` if the target is an event bus of a different AWS account. If you are setting the event bus of another account as the target, and that account granted permission to your account through an organization instead of directly by the account ID, then you must specify a ``RoleArn`` with proper permissions in the ``Target`` structure. For more information, see `Sending and Receiving Events Between AWS Accounts <https://docs.aws.amazon.com/eventbridge/latest/userguide/eventbridge-cross-account-event-delivery.html>`_ in the *Amazon EventBridge User Guide* . .. epigraph:: If you have an IAM role on a cross-account event bus target, a ``PutTargets`` call without a role on the same target (same ``Id`` and ``Arn`` ) will not remove the role. For more information about enabling cross-account events, see `PutPermission <https://docs.aws.amazon.com/eventbridge/latest/APIReference/API_PutPermission.html>`_ . *Input* , *InputPath* , and *InputTransformer* are mutually exclusive and optional parameters of a target. When a rule is triggered due to a matched event: - If none of the following arguments are specified for a target, then the entire event is passed to the target in JSON format (unless the target is Amazon EC2 Run Command or Amazon ECS task, in which case nothing from the event is passed to the target). - If *Input* is specified in the form of valid JSON, then the matched event is overridden with this constant. - If *InputPath* is specified in the form of JSONPath (for example, ``$.detail`` ), then only the part of the event specified in the path is passed to the target (for example, only the detail part of the event is passed). - If *InputTransformer* is specified, then one or more specified JSONPaths are extracted from the event and used as values in a template that you specify as the input to the target. When you specify ``InputPath`` or ``InputTransformer`` , you must use JSON dot notation, not bracket notation. When you add targets to a rule and the associated rule triggers soon after, new or updated targets might not be immediately invoked. Allow a short period of time for changes to take effect. This action can partially fail if too many requests are made at the same time. If that happens, ``FailedEntryCount`` is non-zero in the response and each entry in ``FailedEntries`` provides the ID of the failed target and the error code.
7941
7999
 
7942
8000
  :see: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-events-rule.html
@@ -7958,6 +8016,10 @@ class CfnRuleProps:
7958
8016
  role_arn="roleArn",
7959
8017
  schedule_expression="scheduleExpression",
7960
8018
  state="state",
8019
+ tags=[CfnTag(
8020
+ key="key",
8021
+ value="value"
8022
+ )],
7961
8023
  targets=[events.CfnRule.TargetProperty(
7962
8024
  arn="arn",
7963
8025
  id="id",
@@ -8087,6 +8149,7 @@ class CfnRuleProps:
8087
8149
  check_type(argname="argument role_arn", value=role_arn, expected_type=type_hints["role_arn"])
8088
8150
  check_type(argname="argument schedule_expression", value=schedule_expression, expected_type=type_hints["schedule_expression"])
8089
8151
  check_type(argname="argument state", value=state, expected_type=type_hints["state"])
8152
+ check_type(argname="argument tags", value=tags, expected_type=type_hints["tags"])
8090
8153
  check_type(argname="argument targets", value=targets, expected_type=type_hints["targets"])
8091
8154
  self._values: typing.Dict[builtins.str, typing.Any] = {}
8092
8155
  if description is not None:
@@ -8103,6 +8166,8 @@ class CfnRuleProps:
8103
8166
  self._values["schedule_expression"] = schedule_expression
8104
8167
  if state is not None:
8105
8168
  self._values["state"] = state
8169
+ if tags is not None:
8170
+ self._values["tags"] = tags
8106
8171
  if targets is not None:
8107
8172
  self._values["targets"] = targets
8108
8173
 
@@ -8187,6 +8252,15 @@ class CfnRuleProps:
8187
8252
  result = self._values.get("state")
8188
8253
  return typing.cast(typing.Optional[builtins.str], result)
8189
8254
 
8255
+ @builtins.property
8256
+ def tags(self) -> typing.Optional[typing.List[_CfnTag_f6864754]]:
8257
+ '''Any tags assigned to the event rule.
8258
+
8259
+ :see: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-events-rule.html#cfn-events-rule-tags
8260
+ '''
8261
+ result = self._values.get("tags")
8262
+ return typing.cast(typing.Optional[typing.List[_CfnTag_f6864754]], result)
8263
+
8190
8264
  @builtins.property
8191
8265
  def targets(
8192
8266
  self,
@@ -9794,6 +9868,7 @@ class IEventBus(_IResource_c80c4260, typing_extensions.Protocol):
9794
9868
  event_pattern: typing.Union[EventPattern, typing.Dict[builtins.str, typing.Any]],
9795
9869
  archive_name: typing.Optional[builtins.str] = None,
9796
9870
  description: typing.Optional[builtins.str] = None,
9871
+ kms_key: typing.Optional[_IKey_5f11635f] = None,
9797
9872
  retention: typing.Optional[_Duration_4839e8c3] = None,
9798
9873
  ) -> Archive:
9799
9874
  '''Create an EventBridge archive to send events to.
@@ -9805,6 +9880,7 @@ class IEventBus(_IResource_c80c4260, typing_extensions.Protocol):
9805
9880
  :param event_pattern: An event pattern to use to filter events sent to the archive.
9806
9881
  :param archive_name: The name of the archive. Default: - Automatically generated
9807
9882
  :param description: A description for the archive. Default: - none
9883
+ :param kms_key: The customer managed key that encrypts this archive. Default: - Use an AWS managed key
9808
9884
  :param retention: The number of days to retain events for. Default value is 0. If set to 0, events are retained indefinitely. Default: - Infinite
9809
9885
  '''
9810
9886
  ...
@@ -9877,6 +9953,7 @@ class _IEventBusProxy(
9877
9953
  event_pattern: typing.Union[EventPattern, typing.Dict[builtins.str, typing.Any]],
9878
9954
  archive_name: typing.Optional[builtins.str] = None,
9879
9955
  description: typing.Optional[builtins.str] = None,
9956
+ kms_key: typing.Optional[_IKey_5f11635f] = None,
9880
9957
  retention: typing.Optional[_Duration_4839e8c3] = None,
9881
9958
  ) -> Archive:
9882
9959
  '''Create an EventBridge archive to send events to.
@@ -9888,6 +9965,7 @@ class _IEventBusProxy(
9888
9965
  :param event_pattern: An event pattern to use to filter events sent to the archive.
9889
9966
  :param archive_name: The name of the archive. Default: - Automatically generated
9890
9967
  :param description: A description for the archive. Default: - none
9968
+ :param kms_key: The customer managed key that encrypts this archive. Default: - Use an AWS managed key
9891
9969
  :param retention: The number of days to retain events for. Default value is 0. If set to 0, events are retained indefinitely. Default: - Infinite
9892
9970
  '''
9893
9971
  if __debug__:
@@ -9897,6 +9975,7 @@ class _IEventBusProxy(
9897
9975
  event_pattern=event_pattern,
9898
9976
  archive_name=archive_name,
9899
9977
  description=description,
9978
+ kms_key=kms_key,
9900
9979
  retention=retention,
9901
9980
  )
9902
9981
 
@@ -11993,6 +12072,7 @@ class ApiDestination(
11993
12072
  "event_pattern": "eventPattern",
11994
12073
  "archive_name": "archiveName",
11995
12074
  "description": "description",
12075
+ "kms_key": "kmsKey",
11996
12076
  "retention": "retention",
11997
12077
  "source_event_bus": "sourceEventBus",
11998
12078
  },
@@ -12004,6 +12084,7 @@ class ArchiveProps(BaseArchiveProps):
12004
12084
  event_pattern: typing.Union[EventPattern, typing.Dict[builtins.str, typing.Any]],
12005
12085
  archive_name: typing.Optional[builtins.str] = None,
12006
12086
  description: typing.Optional[builtins.str] = None,
12087
+ kms_key: typing.Optional[_IKey_5f11635f] = None,
12007
12088
  retention: typing.Optional[_Duration_4839e8c3] = None,
12008
12089
  source_event_bus: IEventBus,
12009
12090
  ) -> None:
@@ -12012,41 +12093,30 @@ class ArchiveProps(BaseArchiveProps):
12012
12093
  :param event_pattern: An event pattern to use to filter events sent to the archive.
12013
12094
  :param archive_name: The name of the archive. Default: - Automatically generated
12014
12095
  :param description: A description for the archive. Default: - none
12096
+ :param kms_key: The customer managed key that encrypts this archive. Default: - Use an AWS managed key
12015
12097
  :param retention: The number of days to retain events for. Default value is 0. If set to 0, events are retained indefinitely. Default: - Infinite
12016
12098
  :param source_event_bus: The event source associated with the archive.
12017
12099
 
12018
- :exampleMetadata: fixture=_generated
12100
+ :exampleMetadata: infused
12019
12101
 
12020
12102
  Example::
12021
12103
 
12022
- # The code below shows an example of how to instantiate this type.
12023
- # The values are placeholders you should change.
12024
- import aws_cdk as cdk
12025
- from aws_cdk import aws_events as events
12104
+ import aws_cdk.aws_kms as kms
12105
+ from aws_cdk.aws_events import Archive, EventBus
12026
12106
 
12027
- # detail: Any
12028
- # event_bus: events.EventBus
12107
+ # kms_key: kms.IKey
12029
12108
 
12030
- archive_props = events.ArchiveProps(
12031
- event_pattern=events.EventPattern(
12032
- account=["account"],
12033
- detail={
12034
- "detail_key": detail
12035
- },
12036
- detail_type=["detailType"],
12037
- id=["id"],
12038
- region=["region"],
12039
- resources=["resources"],
12040
- source=["source"],
12041
- time=["time"],
12042
- version=["version"]
12043
- ),
12044
- source_event_bus=event_bus,
12045
12109
 
12046
- # the properties below are optional
12047
- archive_name="archiveName",
12048
- description="description",
12049
- retention=cdk.Duration.minutes(30)
12110
+ stack = Stack()
12111
+
12112
+ event_bus = EventBus(stack, "Bus")
12113
+
12114
+ archive = Archive(stack, "Archive",
12115
+ kms_key=kms_key,
12116
+ source_event_bus=event_bus,
12117
+ event_pattern=events.EventPattern(
12118
+ source=["aws.ec2"]
12119
+ )
12050
12120
  )
12051
12121
  '''
12052
12122
  if isinstance(event_pattern, dict):
@@ -12056,6 +12126,7 @@ class ArchiveProps(BaseArchiveProps):
12056
12126
  check_type(argname="argument event_pattern", value=event_pattern, expected_type=type_hints["event_pattern"])
12057
12127
  check_type(argname="argument archive_name", value=archive_name, expected_type=type_hints["archive_name"])
12058
12128
  check_type(argname="argument description", value=description, expected_type=type_hints["description"])
12129
+ check_type(argname="argument kms_key", value=kms_key, expected_type=type_hints["kms_key"])
12059
12130
  check_type(argname="argument retention", value=retention, expected_type=type_hints["retention"])
12060
12131
  check_type(argname="argument source_event_bus", value=source_event_bus, expected_type=type_hints["source_event_bus"])
12061
12132
  self._values: typing.Dict[builtins.str, typing.Any] = {
@@ -12066,6 +12137,8 @@ class ArchiveProps(BaseArchiveProps):
12066
12137
  self._values["archive_name"] = archive_name
12067
12138
  if description is not None:
12068
12139
  self._values["description"] = description
12140
+ if kms_key is not None:
12141
+ self._values["kms_key"] = kms_key
12069
12142
  if retention is not None:
12070
12143
  self._values["retention"] = retention
12071
12144
 
@@ -12094,6 +12167,15 @@ class ArchiveProps(BaseArchiveProps):
12094
12167
  result = self._values.get("description")
12095
12168
  return typing.cast(typing.Optional[builtins.str], result)
12096
12169
 
12170
+ @builtins.property
12171
+ def kms_key(self) -> typing.Optional[_IKey_5f11635f]:
12172
+ '''The customer managed key that encrypts this archive.
12173
+
12174
+ :default: - Use an AWS managed key
12175
+ '''
12176
+ result = self._values.get("kms_key")
12177
+ return typing.cast(typing.Optional[_IKey_5f11635f], result)
12178
+
12097
12179
  @builtins.property
12098
12180
  def retention(self) -> typing.Optional[_Duration_4839e8c3]:
12099
12181
  '''The number of days to retain events for.
@@ -12449,6 +12531,7 @@ class EventBus(
12449
12531
  event_pattern: typing.Union[EventPattern, typing.Dict[builtins.str, typing.Any]],
12450
12532
  archive_name: typing.Optional[builtins.str] = None,
12451
12533
  description: typing.Optional[builtins.str] = None,
12534
+ kms_key: typing.Optional[_IKey_5f11635f] = None,
12452
12535
  retention: typing.Optional[_Duration_4839e8c3] = None,
12453
12536
  ) -> Archive:
12454
12537
  '''Create an EventBridge archive to send events to.
@@ -12460,6 +12543,7 @@ class EventBus(
12460
12543
  :param event_pattern: An event pattern to use to filter events sent to the archive.
12461
12544
  :param archive_name: The name of the archive. Default: - Automatically generated
12462
12545
  :param description: A description for the archive. Default: - none
12546
+ :param kms_key: The customer managed key that encrypts this archive. Default: - Use an AWS managed key
12463
12547
  :param retention: The number of days to retain events for. Default value is 0. If set to 0, events are retained indefinitely. Default: - Infinite
12464
12548
  '''
12465
12549
  if __debug__:
@@ -12469,6 +12553,7 @@ class EventBus(
12469
12553
  event_pattern=event_pattern,
12470
12554
  archive_name=archive_name,
12471
12555
  description=description,
12556
+ kms_key=kms_key,
12472
12557
  retention=retention,
12473
12558
  )
12474
12559
 
@@ -12605,6 +12690,7 @@ def _typecheckingstub__3d354e4791ce999debd366401bf6abece64fe39da3a499dafa6b3996b
12605
12690
  event_pattern: typing.Union[EventPattern, typing.Dict[builtins.str, typing.Any]],
12606
12691
  archive_name: typing.Optional[builtins.str] = None,
12607
12692
  description: typing.Optional[builtins.str] = None,
12693
+ kms_key: typing.Optional[_IKey_5f11635f] = None,
12608
12694
  retention: typing.Optional[_Duration_4839e8c3] = None,
12609
12695
  ) -> None:
12610
12696
  """Type checking stubs"""
@@ -12629,6 +12715,7 @@ def _typecheckingstub__74aa160eedb5cb0d834ff82193fc6747b652d04f044891f2ad16f69e1
12629
12715
  event_pattern: typing.Union[EventPattern, typing.Dict[builtins.str, typing.Any]],
12630
12716
  archive_name: typing.Optional[builtins.str] = None,
12631
12717
  description: typing.Optional[builtins.str] = None,
12718
+ kms_key: typing.Optional[_IKey_5f11635f] = None,
12632
12719
  retention: typing.Optional[_Duration_4839e8c3] = None,
12633
12720
  ) -> None:
12634
12721
  """Type checking stubs"""
@@ -13257,6 +13344,7 @@ def _typecheckingstub__e06314755e55e41a2976ff974daa36bbbb473330c92c9fef111b716f2
13257
13344
  role_arn: typing.Optional[builtins.str] = None,
13258
13345
  schedule_expression: typing.Optional[builtins.str] = None,
13259
13346
  state: typing.Optional[builtins.str] = None,
13347
+ tags: typing.Optional[typing.Sequence[typing.Union[_CfnTag_f6864754, typing.Dict[builtins.str, typing.Any]]]] = None,
13260
13348
  targets: typing.Optional[typing.Union[_IResolvable_da3f097b, typing.Sequence[typing.Union[_IResolvable_da3f097b, typing.Union[CfnRule.TargetProperty, typing.Dict[builtins.str, typing.Any]]]]]] = None,
13261
13349
  ) -> None:
13262
13350
  """Type checking stubs"""
@@ -13316,6 +13404,12 @@ def _typecheckingstub__08542b68c4470a8f44e4a04ee382bb40e94dc161aad2f92bfa79298da
13316
13404
  """Type checking stubs"""
13317
13405
  pass
13318
13406
 
13407
+ def _typecheckingstub__4daedf0bf9c9ce5671a843d87568d852259b36183898da9f395d6fb1b1a1e974(
13408
+ value: typing.Optional[typing.List[_CfnTag_f6864754]],
13409
+ ) -> None:
13410
+ """Type checking stubs"""
13411
+ pass
13412
+
13319
13413
  def _typecheckingstub__0b3ddab1471338782440504c486a52daa0e3a535b2209abca3766744b2fabcfc(
13320
13414
  value: typing.Optional[typing.Union[_IResolvable_da3f097b, typing.List[typing.Union[_IResolvable_da3f097b, CfnRule.TargetProperty]]]],
13321
13415
  ) -> None:
@@ -13543,6 +13637,7 @@ def _typecheckingstub__1ba0cfcfcd9cab75c7bd4b5ffa2348687b001ab869ed65280a51c734b
13543
13637
  role_arn: typing.Optional[builtins.str] = None,
13544
13638
  schedule_expression: typing.Optional[builtins.str] = None,
13545
13639
  state: typing.Optional[builtins.str] = None,
13640
+ tags: typing.Optional[typing.Sequence[typing.Union[_CfnTag_f6864754, typing.Dict[builtins.str, typing.Any]]]] = None,
13546
13641
  targets: typing.Optional[typing.Union[_IResolvable_da3f097b, typing.Sequence[typing.Union[_IResolvable_da3f097b, typing.Union[CfnRule.TargetProperty, typing.Dict[builtins.str, typing.Any]]]]]] = None,
13547
13642
  ) -> None:
13548
13643
  """Type checking stubs"""
@@ -13677,6 +13772,7 @@ def _typecheckingstub__1ed58495b96f0f8ed0dfb0c65e8400413d45c5c1f372215e535272012
13677
13772
  event_pattern: typing.Union[EventPattern, typing.Dict[builtins.str, typing.Any]],
13678
13773
  archive_name: typing.Optional[builtins.str] = None,
13679
13774
  description: typing.Optional[builtins.str] = None,
13775
+ kms_key: typing.Optional[_IKey_5f11635f] = None,
13680
13776
  retention: typing.Optional[_Duration_4839e8c3] = None,
13681
13777
  ) -> None:
13682
13778
  """Type checking stubs"""
@@ -14007,6 +14103,7 @@ def _typecheckingstub__3e9e21c5f043688b8d785343f3fca5b1c769d309ab6d381af52c9421a
14007
14103
  event_pattern: typing.Union[EventPattern, typing.Dict[builtins.str, typing.Any]],
14008
14104
  archive_name: typing.Optional[builtins.str] = None,
14009
14105
  description: typing.Optional[builtins.str] = None,
14106
+ kms_key: typing.Optional[_IKey_5f11635f] = None,
14010
14107
  retention: typing.Optional[_Duration_4839e8c3] = None,
14011
14108
  source_event_bus: IEventBus,
14012
14109
  ) -> None:
@@ -14106,6 +14203,7 @@ def _typecheckingstub__7330918630167c372966fe4a86452f34a261c80460ae944bcce168d6b
14106
14203
  event_pattern: typing.Union[EventPattern, typing.Dict[builtins.str, typing.Any]],
14107
14204
  archive_name: typing.Optional[builtins.str] = None,
14108
14205
  description: typing.Optional[builtins.str] = None,
14206
+ kms_key: typing.Optional[_IKey_5f11635f] = None,
14109
14207
  retention: typing.Optional[_Duration_4839e8c3] = None,
14110
14208
  ) -> None:
14111
14209
  """Type checking stubs"""