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
@@ -891,6 +891,110 @@ s3.Bucket(self, "Bucket2",
891
891
  object_lock_default_retention=s3.ObjectLockRetention.compliance(Duration.days(365))
892
892
  )
893
893
  ```
894
+
895
+ ## Replicating Objects
896
+
897
+ You can use [replicating objects](https://docs.aws.amazon.com/AmazonS3/latest/userguide/replication.html) to enable automatic, asynchronous copying of objects across Amazon S3 buckets.
898
+ Buckets that are configured for object replication can be owned by the same AWS account or by different accounts.
899
+ You can replicate objects to a single destination bucket or to multiple destination buckets.
900
+ The destination buckets can be in different AWS Regions or within the same Region as the source bucket.
901
+
902
+ To replicate objects to a destination bucket, you can specify the `replicationRules` property:
903
+
904
+ ```python
905
+ # destination_bucket1: s3.IBucket
906
+ # destination_bucket2: s3.IBucket
907
+ # kms_key: kms.IKey
908
+
909
+
910
+ source_bucket = s3.Bucket(self, "SourceBucket",
911
+ # Versioning must be enabled on both the source and destination bucket
912
+ versioned=True,
913
+ replication_rules=[s3.ReplicationRule(
914
+ # The destination bucket for the replication rule.
915
+ destination=destination_bucket1,
916
+ # The priority of the rule.
917
+ # Amazon S3 will attempt to replicate objects according to all replication rules.
918
+ # However, if there are two or more rules with the same destination bucket, then objects will be replicated according to the rule with the highest priority.
919
+ # The higher the number, the higher the priority.
920
+ # It is essential to specify priority explicitly when the replication configuration has multiple rules.
921
+ priority=1
922
+ ), s3.ReplicationRule(
923
+ destination=destination_bucket2,
924
+ priority=2,
925
+ # Whether to specify S3 Replication Time Control (S3 RTC).
926
+ # S3 RTC replicates most objects that you upload to Amazon S3 in seconds,
927
+ # and 99.99 percent of those objects within specified time.
928
+ replication_time_control=s3.ReplicationTimeValue.FIFTEEN_MINUTES,
929
+ # Whether to enable replication metrics about S3 RTC.
930
+ # If set, metrics will be output to indicate whether replication by S3 RTC took longer than the configured time.
931
+ metrics=s3.ReplicationTimeValue.FIFTEEN_MINUTES,
932
+ # The kms key to use for the destination bucket.
933
+ kms_key=kms_key,
934
+ # The storage class to use for the destination bucket.
935
+ storage_class=s3.StorageClass.INFREQUENT_ACCESS,
936
+ # Whether to replicate objects with SSE-KMS encryption.
937
+ sse_kms_encrypted_objects=False,
938
+ # Whether to replicate modifications on replicas.
939
+ replica_modifications=True,
940
+ # Whether to replicate delete markers.
941
+ # This property cannot be enabled if the replication rule has a tag filter.
942
+ delete_marker_replication=False,
943
+ # The ID of the rule.
944
+ id="full-settings-rule",
945
+ # The object filter for the rule.
946
+ filter=s3.Filter(
947
+ # The prefix filter for the rule.
948
+ prefix="prefix",
949
+ # The tag filter for the rule.
950
+ tags=[s3.Tag(
951
+ key="tagKey",
952
+ value="tagValue"
953
+ )
954
+ ]
955
+ )
956
+ )
957
+ ]
958
+ )
959
+ ```
960
+
961
+ ### Cross Account Replication
962
+
963
+ You can also set a destination bucket from a different account as the replication destination.
964
+
965
+ In this case, the bucket policy for the destination bucket is required, to configure it through CDK use `addReplicationPolicy()` method to add bucket policy on destination bucket.
966
+ In a cross-account scenario, where the source and destination buckets are owned by different AWS accounts, you can use a KMS key to encrypt object replicas. However, the KMS key owner must grant the source bucket owner permission to use the KMS key.
967
+ For more information, please refer to https://docs.aws.amazon.com/AmazonS3/latest/userguide/replication-walkthrough-2.html .
968
+
969
+ > **NOTE:** AWS managed keys don't allow cross-account use, and therefore can't be used to perform cross-account replication.
970
+
971
+ If you need to ovveride the bucket ownership to destination account pass the account value to the method to provide permissions to override bucket owner.
972
+ `addReplicationPolicy(bucket.replicationRoleArn, true, '11111111111')`;
973
+
974
+ However, if the destination bucket is a referenced bucket, CDK cannot set the bucket policy,
975
+ so you will need to [configure the necessary bucket policy](https://docs.aws.amazon.com/AmazonS3/latest/userguide/replication-walkthrough-2.html) separately.
976
+
977
+ ```python
978
+ # The destination bucket in a different account.
979
+ # destination_bucket: s3.IBucket
980
+
981
+
982
+ source_bucket = s3.Bucket(self, "SourceBucket",
983
+ versioned=True,
984
+ replication_rules=[s3.ReplicationRule(
985
+ destination=destination_bucket,
986
+ priority=1,
987
+ # Whether to want to change replica ownership to the AWS account that owns the destination bucket.
988
+ # The replicas are owned by same AWS account that owns the source object by default.
989
+ access_control_transition=True
990
+ )
991
+ ]
992
+ )
993
+
994
+ # Add permissions to the destination after replication role is created
995
+ if source_bucket.replication_role_arn:
996
+ destination_bucket.add_replication_policy(source_bucket.replication_role_arn, True, "111111111111")
997
+ ```
894
998
  '''
895
999
  from pkgutil import extend_path
896
1000
  __path__ = extend_path(__path__, __name__)
@@ -1926,6 +2030,7 @@ class BucketPolicyProps:
1926
2030
  "object_ownership": "objectOwnership",
1927
2031
  "public_read_access": "publicReadAccess",
1928
2032
  "removal_policy": "removalPolicy",
2033
+ "replication_rules": "replicationRules",
1929
2034
  "server_access_logs_bucket": "serverAccessLogsBucket",
1930
2035
  "server_access_logs_prefix": "serverAccessLogsPrefix",
1931
2036
  "target_object_key_format": "targetObjectKeyFormat",
@@ -1964,6 +2069,7 @@ class BucketProps:
1964
2069
  object_ownership: typing.Optional["ObjectOwnership"] = None,
1965
2070
  public_read_access: typing.Optional[builtins.bool] = None,
1966
2071
  removal_policy: typing.Optional[_RemovalPolicy_9f93c814] = None,
2072
+ replication_rules: typing.Optional[typing.Sequence[typing.Union["ReplicationRule", typing.Dict[builtins.str, typing.Any]]]] = None,
1967
2073
  server_access_logs_bucket: typing.Optional["IBucket"] = None,
1968
2074
  server_access_logs_prefix: typing.Optional[builtins.str] = None,
1969
2075
  target_object_key_format: typing.Optional["TargetObjectKeyFormat"] = None,
@@ -1998,6 +2104,7 @@ class BucketProps:
1998
2104
  :param object_ownership: The objectOwnership of the bucket. Default: - No ObjectOwnership configuration. By default, Amazon S3 sets Object Ownership to ``Bucket owner enforced``. This means ACLs are disabled and the bucket owner will own every object.
1999
2105
  :param public_read_access: Grants public read access to all objects in the bucket. Similar to calling ``bucket.grantPublicAccess()`` Default: false
2000
2106
  :param removal_policy: Policy to apply when the bucket is removed from this stack. Default: - The bucket will be orphaned.
2107
+ :param replication_rules: A container for one or more replication rules. Default: - No replication
2001
2108
  :param server_access_logs_bucket: Destination bucket for the server access logs. Default: - If "serverAccessLogsPrefix" undefined - access logs disabled, otherwise - log to current bucket.
2002
2109
  :param server_access_logs_prefix: Optional log file prefix to use for the bucket's access logs. If defined without "serverAccessLogsBucket", enables access logs to current bucket with this prefix. Default: - No log file prefix
2003
2110
  :param target_object_key_format: Optional key format for log objects. Default: - the default key format is: [DestinationPrefix][YYYY]-[MM]-[DD]-[hh]-[mm]-[ss]-[UniqueString]
@@ -2055,6 +2162,7 @@ class BucketProps:
2055
2162
  check_type(argname="argument object_ownership", value=object_ownership, expected_type=type_hints["object_ownership"])
2056
2163
  check_type(argname="argument public_read_access", value=public_read_access, expected_type=type_hints["public_read_access"])
2057
2164
  check_type(argname="argument removal_policy", value=removal_policy, expected_type=type_hints["removal_policy"])
2165
+ check_type(argname="argument replication_rules", value=replication_rules, expected_type=type_hints["replication_rules"])
2058
2166
  check_type(argname="argument server_access_logs_bucket", value=server_access_logs_bucket, expected_type=type_hints["server_access_logs_bucket"])
2059
2167
  check_type(argname="argument server_access_logs_prefix", value=server_access_logs_prefix, expected_type=type_hints["server_access_logs_prefix"])
2060
2168
  check_type(argname="argument target_object_key_format", value=target_object_key_format, expected_type=type_hints["target_object_key_format"])
@@ -2110,6 +2218,8 @@ class BucketProps:
2110
2218
  self._values["public_read_access"] = public_read_access
2111
2219
  if removal_policy is not None:
2112
2220
  self._values["removal_policy"] = removal_policy
2221
+ if replication_rules is not None:
2222
+ self._values["replication_rules"] = replication_rules
2113
2223
  if server_access_logs_bucket is not None:
2114
2224
  self._values["server_access_logs_bucket"] = server_access_logs_bucket
2115
2225
  if server_access_logs_prefix is not None:
@@ -2400,6 +2510,15 @@ class BucketProps:
2400
2510
  result = self._values.get("removal_policy")
2401
2511
  return typing.cast(typing.Optional[_RemovalPolicy_9f93c814], result)
2402
2512
 
2513
+ @builtins.property
2514
+ def replication_rules(self) -> typing.Optional[typing.List["ReplicationRule"]]:
2515
+ '''A container for one or more replication rules.
2516
+
2517
+ :default: - No replication
2518
+ '''
2519
+ result = self._values.get("replication_rules")
2520
+ return typing.cast(typing.Optional[typing.List["ReplicationRule"]], result)
2521
+
2403
2522
  @builtins.property
2404
2523
  def server_access_logs_bucket(self) -> typing.Optional["IBucket"]:
2405
2524
  '''Destination bucket for the server access logs.
@@ -6291,7 +6410,7 @@ class CfnBucket(
6291
6410
  For more information, see `Object Lifecycle Management <https://docs.aws.amazon.com/AmazonS3/latest/dev/object-lifecycle-mgmt.html>`_ in the *Amazon S3 User Guide* .
6292
6411
 
6293
6412
  :param rules: A lifecycle rule for individual objects in an Amazon S3 bucket.
6294
- :param transition_default_minimum_object_size:
6413
+ :param transition_default_minimum_object_size: Indicates which default minimum object size behavior is applied to the lifecycle configuration. .. epigraph:: This parameter applies to general purpose buckets only. It isn't supported for directory bucket lifecycle configurations. - ``all_storage_classes_128K`` - Objects smaller than 128 KB will not transition to any storage class by default. - ``varies_by_storage_class`` - Objects smaller than 128 KB will transition to Glacier Flexible Retrieval or Glacier Deep Archive storage classes. By default, all other storage classes will prevent transitions smaller than 128 KB. To customize the minimum object size for any transition you can add a filter that specifies a custom ``ObjectSizeGreaterThan`` or ``ObjectSizeLessThan`` in the body of your transition rule. Custom filters always take precedence over the default transition behavior.
6295
6414
 
6296
6415
  :see: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-lifecycleconfiguration.html
6297
6416
  :exampleMetadata: fixture=_generated
@@ -6388,7 +6507,17 @@ class CfnBucket(
6388
6507
  def transition_default_minimum_object_size(
6389
6508
  self,
6390
6509
  ) -> typing.Optional[builtins.str]:
6391
- '''
6510
+ '''Indicates which default minimum object size behavior is applied to the lifecycle configuration.
6511
+
6512
+ .. epigraph::
6513
+
6514
+ This parameter applies to general purpose buckets only. It isn't supported for directory bucket lifecycle configurations.
6515
+
6516
+ - ``all_storage_classes_128K`` - Objects smaller than 128 KB will not transition to any storage class by default.
6517
+ - ``varies_by_storage_class`` - Objects smaller than 128 KB will transition to Glacier Flexible Retrieval or Glacier Deep Archive storage classes. By default, all other storage classes will prevent transitions smaller than 128 KB.
6518
+
6519
+ To customize the minimum object size for any transition you can add a filter that specifies a custom ``ObjectSizeGreaterThan`` or ``ObjectSizeLessThan`` in the body of your transition rule. Custom filters always take precedence over the default transition behavior.
6520
+
6392
6521
  :see: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-lifecycleconfiguration.html#cfn-s3-bucket-lifecycleconfiguration-transitiondefaultminimumobjectsize
6393
6522
  '''
6394
6523
  result = self._values.get("transition_default_minimum_object_size")
@@ -15360,6 +15489,124 @@ class EventType(enum.Enum):
15360
15489
  '''
15361
15490
 
15362
15491
 
15492
+ @jsii.data_type(
15493
+ jsii_type="aws-cdk-lib.aws_s3.Filter",
15494
+ jsii_struct_bases=[],
15495
+ name_mapping={"prefix": "prefix", "tags": "tags"},
15496
+ )
15497
+ class Filter:
15498
+ def __init__(
15499
+ self,
15500
+ *,
15501
+ prefix: typing.Optional[builtins.str] = None,
15502
+ tags: typing.Optional[typing.Sequence[typing.Union["Tag", typing.Dict[builtins.str, typing.Any]]]] = None,
15503
+ ) -> None:
15504
+ '''A filter that identifies the subset of objects to which the replication rule applies.
15505
+
15506
+ :param prefix: An object key name prefix that identifies the object or objects to which the rule applies. Default: - applies to all objects
15507
+ :param tags: The tag array used for tag filters. The rule applies only to objects that have the tag in this set. Default: - applies to all objects
15508
+
15509
+ :exampleMetadata: infused
15510
+
15511
+ Example::
15512
+
15513
+ # destination_bucket1: s3.IBucket
15514
+ # destination_bucket2: s3.IBucket
15515
+ # kms_key: kms.IKey
15516
+
15517
+
15518
+ source_bucket = s3.Bucket(self, "SourceBucket",
15519
+ # Versioning must be enabled on both the source and destination bucket
15520
+ versioned=True,
15521
+ replication_rules=[s3.ReplicationRule(
15522
+ # The destination bucket for the replication rule.
15523
+ destination=destination_bucket1,
15524
+ # The priority of the rule.
15525
+ # Amazon S3 will attempt to replicate objects according to all replication rules.
15526
+ # However, if there are two or more rules with the same destination bucket, then objects will be replicated according to the rule with the highest priority.
15527
+ # The higher the number, the higher the priority.
15528
+ # It is essential to specify priority explicitly when the replication configuration has multiple rules.
15529
+ priority=1
15530
+ ), s3.ReplicationRule(
15531
+ destination=destination_bucket2,
15532
+ priority=2,
15533
+ # Whether to specify S3 Replication Time Control (S3 RTC).
15534
+ # S3 RTC replicates most objects that you upload to Amazon S3 in seconds,
15535
+ # and 99.99 percent of those objects within specified time.
15536
+ replication_time_control=s3.ReplicationTimeValue.FIFTEEN_MINUTES,
15537
+ # Whether to enable replication metrics about S3 RTC.
15538
+ # If set, metrics will be output to indicate whether replication by S3 RTC took longer than the configured time.
15539
+ metrics=s3.ReplicationTimeValue.FIFTEEN_MINUTES,
15540
+ # The kms key to use for the destination bucket.
15541
+ kms_key=kms_key,
15542
+ # The storage class to use for the destination bucket.
15543
+ storage_class=s3.StorageClass.INFREQUENT_ACCESS,
15544
+ # Whether to replicate objects with SSE-KMS encryption.
15545
+ sse_kms_encrypted_objects=False,
15546
+ # Whether to replicate modifications on replicas.
15547
+ replica_modifications=True,
15548
+ # Whether to replicate delete markers.
15549
+ # This property cannot be enabled if the replication rule has a tag filter.
15550
+ delete_marker_replication=False,
15551
+ # The ID of the rule.
15552
+ id="full-settings-rule",
15553
+ # The object filter for the rule.
15554
+ filter=s3.Filter(
15555
+ # The prefix filter for the rule.
15556
+ prefix="prefix",
15557
+ # The tag filter for the rule.
15558
+ tags=[s3.Tag(
15559
+ key="tagKey",
15560
+ value="tagValue"
15561
+ )
15562
+ ]
15563
+ )
15564
+ )
15565
+ ]
15566
+ )
15567
+ '''
15568
+ if __debug__:
15569
+ type_hints = typing.get_type_hints(_typecheckingstub__ff4b8a813f6812ab1464fced92fa61b97e151767705973ce994c0970fde139df)
15570
+ check_type(argname="argument prefix", value=prefix, expected_type=type_hints["prefix"])
15571
+ check_type(argname="argument tags", value=tags, expected_type=type_hints["tags"])
15572
+ self._values: typing.Dict[builtins.str, typing.Any] = {}
15573
+ if prefix is not None:
15574
+ self._values["prefix"] = prefix
15575
+ if tags is not None:
15576
+ self._values["tags"] = tags
15577
+
15578
+ @builtins.property
15579
+ def prefix(self) -> typing.Optional[builtins.str]:
15580
+ '''An object key name prefix that identifies the object or objects to which the rule applies.
15581
+
15582
+ :default: - applies to all objects
15583
+ '''
15584
+ result = self._values.get("prefix")
15585
+ return typing.cast(typing.Optional[builtins.str], result)
15586
+
15587
+ @builtins.property
15588
+ def tags(self) -> typing.Optional[typing.List["Tag"]]:
15589
+ '''The tag array used for tag filters.
15590
+
15591
+ The rule applies only to objects that have the tag in this set.
15592
+
15593
+ :default: - applies to all objects
15594
+ '''
15595
+ result = self._values.get("tags")
15596
+ return typing.cast(typing.Optional[typing.List["Tag"]], result)
15597
+
15598
+ def __eq__(self, rhs: typing.Any) -> builtins.bool:
15599
+ return isinstance(rhs, self.__class__) and rhs._values == self._values
15600
+
15601
+ def __ne__(self, rhs: typing.Any) -> builtins.bool:
15602
+ return not (rhs == self)
15603
+
15604
+ def __repr__(self) -> str:
15605
+ return "Filter(%s)" % ", ".join(
15606
+ k + "=" + repr(v) for k, v in self._values.items()
15607
+ )
15608
+
15609
+
15363
15610
  @jsii.enum(jsii_type="aws-cdk-lib.aws_s3.HttpMethods")
15364
15611
  class HttpMethods(enum.Enum):
15365
15612
  '''All http request methods.'''
@@ -15467,6 +15714,16 @@ class IBucket(_IResource_c80c4260, typing_extensions.Protocol):
15467
15714
  def policy(self, value: typing.Optional[BucketPolicy]) -> None:
15468
15715
  ...
15469
15716
 
15717
+ @builtins.property
15718
+ @jsii.member(jsii_name="replicationRoleArn")
15719
+ def replication_role_arn(self) -> typing.Optional[builtins.str]:
15720
+ '''Role used to set up permissions on this bucket for replication.'''
15721
+ ...
15722
+
15723
+ @replication_role_arn.setter
15724
+ def replication_role_arn(self, value: typing.Optional[builtins.str]) -> None:
15725
+ ...
15726
+
15470
15727
  @jsii.member(jsii_name="addEventNotification")
15471
15728
  def add_event_notification(
15472
15729
  self,
@@ -15523,6 +15780,25 @@ class IBucket(_IResource_c80c4260, typing_extensions.Protocol):
15523
15780
  '''
15524
15781
  ...
15525
15782
 
15783
+ @jsii.member(jsii_name="addReplicationPolicy")
15784
+ def add_replication_policy(
15785
+ self,
15786
+ role_arn: builtins.str,
15787
+ access_control_transition: typing.Optional[builtins.bool] = None,
15788
+ account: typing.Optional[builtins.str] = None,
15789
+ ) -> None:
15790
+ '''Function to add required permissions to the destination bucket for cross account replication.
15791
+
15792
+ These permissions will be added as a resource based policy on the bucket.
15793
+
15794
+ :param role_arn: -
15795
+ :param access_control_transition: -
15796
+ :param account: -
15797
+
15798
+ :see: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-accesscontroltranslation.html
15799
+ '''
15800
+ ...
15801
+
15526
15802
  @jsii.member(jsii_name="addToResourcePolicy")
15527
15803
  def add_to_resource_policy(
15528
15804
  self,
@@ -15982,6 +16258,19 @@ class _IBucketProxy(
15982
16258
  check_type(argname="argument value", value=value, expected_type=type_hints["value"])
15983
16259
  jsii.set(self, "policy", value) # pyright: ignore[reportArgumentType]
15984
16260
 
16261
+ @builtins.property
16262
+ @jsii.member(jsii_name="replicationRoleArn")
16263
+ def replication_role_arn(self) -> typing.Optional[builtins.str]:
16264
+ '''Role used to set up permissions on this bucket for replication.'''
16265
+ return typing.cast(typing.Optional[builtins.str], jsii.get(self, "replicationRoleArn"))
16266
+
16267
+ @replication_role_arn.setter
16268
+ def replication_role_arn(self, value: typing.Optional[builtins.str]) -> None:
16269
+ if __debug__:
16270
+ type_hints = typing.get_type_hints(_typecheckingstub__45b20ede572212a5391ce58bc0693933ac9d1bc950c6cafac24d9b7d29ad1405)
16271
+ check_type(argname="argument value", value=value, expected_type=type_hints["value"])
16272
+ jsii.set(self, "replicationRoleArn", value) # pyright: ignore[reportArgumentType]
16273
+
15985
16274
  @jsii.member(jsii_name="addEventNotification")
15986
16275
  def add_event_notification(
15987
16276
  self,
@@ -16051,6 +16340,30 @@ class _IBucketProxy(
16051
16340
  check_type(argname="argument filters", value=filters, expected_type=typing.Tuple[type_hints["filters"], ...]) # pyright: ignore [reportGeneralTypeIssues]
16052
16341
  return typing.cast(None, jsii.invoke(self, "addObjectRemovedNotification", [dest, *filters]))
16053
16342
 
16343
+ @jsii.member(jsii_name="addReplicationPolicy")
16344
+ def add_replication_policy(
16345
+ self,
16346
+ role_arn: builtins.str,
16347
+ access_control_transition: typing.Optional[builtins.bool] = None,
16348
+ account: typing.Optional[builtins.str] = None,
16349
+ ) -> None:
16350
+ '''Function to add required permissions to the destination bucket for cross account replication.
16351
+
16352
+ These permissions will be added as a resource based policy on the bucket.
16353
+
16354
+ :param role_arn: -
16355
+ :param access_control_transition: -
16356
+ :param account: -
16357
+
16358
+ :see: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-accesscontroltranslation.html
16359
+ '''
16360
+ if __debug__:
16361
+ type_hints = typing.get_type_hints(_typecheckingstub__6c2e7fc14ca3997ce00436db7203d2e5669fde630c0dd481f20a6192f12706c7)
16362
+ check_type(argname="argument role_arn", value=role_arn, expected_type=type_hints["role_arn"])
16363
+ check_type(argname="argument access_control_transition", value=access_control_transition, expected_type=type_hints["access_control_transition"])
16364
+ check_type(argname="argument account", value=account, expected_type=type_hints["account"])
16365
+ return typing.cast(None, jsii.invoke(self, "addReplicationPolicy", [role_arn, access_control_transition, account]))
16366
+
16054
16367
  @jsii.member(jsii_name="addToResourcePolicy")
16055
16368
  def add_to_resource_policy(
16056
16369
  self,
@@ -18098,6 +18411,362 @@ class ReplaceKey(metaclass=jsii.JSIIMeta, jsii_type="aws-cdk-lib.aws_s3.ReplaceK
18098
18411
  return typing.cast(typing.Optional[builtins.str], jsii.get(self, "withKey"))
18099
18412
 
18100
18413
 
18414
+ @jsii.data_type(
18415
+ jsii_type="aws-cdk-lib.aws_s3.ReplicationRule",
18416
+ jsii_struct_bases=[],
18417
+ name_mapping={
18418
+ "destination": "destination",
18419
+ "access_control_transition": "accessControlTransition",
18420
+ "delete_marker_replication": "deleteMarkerReplication",
18421
+ "filter": "filter",
18422
+ "id": "id",
18423
+ "kms_key": "kmsKey",
18424
+ "metrics": "metrics",
18425
+ "priority": "priority",
18426
+ "replica_modifications": "replicaModifications",
18427
+ "replication_time_control": "replicationTimeControl",
18428
+ "sse_kms_encrypted_objects": "sseKmsEncryptedObjects",
18429
+ "storage_class": "storageClass",
18430
+ },
18431
+ )
18432
+ class ReplicationRule:
18433
+ def __init__(
18434
+ self,
18435
+ *,
18436
+ destination: IBucket,
18437
+ access_control_transition: typing.Optional[builtins.bool] = None,
18438
+ delete_marker_replication: typing.Optional[builtins.bool] = None,
18439
+ filter: typing.Optional[typing.Union[Filter, typing.Dict[builtins.str, typing.Any]]] = None,
18440
+ id: typing.Optional[builtins.str] = None,
18441
+ kms_key: typing.Optional[_IKey_5f11635f] = None,
18442
+ metrics: typing.Optional["ReplicationTimeValue"] = None,
18443
+ priority: typing.Optional[jsii.Number] = None,
18444
+ replica_modifications: typing.Optional[builtins.bool] = None,
18445
+ replication_time_control: typing.Optional["ReplicationTimeValue"] = None,
18446
+ sse_kms_encrypted_objects: typing.Optional[builtins.bool] = None,
18447
+ storage_class: typing.Optional["StorageClass"] = None,
18448
+ ) -> None:
18449
+ '''Specifies which Amazon S3 objects to replicate and where to store the replicas.
18450
+
18451
+ :param destination: The destination bucket for the replicated objects. The destination can be either in the same AWS account or a cross account. If you want to configure cross-account replication, the destination bucket must have a policy that allows the source bucket to replicate objects to it.
18452
+ :param access_control_transition: Whether to want to change replica ownership to the AWS account that owns the destination bucket. This can only be specified if the source bucket and the destination bucket are not in the same AWS account. Default: - The replicas are owned by same AWS account that owns the source object
18453
+ :param delete_marker_replication: Specifies whether Amazon S3 replicates delete markers. Default: - delete markers in source bucket is not replicated to destination bucket
18454
+ :param filter: A filter that identifies the subset of objects to which the replication rule applies. Default: - applies to all objects
18455
+ :param id: A unique identifier for the rule. The maximum value is 255 characters. Default: - auto generated random ID
18456
+ :param kms_key: The customer managed AWS KMS key stored in AWS Key Management Service (KMS) for the destination bucket. Amazon S3 uses this key to encrypt replica objects. Amazon S3 only supports symmetric encryption KMS keys. Default: - Amazon S3 uses the AWS managed KMS key for encryption
18457
+ :param metrics: A container specifying replication metrics-related settings enabling replication metrics and events. When a value is set, metrics will be output to indicate whether the replication took longer than the specified time. Default: - Replication metrics are not enabled
18458
+ :param priority: The priority indicates which rule has precedence whenever two or more replication rules conflict. Amazon S3 will attempt to replicate objects according to all replication rules. However, if there are two or more rules with the same destination bucket, then objects will be replicated according to the rule with the highest priority. The higher the number, the higher the priority. It is essential to specify priority explicitly when the replication configuration has multiple rules. Default: 0
18459
+ :param replica_modifications: Specifies whether Amazon S3 replicates modifications on replicas. Default: false
18460
+ :param replication_time_control: Specifying S3 Replication Time Control (S3 RTC), including whether S3 RTC is enabled and the time when all objects and operations on objects must be replicated. Default: - S3 Replication Time Control is not enabled
18461
+ :param sse_kms_encrypted_objects: Specifies whether Amazon S3 replicates objects created with server-side encryption using an AWS KMS key stored in AWS Key Management Service. Default: false
18462
+ :param storage_class: The storage class to use when replicating objects, such as S3 Standard or reduced redundancy. Default: - The storage class of the source object
18463
+
18464
+ :exampleMetadata: fixture=_generated
18465
+
18466
+ Example::
18467
+
18468
+ # The code below shows an example of how to instantiate this type.
18469
+ # The values are placeholders you should change.
18470
+ from aws_cdk import aws_kms as kms
18471
+ from aws_cdk import aws_s3 as s3
18472
+
18473
+ # bucket: s3.Bucket
18474
+ # key: kms.Key
18475
+ # replication_time_value: s3.ReplicationTimeValue
18476
+ # storage_class: s3.StorageClass
18477
+
18478
+ replication_rule = s3.ReplicationRule(
18479
+ destination=bucket,
18480
+
18481
+ # the properties below are optional
18482
+ access_control_transition=False,
18483
+ delete_marker_replication=False,
18484
+ filter=s3.Filter(
18485
+ prefix="prefix",
18486
+ tags=[s3.Tag(
18487
+ key="key",
18488
+ value="value"
18489
+ )]
18490
+ ),
18491
+ id="id",
18492
+ kms_key=key,
18493
+ metrics=replication_time_value,
18494
+ priority=123,
18495
+ replica_modifications=False,
18496
+ replication_time_control=replication_time_value,
18497
+ sse_kms_encrypted_objects=False,
18498
+ storage_class=storage_class
18499
+ )
18500
+ '''
18501
+ if isinstance(filter, dict):
18502
+ filter = Filter(**filter)
18503
+ if __debug__:
18504
+ type_hints = typing.get_type_hints(_typecheckingstub__2eb99af4044ffb625b707ac7ff5de3796f00ec1217ed24e21f6c240e90e846f0)
18505
+ check_type(argname="argument destination", value=destination, expected_type=type_hints["destination"])
18506
+ check_type(argname="argument access_control_transition", value=access_control_transition, expected_type=type_hints["access_control_transition"])
18507
+ check_type(argname="argument delete_marker_replication", value=delete_marker_replication, expected_type=type_hints["delete_marker_replication"])
18508
+ check_type(argname="argument filter", value=filter, expected_type=type_hints["filter"])
18509
+ check_type(argname="argument id", value=id, expected_type=type_hints["id"])
18510
+ check_type(argname="argument kms_key", value=kms_key, expected_type=type_hints["kms_key"])
18511
+ check_type(argname="argument metrics", value=metrics, expected_type=type_hints["metrics"])
18512
+ check_type(argname="argument priority", value=priority, expected_type=type_hints["priority"])
18513
+ check_type(argname="argument replica_modifications", value=replica_modifications, expected_type=type_hints["replica_modifications"])
18514
+ check_type(argname="argument replication_time_control", value=replication_time_control, expected_type=type_hints["replication_time_control"])
18515
+ check_type(argname="argument sse_kms_encrypted_objects", value=sse_kms_encrypted_objects, expected_type=type_hints["sse_kms_encrypted_objects"])
18516
+ check_type(argname="argument storage_class", value=storage_class, expected_type=type_hints["storage_class"])
18517
+ self._values: typing.Dict[builtins.str, typing.Any] = {
18518
+ "destination": destination,
18519
+ }
18520
+ if access_control_transition is not None:
18521
+ self._values["access_control_transition"] = access_control_transition
18522
+ if delete_marker_replication is not None:
18523
+ self._values["delete_marker_replication"] = delete_marker_replication
18524
+ if filter is not None:
18525
+ self._values["filter"] = filter
18526
+ if id is not None:
18527
+ self._values["id"] = id
18528
+ if kms_key is not None:
18529
+ self._values["kms_key"] = kms_key
18530
+ if metrics is not None:
18531
+ self._values["metrics"] = metrics
18532
+ if priority is not None:
18533
+ self._values["priority"] = priority
18534
+ if replica_modifications is not None:
18535
+ self._values["replica_modifications"] = replica_modifications
18536
+ if replication_time_control is not None:
18537
+ self._values["replication_time_control"] = replication_time_control
18538
+ if sse_kms_encrypted_objects is not None:
18539
+ self._values["sse_kms_encrypted_objects"] = sse_kms_encrypted_objects
18540
+ if storage_class is not None:
18541
+ self._values["storage_class"] = storage_class
18542
+
18543
+ @builtins.property
18544
+ def destination(self) -> IBucket:
18545
+ '''The destination bucket for the replicated objects.
18546
+
18547
+ The destination can be either in the same AWS account or a cross account.
18548
+
18549
+ If you want to configure cross-account replication,
18550
+ the destination bucket must have a policy that allows the source bucket to replicate objects to it.
18551
+
18552
+ :see: https://docs.aws.amazon.com/AmazonS3/latest/userguide/replication-walkthrough-2.html
18553
+ '''
18554
+ result = self._values.get("destination")
18555
+ assert result is not None, "Required property 'destination' is missing"
18556
+ return typing.cast(IBucket, result)
18557
+
18558
+ @builtins.property
18559
+ def access_control_transition(self) -> typing.Optional[builtins.bool]:
18560
+ '''Whether to want to change replica ownership to the AWS account that owns the destination bucket.
18561
+
18562
+ This can only be specified if the source bucket and the destination bucket are not in the same AWS account.
18563
+
18564
+ :default: - The replicas are owned by same AWS account that owns the source object
18565
+ '''
18566
+ result = self._values.get("access_control_transition")
18567
+ return typing.cast(typing.Optional[builtins.bool], result)
18568
+
18569
+ @builtins.property
18570
+ def delete_marker_replication(self) -> typing.Optional[builtins.bool]:
18571
+ '''Specifies whether Amazon S3 replicates delete markers.
18572
+
18573
+ :default: - delete markers in source bucket is not replicated to destination bucket
18574
+
18575
+ :see: https://docs.aws.amazon.com/AmazonS3/latest/userguide/delete-marker-replication.html
18576
+ '''
18577
+ result = self._values.get("delete_marker_replication")
18578
+ return typing.cast(typing.Optional[builtins.bool], result)
18579
+
18580
+ @builtins.property
18581
+ def filter(self) -> typing.Optional[Filter]:
18582
+ '''A filter that identifies the subset of objects to which the replication rule applies.
18583
+
18584
+ :default: - applies to all objects
18585
+ '''
18586
+ result = self._values.get("filter")
18587
+ return typing.cast(typing.Optional[Filter], result)
18588
+
18589
+ @builtins.property
18590
+ def id(self) -> typing.Optional[builtins.str]:
18591
+ '''A unique identifier for the rule.
18592
+
18593
+ The maximum value is 255 characters.
18594
+
18595
+ :default: - auto generated random ID
18596
+ '''
18597
+ result = self._values.get("id")
18598
+ return typing.cast(typing.Optional[builtins.str], result)
18599
+
18600
+ @builtins.property
18601
+ def kms_key(self) -> typing.Optional[_IKey_5f11635f]:
18602
+ '''The customer managed AWS KMS key stored in AWS Key Management Service (KMS) for the destination bucket.
18603
+
18604
+ Amazon S3 uses this key to encrypt replica objects.
18605
+
18606
+ Amazon S3 only supports symmetric encryption KMS keys.
18607
+
18608
+ :default: - Amazon S3 uses the AWS managed KMS key for encryption
18609
+
18610
+ :see: https://docs.aws.amazon.com/kms/latest/developerguide/symmetric-asymmetric.html
18611
+ '''
18612
+ result = self._values.get("kms_key")
18613
+ return typing.cast(typing.Optional[_IKey_5f11635f], result)
18614
+
18615
+ @builtins.property
18616
+ def metrics(self) -> typing.Optional["ReplicationTimeValue"]:
18617
+ '''A container specifying replication metrics-related settings enabling replication metrics and events.
18618
+
18619
+ When a value is set, metrics will be output to indicate whether the replication took longer than the specified time.
18620
+
18621
+ :default: - Replication metrics are not enabled
18622
+ '''
18623
+ result = self._values.get("metrics")
18624
+ return typing.cast(typing.Optional["ReplicationTimeValue"], result)
18625
+
18626
+ @builtins.property
18627
+ def priority(self) -> typing.Optional[jsii.Number]:
18628
+ '''The priority indicates which rule has precedence whenever two or more replication rules conflict.
18629
+
18630
+ Amazon S3 will attempt to replicate objects according to all replication rules.
18631
+ However, if there are two or more rules with the same destination bucket,
18632
+ then objects will be replicated according to the rule with the highest priority.
18633
+
18634
+ The higher the number, the higher the priority.
18635
+
18636
+ It is essential to specify priority explicitly when the replication configuration has multiple rules.
18637
+
18638
+ :default: 0
18639
+ '''
18640
+ result = self._values.get("priority")
18641
+ return typing.cast(typing.Optional[jsii.Number], result)
18642
+
18643
+ @builtins.property
18644
+ def replica_modifications(self) -> typing.Optional[builtins.bool]:
18645
+ '''Specifies whether Amazon S3 replicates modifications on replicas.
18646
+
18647
+ :default: false
18648
+ '''
18649
+ result = self._values.get("replica_modifications")
18650
+ return typing.cast(typing.Optional[builtins.bool], result)
18651
+
18652
+ @builtins.property
18653
+ def replication_time_control(self) -> typing.Optional["ReplicationTimeValue"]:
18654
+ '''Specifying S3 Replication Time Control (S3 RTC), including whether S3 RTC is enabled and the time when all objects and operations on objects must be replicated.
18655
+
18656
+ :default: - S3 Replication Time Control is not enabled
18657
+ '''
18658
+ result = self._values.get("replication_time_control")
18659
+ return typing.cast(typing.Optional["ReplicationTimeValue"], result)
18660
+
18661
+ @builtins.property
18662
+ def sse_kms_encrypted_objects(self) -> typing.Optional[builtins.bool]:
18663
+ '''Specifies whether Amazon S3 replicates objects created with server-side encryption using an AWS KMS key stored in AWS Key Management Service.
18664
+
18665
+ :default: false
18666
+ '''
18667
+ result = self._values.get("sse_kms_encrypted_objects")
18668
+ return typing.cast(typing.Optional[builtins.bool], result)
18669
+
18670
+ @builtins.property
18671
+ def storage_class(self) -> typing.Optional["StorageClass"]:
18672
+ '''The storage class to use when replicating objects, such as S3 Standard or reduced redundancy.
18673
+
18674
+ :default: - The storage class of the source object
18675
+ '''
18676
+ result = self._values.get("storage_class")
18677
+ return typing.cast(typing.Optional["StorageClass"], result)
18678
+
18679
+ def __eq__(self, rhs: typing.Any) -> builtins.bool:
18680
+ return isinstance(rhs, self.__class__) and rhs._values == self._values
18681
+
18682
+ def __ne__(self, rhs: typing.Any) -> builtins.bool:
18683
+ return not (rhs == self)
18684
+
18685
+ def __repr__(self) -> str:
18686
+ return "ReplicationRule(%s)" % ", ".join(
18687
+ k + "=" + repr(v) for k, v in self._values.items()
18688
+ )
18689
+
18690
+
18691
+ class ReplicationTimeValue(
18692
+ metaclass=jsii.JSIIMeta,
18693
+ jsii_type="aws-cdk-lib.aws_s3.ReplicationTimeValue",
18694
+ ):
18695
+ '''The replication time value used for S3 Replication Time Control (S3 RTC).
18696
+
18697
+ :exampleMetadata: infused
18698
+
18699
+ Example::
18700
+
18701
+ # destination_bucket1: s3.IBucket
18702
+ # destination_bucket2: s3.IBucket
18703
+ # kms_key: kms.IKey
18704
+
18705
+
18706
+ source_bucket = s3.Bucket(self, "SourceBucket",
18707
+ # Versioning must be enabled on both the source and destination bucket
18708
+ versioned=True,
18709
+ replication_rules=[s3.ReplicationRule(
18710
+ # The destination bucket for the replication rule.
18711
+ destination=destination_bucket1,
18712
+ # The priority of the rule.
18713
+ # Amazon S3 will attempt to replicate objects according to all replication rules.
18714
+ # However, if there are two or more rules with the same destination bucket, then objects will be replicated according to the rule with the highest priority.
18715
+ # The higher the number, the higher the priority.
18716
+ # It is essential to specify priority explicitly when the replication configuration has multiple rules.
18717
+ priority=1
18718
+ ), s3.ReplicationRule(
18719
+ destination=destination_bucket2,
18720
+ priority=2,
18721
+ # Whether to specify S3 Replication Time Control (S3 RTC).
18722
+ # S3 RTC replicates most objects that you upload to Amazon S3 in seconds,
18723
+ # and 99.99 percent of those objects within specified time.
18724
+ replication_time_control=s3.ReplicationTimeValue.FIFTEEN_MINUTES,
18725
+ # Whether to enable replication metrics about S3 RTC.
18726
+ # If set, metrics will be output to indicate whether replication by S3 RTC took longer than the configured time.
18727
+ metrics=s3.ReplicationTimeValue.FIFTEEN_MINUTES,
18728
+ # The kms key to use for the destination bucket.
18729
+ kms_key=kms_key,
18730
+ # The storage class to use for the destination bucket.
18731
+ storage_class=s3.StorageClass.INFREQUENT_ACCESS,
18732
+ # Whether to replicate objects with SSE-KMS encryption.
18733
+ sse_kms_encrypted_objects=False,
18734
+ # Whether to replicate modifications on replicas.
18735
+ replica_modifications=True,
18736
+ # Whether to replicate delete markers.
18737
+ # This property cannot be enabled if the replication rule has a tag filter.
18738
+ delete_marker_replication=False,
18739
+ # The ID of the rule.
18740
+ id="full-settings-rule",
18741
+ # The object filter for the rule.
18742
+ filter=s3.Filter(
18743
+ # The prefix filter for the rule.
18744
+ prefix="prefix",
18745
+ # The tag filter for the rule.
18746
+ tags=[s3.Tag(
18747
+ key="tagKey",
18748
+ value="tagValue"
18749
+ )
18750
+ ]
18751
+ )
18752
+ )
18753
+ ]
18754
+ )
18755
+ '''
18756
+
18757
+ @jsii.python.classproperty
18758
+ @jsii.member(jsii_name="FIFTEEN_MINUTES")
18759
+ def FIFTEEN_MINUTES(cls) -> "ReplicationTimeValue":
18760
+ '''Fifteen minutes.'''
18761
+ return typing.cast("ReplicationTimeValue", jsii.sget(cls, "FIFTEEN_MINUTES"))
18762
+
18763
+ @builtins.property
18764
+ @jsii.member(jsii_name="minutes")
18765
+ def minutes(self) -> jsii.Number:
18766
+ '''the time in minutes.'''
18767
+ return typing.cast(jsii.Number, jsii.get(self, "minutes"))
18768
+
18769
+
18101
18770
  @jsii.data_type(
18102
18771
  jsii_type="aws-cdk-lib.aws_s3.RoutingRule",
18103
18772
  jsii_struct_bases=[],
@@ -18916,6 +19585,30 @@ class BucketBase(
18916
19585
  check_type(argname="argument filters", value=filters, expected_type=typing.Tuple[type_hints["filters"], ...]) # pyright: ignore [reportGeneralTypeIssues]
18917
19586
  return typing.cast(None, jsii.invoke(self, "addObjectRemovedNotification", [dest, *filters]))
18918
19587
 
19588
+ @jsii.member(jsii_name="addReplicationPolicy")
19589
+ def add_replication_policy(
19590
+ self,
19591
+ role_arn: builtins.str,
19592
+ access_control_transition: typing.Optional[builtins.bool] = None,
19593
+ account: typing.Optional[builtins.str] = None,
19594
+ ) -> None:
19595
+ '''Function to add required permissions to the destination bucket for cross account replication.
19596
+
19597
+ These permissions will be added as a resource based policy on the bucket
19598
+
19599
+ :param role_arn: -
19600
+ :param access_control_transition: -
19601
+ :param account: -
19602
+
19603
+ :see: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-accesscontroltranslation.html
19604
+ '''
19605
+ if __debug__:
19606
+ type_hints = typing.get_type_hints(_typecheckingstub__2baf8c6982c06606b5434f658a8175f6838f55345a6d423d335af89dfa1728cd)
19607
+ check_type(argname="argument role_arn", value=role_arn, expected_type=type_hints["role_arn"])
19608
+ check_type(argname="argument access_control_transition", value=access_control_transition, expected_type=type_hints["access_control_transition"])
19609
+ check_type(argname="argument account", value=account, expected_type=type_hints["account"])
19610
+ return typing.cast(None, jsii.invoke(self, "addReplicationPolicy", [role_arn, access_control_transition, account]))
19611
+
18919
19612
  @jsii.member(jsii_name="addToResourcePolicy")
18920
19613
  def add_to_resource_policy(
18921
19614
  self,
@@ -19515,6 +20208,18 @@ class BucketBase(
19515
20208
  def policy(self, value: typing.Optional[BucketPolicy]) -> None:
19516
20209
  ...
19517
20210
 
20211
+ @builtins.property
20212
+ @jsii.member(jsii_name="replicationRoleArn")
20213
+ @abc.abstractmethod
20214
+ def replication_role_arn(self) -> typing.Optional[builtins.str]:
20215
+ '''Role used to set up permissions on this bucket for replication.'''
20216
+ ...
20217
+
20218
+ @replication_role_arn.setter
20219
+ @abc.abstractmethod
20220
+ def replication_role_arn(self, value: typing.Optional[builtins.str]) -> None:
20221
+ ...
20222
+
19518
20223
 
19519
20224
  class _BucketBaseProxy(
19520
20225
  BucketBase,
@@ -19617,6 +20322,19 @@ class _BucketBaseProxy(
19617
20322
  check_type(argname="argument value", value=value, expected_type=type_hints["value"])
19618
20323
  jsii.set(self, "policy", value) # pyright: ignore[reportArgumentType]
19619
20324
 
20325
+ @builtins.property
20326
+ @jsii.member(jsii_name="replicationRoleArn")
20327
+ def replication_role_arn(self) -> typing.Optional[builtins.str]:
20328
+ '''Role used to set up permissions on this bucket for replication.'''
20329
+ return typing.cast(typing.Optional[builtins.str], jsii.get(self, "replicationRoleArn"))
20330
+
20331
+ @replication_role_arn.setter
20332
+ def replication_role_arn(self, value: typing.Optional[builtins.str]) -> None:
20333
+ if __debug__:
20334
+ type_hints = typing.get_type_hints(_typecheckingstub__0f4abefa77a469d6581b7fbd2e412d7d2f099dc365ac4138047e78313165885b)
20335
+ check_type(argname="argument value", value=value, expected_type=type_hints["value"])
20336
+ jsii.set(self, "replicationRoleArn", value) # pyright: ignore[reportArgumentType]
20337
+
19620
20338
  # Adding a "__jsii_proxy_class__(): typing.Type" function to the abstract class
19621
20339
  typing.cast(typing.Any, BucketBase).__jsii_proxy_class__ = lambda : _BucketBaseProxy
19622
20340
 
@@ -19672,6 +20390,7 @@ class Bucket(
19672
20390
  object_ownership: typing.Optional[ObjectOwnership] = None,
19673
20391
  public_read_access: typing.Optional[builtins.bool] = None,
19674
20392
  removal_policy: typing.Optional[_RemovalPolicy_9f93c814] = None,
20393
+ replication_rules: typing.Optional[typing.Sequence[typing.Union[ReplicationRule, typing.Dict[builtins.str, typing.Any]]]] = None,
19675
20394
  server_access_logs_bucket: typing.Optional[IBucket] = None,
19676
20395
  server_access_logs_prefix: typing.Optional[builtins.str] = None,
19677
20396
  target_object_key_format: typing.Optional[TargetObjectKeyFormat] = None,
@@ -19708,6 +20427,7 @@ class Bucket(
19708
20427
  :param object_ownership: The objectOwnership of the bucket. Default: - No ObjectOwnership configuration. By default, Amazon S3 sets Object Ownership to ``Bucket owner enforced``. This means ACLs are disabled and the bucket owner will own every object.
19709
20428
  :param public_read_access: Grants public read access to all objects in the bucket. Similar to calling ``bucket.grantPublicAccess()`` Default: false
19710
20429
  :param removal_policy: Policy to apply when the bucket is removed from this stack. Default: - The bucket will be orphaned.
20430
+ :param replication_rules: A container for one or more replication rules. Default: - No replication
19711
20431
  :param server_access_logs_bucket: Destination bucket for the server access logs. Default: - If "serverAccessLogsPrefix" undefined - access logs disabled, otherwise - log to current bucket.
19712
20432
  :param server_access_logs_prefix: Optional log file prefix to use for the bucket's access logs. If defined without "serverAccessLogsBucket", enables access logs to current bucket with this prefix. Default: - No log file prefix
19713
20433
  :param target_object_key_format: Optional key format for log objects. Default: - the default key format is: [DestinationPrefix][YYYY]-[MM]-[DD]-[hh]-[mm]-[ss]-[UniqueString]
@@ -19746,6 +20466,7 @@ class Bucket(
19746
20466
  object_ownership=object_ownership,
19747
20467
  public_read_access=public_read_access,
19748
20468
  removal_policy=removal_policy,
20469
+ replication_rules=replication_rules,
19749
20470
  server_access_logs_bucket=server_access_logs_bucket,
19750
20471
  server_access_logs_prefix=server_access_logs_prefix,
19751
20472
  target_object_key_format=target_object_key_format,
@@ -20126,6 +20847,19 @@ class Bucket(
20126
20847
  check_type(argname="argument value", value=value, expected_type=type_hints["value"])
20127
20848
  jsii.set(self, "policy", value) # pyright: ignore[reportArgumentType]
20128
20849
 
20850
+ @builtins.property
20851
+ @jsii.member(jsii_name="replicationRoleArn")
20852
+ def replication_role_arn(self) -> typing.Optional[builtins.str]:
20853
+ '''Role used to set up permissions on this bucket for replication.'''
20854
+ return typing.cast(typing.Optional[builtins.str], jsii.get(self, "replicationRoleArn"))
20855
+
20856
+ @replication_role_arn.setter
20857
+ def replication_role_arn(self, value: typing.Optional[builtins.str]) -> None:
20858
+ if __debug__:
20859
+ type_hints = typing.get_type_hints(_typecheckingstub__3cb691a849de33681a4f0021424f266609c2785cf8cbf5306c98726a6230a9e2)
20860
+ check_type(argname="argument value", value=value, expected_type=type_hints["value"])
20861
+ jsii.set(self, "replicationRoleArn", value) # pyright: ignore[reportArgumentType]
20862
+
20129
20863
 
20130
20864
  __all__ = [
20131
20865
  "BlockPublicAccess",
@@ -20163,6 +20897,7 @@ __all__ = [
20163
20897
  "CfnStorageLensProps",
20164
20898
  "CorsRule",
20165
20899
  "EventType",
20900
+ "Filter",
20166
20901
  "HttpMethods",
20167
20902
  "IBucket",
20168
20903
  "IBucketNotificationDestination",
@@ -20184,6 +20919,8 @@ __all__ = [
20184
20919
  "RedirectProtocol",
20185
20920
  "RedirectTarget",
20186
20921
  "ReplaceKey",
20922
+ "ReplicationRule",
20923
+ "ReplicationTimeValue",
20187
20924
  "RoutingRule",
20188
20925
  "RoutingRuleCondition",
20189
20926
  "StorageClass",
@@ -20321,6 +21058,7 @@ def _typecheckingstub__f2ff878f2dca3dd037442155369c2fcc7bd194425c0967a7fd7bfa576
20321
21058
  object_ownership: typing.Optional[ObjectOwnership] = None,
20322
21059
  public_read_access: typing.Optional[builtins.bool] = None,
20323
21060
  removal_policy: typing.Optional[_RemovalPolicy_9f93c814] = None,
21061
+ replication_rules: typing.Optional[typing.Sequence[typing.Union[ReplicationRule, typing.Dict[builtins.str, typing.Any]]]] = None,
20324
21062
  server_access_logs_bucket: typing.Optional[IBucket] = None,
20325
21063
  server_access_logs_prefix: typing.Optional[builtins.str] = None,
20326
21064
  target_object_key_format: typing.Optional[TargetObjectKeyFormat] = None,
@@ -21781,12 +22519,26 @@ def _typecheckingstub__beafb715fedc4fd96130b462f30e56792d8aa655173f4d4fa2e8dcd77
21781
22519
  """Type checking stubs"""
21782
22520
  pass
21783
22521
 
22522
+ def _typecheckingstub__ff4b8a813f6812ab1464fced92fa61b97e151767705973ce994c0970fde139df(
22523
+ *,
22524
+ prefix: typing.Optional[builtins.str] = None,
22525
+ tags: typing.Optional[typing.Sequence[typing.Union[Tag, typing.Dict[builtins.str, typing.Any]]]] = None,
22526
+ ) -> None:
22527
+ """Type checking stubs"""
22528
+ pass
22529
+
21784
22530
  def _typecheckingstub__eee382ff86c17d46379012dcccee86976ea92e15cb6d63c3e3f4e853c058ac53(
21785
22531
  value: typing.Optional[BucketPolicy],
21786
22532
  ) -> None:
21787
22533
  """Type checking stubs"""
21788
22534
  pass
21789
22535
 
22536
+ def _typecheckingstub__45b20ede572212a5391ce58bc0693933ac9d1bc950c6cafac24d9b7d29ad1405(
22537
+ value: typing.Optional[builtins.str],
22538
+ ) -> None:
22539
+ """Type checking stubs"""
22540
+ pass
22541
+
21790
22542
  def _typecheckingstub__168148771b23de203b7e69eb1dbaf2f881de4c7cc276b7648b26fd4a3eddbcf0(
21791
22543
  event: EventType,
21792
22544
  dest: IBucketNotificationDestination,
@@ -21809,6 +22561,14 @@ def _typecheckingstub__4910aa7bbd431cf72fd4b6ab066e8ea5996c68d10a0bccf26fab5d478
21809
22561
  """Type checking stubs"""
21810
22562
  pass
21811
22563
 
22564
+ def _typecheckingstub__6c2e7fc14ca3997ce00436db7203d2e5669fde630c0dd481f20a6192f12706c7(
22565
+ role_arn: builtins.str,
22566
+ access_control_transition: typing.Optional[builtins.bool] = None,
22567
+ account: typing.Optional[builtins.str] = None,
22568
+ ) -> None:
22569
+ """Type checking stubs"""
22570
+ pass
22571
+
21812
22572
  def _typecheckingstub__53d6461d1a4f06eb11f149b8578ad4a818c59103b2c6b4af84212b71aed4c24b(
21813
22573
  permission: _PolicyStatement_0fe33853,
21814
22574
  ) -> None:
@@ -22069,6 +22829,24 @@ def _typecheckingstub__080e6df7f96363149eb8dfbb9c1dcddefe96fd0ba7c0bb0e46fdbcf1b
22069
22829
  """Type checking stubs"""
22070
22830
  pass
22071
22831
 
22832
+ def _typecheckingstub__2eb99af4044ffb625b707ac7ff5de3796f00ec1217ed24e21f6c240e90e846f0(
22833
+ *,
22834
+ destination: IBucket,
22835
+ access_control_transition: typing.Optional[builtins.bool] = None,
22836
+ delete_marker_replication: typing.Optional[builtins.bool] = None,
22837
+ filter: typing.Optional[typing.Union[Filter, typing.Dict[builtins.str, typing.Any]]] = None,
22838
+ id: typing.Optional[builtins.str] = None,
22839
+ kms_key: typing.Optional[_IKey_5f11635f] = None,
22840
+ metrics: typing.Optional[ReplicationTimeValue] = None,
22841
+ priority: typing.Optional[jsii.Number] = None,
22842
+ replica_modifications: typing.Optional[builtins.bool] = None,
22843
+ replication_time_control: typing.Optional[ReplicationTimeValue] = None,
22844
+ sse_kms_encrypted_objects: typing.Optional[builtins.bool] = None,
22845
+ storage_class: typing.Optional[StorageClass] = None,
22846
+ ) -> None:
22847
+ """Type checking stubs"""
22848
+ pass
22849
+
22072
22850
  def _typecheckingstub__a8752d303f1211901bb201082ccfac00227de7385764f326153a028696cc3c69(
22073
22851
  *,
22074
22852
  condition: typing.Optional[typing.Union[RoutingRuleCondition, typing.Dict[builtins.str, typing.Any]]] = None,
@@ -22165,6 +22943,14 @@ def _typecheckingstub__8f64f0928c3476db108d977ca1410bedef163a53d2b6d451e140ea634
22165
22943
  """Type checking stubs"""
22166
22944
  pass
22167
22945
 
22946
+ def _typecheckingstub__2baf8c6982c06606b5434f658a8175f6838f55345a6d423d335af89dfa1728cd(
22947
+ role_arn: builtins.str,
22948
+ access_control_transition: typing.Optional[builtins.bool] = None,
22949
+ account: typing.Optional[builtins.str] = None,
22950
+ ) -> None:
22951
+ """Type checking stubs"""
22952
+ pass
22953
+
22168
22954
  def _typecheckingstub__9fb30c6ad4f147f97466d3202c95d1247eaa1236b9e36d84d77037fde8af5fb9(
22169
22955
  permission: _PolicyStatement_0fe33853,
22170
22956
  ) -> None:
@@ -22330,6 +23116,12 @@ def _typecheckingstub__1d54fb5dd19da2dbb943d620662efadde1df29be901c2f95b3ae6d389
22330
23116
  """Type checking stubs"""
22331
23117
  pass
22332
23118
 
23119
+ def _typecheckingstub__0f4abefa77a469d6581b7fbd2e412d7d2f099dc365ac4138047e78313165885b(
23120
+ value: typing.Optional[builtins.str],
23121
+ ) -> None:
23122
+ """Type checking stubs"""
23123
+ pass
23124
+
22333
23125
  def _typecheckingstub__25f24cbf29544d9c579e765350a7b51ec4ec81bc2cc07a21660738a1e6bc81fe(
22334
23126
  scope: _constructs_77d1e7e8.Construct,
22335
23127
  id: builtins.str,
@@ -22356,6 +23148,7 @@ def _typecheckingstub__25f24cbf29544d9c579e765350a7b51ec4ec81bc2cc07a21660738a1e
22356
23148
  object_ownership: typing.Optional[ObjectOwnership] = None,
22357
23149
  public_read_access: typing.Optional[builtins.bool] = None,
22358
23150
  removal_policy: typing.Optional[_RemovalPolicy_9f93c814] = None,
23151
+ replication_rules: typing.Optional[typing.Sequence[typing.Union[ReplicationRule, typing.Dict[builtins.str, typing.Any]]]] = None,
22359
23152
  server_access_logs_bucket: typing.Optional[IBucket] = None,
22360
23153
  server_access_logs_prefix: typing.Optional[builtins.str] = None,
22361
23154
  target_object_key_format: typing.Optional[TargetObjectKeyFormat] = None,
@@ -22436,3 +23229,9 @@ def _typecheckingstub__afd8c4da1d866abcdc76879948bb11bd5a21a374e5ebf1e4445208dec
22436
23229
  ) -> None:
22437
23230
  """Type checking stubs"""
22438
23231
  pass
23232
+
23233
+ def _typecheckingstub__3cb691a849de33681a4f0021424f266609c2785cf8cbf5306c98726a6230a9e2(
23234
+ value: typing.Optional[builtins.str],
23235
+ ) -> None:
23236
+ """Type checking stubs"""
23237
+ pass