aws-cdk-lib 2.210.0__py3-none-any.whl → 2.212.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 (78) hide show
  1. aws_cdk/__init__.py +404 -54
  2. aws_cdk/_jsii/__init__.py +1 -1
  3. aws_cdk/_jsii/{aws-cdk-lib@2.210.0.jsii.tgz → aws-cdk-lib@2.212.0.jsii.tgz} +0 -0
  4. aws_cdk/aws_amazonmq/__init__.py +2 -1
  5. aws_cdk/aws_apigateway/__init__.py +2 -0
  6. aws_cdk/aws_apigatewayv2/__init__.py +1798 -74
  7. aws_cdk/aws_appconfig/__init__.py +9 -0
  8. aws_cdk/aws_appintegrations/__init__.py +395 -0
  9. aws_cdk/aws_arcregionswitch/__init__.py +5080 -0
  10. aws_cdk/aws_athena/__init__.py +23 -19
  11. aws_cdk/aws_autoscaling/__init__.py +6 -6
  12. aws_cdk/aws_batch/__init__.py +725 -55
  13. aws_cdk/aws_bedrock/__init__.py +18 -0
  14. aws_cdk/aws_billingconductor/__init__.py +3 -3
  15. aws_cdk/aws_cassandra/__init__.py +28 -1
  16. aws_cdk/aws_cloudfront/__init__.py +39 -8
  17. aws_cdk/aws_codebuild/__init__.py +122 -0
  18. aws_cdk/aws_codepipeline/__init__.py +51 -50
  19. aws_cdk/aws_cognito/__init__.py +9 -2
  20. aws_cdk/aws_connect/__init__.py +40 -15
  21. aws_cdk/aws_datazone/__init__.py +118 -77
  22. aws_cdk/aws_dax/__init__.py +39 -0
  23. aws_cdk/aws_deadline/__init__.py +166 -7
  24. aws_cdk/aws_docdb/__init__.py +20 -11
  25. aws_cdk/aws_dynamodb/__init__.py +246 -36
  26. aws_cdk/aws_ec2/__init__.py +1044 -111
  27. aws_cdk/aws_ecr/__init__.py +274 -0
  28. aws_cdk/aws_ecs/__init__.py +1637 -137
  29. aws_cdk/aws_eks/__init__.py +53 -3
  30. aws_cdk/aws_elasticloadbalancingv2/__init__.py +31 -17
  31. aws_cdk/aws_entityresolution/__init__.py +240 -45
  32. aws_cdk/aws_evs/__init__.py +20 -45
  33. aws_cdk/aws_gameliftstreams/__init__.py +7 -6
  34. aws_cdk/aws_glue/__init__.py +18 -9
  35. aws_cdk/aws_guardduty/__init__.py +1233 -113
  36. aws_cdk/aws_imagebuilder/__init__.py +34 -20
  37. aws_cdk/aws_inspectorv2/__init__.py +1516 -0
  38. aws_cdk/aws_iot/__init__.py +387 -0
  39. aws_cdk/aws_iotsitewise/__init__.py +1247 -139
  40. aws_cdk/aws_ivs/__init__.py +443 -33
  41. aws_cdk/aws_kinesisfirehose/__init__.py +2 -0
  42. aws_cdk/aws_lakeformation/__init__.py +1 -1
  43. aws_cdk/aws_lambda/__init__.py +9 -9
  44. aws_cdk/aws_lightsail/__init__.py +590 -0
  45. aws_cdk/aws_logs/__init__.py +97 -3
  46. aws_cdk/aws_medialive/__init__.py +270 -7
  47. aws_cdk/aws_mediapackagev2/__init__.py +204 -6
  48. aws_cdk/aws_neptune/__init__.py +41 -2
  49. aws_cdk/aws_networkfirewall/__init__.py +490 -134
  50. aws_cdk/aws_observabilityadmin/__init__.py +1468 -0
  51. aws_cdk/aws_omics/__init__.py +1 -1
  52. aws_cdk/aws_opensearchserverless/__init__.py +2 -2
  53. aws_cdk/aws_opensearchservice/__init__.py +128 -0
  54. aws_cdk/aws_opsworks/__init__.py +125 -125
  55. aws_cdk/aws_opsworkscm/__init__.py +1 -53
  56. aws_cdk/aws_pcs/__init__.py +49 -5
  57. aws_cdk/aws_qbusiness/__init__.py +3 -3
  58. aws_cdk/aws_quicksight/__init__.py +188 -83
  59. aws_cdk/aws_rds/__init__.py +245 -103
  60. aws_cdk/aws_s3/__init__.py +56 -1
  61. aws_cdk/aws_s3express/__init__.py +56 -1
  62. aws_cdk/aws_s3tables/__init__.py +2 -2
  63. aws_cdk/aws_sagemaker/__init__.py +4080 -223
  64. aws_cdk/aws_ses/__init__.py +172 -9
  65. aws_cdk/aws_sqs/__init__.py +4 -3
  66. aws_cdk/aws_ssm/__init__.py +8 -4
  67. aws_cdk/aws_stepfunctions_tasks/__init__.py +16 -9
  68. aws_cdk/aws_synthetics/__init__.py +116 -0
  69. aws_cdk/aws_verifiedpermissions/__init__.py +23 -2
  70. aws_cdk/aws_wisdom/__init__.py +2 -2
  71. aws_cdk/aws_workspacesweb/__init__.py +949 -157
  72. aws_cdk/cx_api/__init__.py +22 -0
  73. {aws_cdk_lib-2.210.0.dist-info → aws_cdk_lib-2.212.0.dist-info}/METADATA +335 -15
  74. {aws_cdk_lib-2.210.0.dist-info → aws_cdk_lib-2.212.0.dist-info}/RECORD +78 -76
  75. {aws_cdk_lib-2.210.0.dist-info → aws_cdk_lib-2.212.0.dist-info}/LICENSE +0 -0
  76. {aws_cdk_lib-2.210.0.dist-info → aws_cdk_lib-2.212.0.dist-info}/NOTICE +0 -0
  77. {aws_cdk_lib-2.210.0.dist-info → aws_cdk_lib-2.212.0.dist-info}/WHEEL +0 -0
  78. {aws_cdk_lib-2.210.0.dist-info → aws_cdk_lib-2.212.0.dist-info}/top_level.txt +0 -0
@@ -141,6 +141,68 @@ bar_stack = BarStack(app, "BarStack",
141
141
 
142
142
  Note: You can create an instance of the `TableV2` construct with as many `replicas` as needed as long as there is only one replica per region. After table creation you can add or remove `replicas`, but you can only add or remove a single replica in each update.
143
143
 
144
+ ## Multi-Region Strong Consistency (MRSC)
145
+
146
+ By default, DynamoDB global tables provide eventual consistency across regions. For applications requiring strong consistency across regions, you can configure Multi-Region Strong Consistency (MRSC) using the `multiRegionConsistency` property.
147
+
148
+ MRSC global tables can be configured in two ways:
149
+
150
+ * **Three replicas**: Deploy your table across three regions within the same region set
151
+ * **Two replicas + one witness**: Deploy your table across two regions with a witness region for consensus
152
+
153
+ ### Region Sets
154
+
155
+ MRSC global tables must be deployed within the same region set. The supported region sets are:
156
+
157
+ * **US Region set**: `us-east-1`, `us-east-2`, `us-west-2`
158
+ * **EU Region set**: `eu-west-1`, `eu-west-2`, `eu-west-3`, `eu-central-1`
159
+ * **AP Region set**: `ap-northeast-1`, `ap-northeast-2`, `ap-northeast-3`
160
+
161
+ ### Three Replicas Configuration
162
+
163
+ ```python
164
+ import aws_cdk as cdk
165
+
166
+
167
+ app = cdk.App()
168
+ stack = cdk.Stack(app, "Stack", env=cdk.Environment(region="us-west-2"))
169
+
170
+ mrsc_table = dynamodb.TableV2(stack, "MRSCTable",
171
+ partition_key=dynamodb.Attribute(name="pk", type=dynamodb.AttributeType.STRING),
172
+ multi_region_consistency=dynamodb.MultiRegionConsistency.STRONG,
173
+ replicas=[dynamodb.ReplicaTableProps(region="us-east-1"), dynamodb.ReplicaTableProps(region="us-east-2")
174
+ ]
175
+ )
176
+ ```
177
+
178
+ ### Two Replicas + Witness Configuration
179
+
180
+ ```python
181
+ import aws_cdk as cdk
182
+
183
+
184
+ app = cdk.App()
185
+ stack = cdk.Stack(app, "Stack", env=cdk.Environment(region="us-west-2"))
186
+
187
+ mrsc_table = dynamodb.TableV2(stack, "MRSCTable",
188
+ partition_key=dynamodb.Attribute(name="pk", type=dynamodb.AttributeType.STRING),
189
+ multi_region_consistency=dynamodb.MultiRegionConsistency.STRONG,
190
+ replicas=[dynamodb.ReplicaTableProps(region="us-east-1")
191
+ ],
192
+ witness_region="us-east-2"
193
+ )
194
+ ```
195
+
196
+ ### Important Considerations
197
+
198
+ * **Witness regions** can only be used with `MultiRegionConsistency.STRONG`. Attempting to specify a witness region with eventual consistency will result in a validation error.
199
+ * **Region validation**: All regions (primary, replicas, and witness) must be within the same region set.
200
+ * **Replica count**: When using a witness region, you must have exactly 2 replicas (including the primary). Without a witness region, you must have exactly 3 replicas.
201
+ * **Performance**: MRSC provides strong consistency but may have higher latency compared to eventual consistency.
202
+
203
+ Further reading:
204
+ https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/V2globaltables_HowItWorks.html#V2globaltables_HowItWorks.consistency-modes-mrsc
205
+
144
206
  ## Billing
145
207
 
146
208
  The `TableV2` construct can be configured with on-demand or provisioned billing:
@@ -1050,12 +1112,12 @@ class Attribute:
1050
1112
  app = cdk.App()
1051
1113
  stack = cdk.Stack(app, "Stack", env=cdk.Environment(region="us-west-2"))
1052
1114
 
1053
- global_table = dynamodb.TableV2(stack, "GlobalTable",
1115
+ mrsc_table = dynamodb.TableV2(stack, "MRSCTable",
1054
1116
  partition_key=dynamodb.Attribute(name="pk", type=dynamodb.AttributeType.STRING),
1055
- # applies to all replicas, i.e., us-west-2, us-east-1, us-east-2
1056
- removal_policy=cdk.RemovalPolicy.DESTROY,
1057
- replicas=[dynamodb.ReplicaTableProps(region="us-east-1"), dynamodb.ReplicaTableProps(region="us-east-2")
1058
- ]
1117
+ multi_region_consistency=dynamodb.MultiRegionConsistency.STRONG,
1118
+ replicas=[dynamodb.ReplicaTableProps(region="us-east-1")
1119
+ ],
1120
+ witness_region="us-east-2"
1059
1121
  )
1060
1122
  '''
1061
1123
  if __debug__:
@@ -1108,12 +1170,12 @@ class AttributeType(enum.Enum):
1108
1170
  app = cdk.App()
1109
1171
  stack = cdk.Stack(app, "Stack", env=cdk.Environment(region="us-west-2"))
1110
1172
 
1111
- global_table = dynamodb.TableV2(stack, "GlobalTable",
1173
+ mrsc_table = dynamodb.TableV2(stack, "MRSCTable",
1112
1174
  partition_key=dynamodb.Attribute(name="pk", type=dynamodb.AttributeType.STRING),
1113
- # applies to all replicas, i.e., us-west-2, us-east-1, us-east-2
1114
- removal_policy=cdk.RemovalPolicy.DESTROY,
1115
- replicas=[dynamodb.ReplicaTableProps(region="us-east-1"), dynamodb.ReplicaTableProps(region="us-east-2")
1116
- ]
1175
+ multi_region_consistency=dynamodb.MultiRegionConsistency.STRONG,
1176
+ replicas=[dynamodb.ReplicaTableProps(region="us-east-1")
1177
+ ],
1178
+ witness_region="us-east-2"
1117
1179
  )
1118
1180
  '''
1119
1181
 
@@ -1522,7 +1584,10 @@ class CfnGlobalTable(
1522
1584
 
1523
1585
  # the properties below are optional
1524
1586
  contributor_insights_specification=dynamodb.CfnGlobalTable.ContributorInsightsSpecificationProperty(
1525
- enabled=False
1587
+ enabled=False,
1588
+
1589
+ # the properties below are optional
1590
+ mode="mode"
1526
1591
  ),
1527
1592
  deletion_protection_enabled=False,
1528
1593
  global_secondary_indexes=[dynamodb.CfnGlobalTable.ReplicaGlobalSecondaryIndexSpecificationProperty(
@@ -1530,7 +1595,10 @@ class CfnGlobalTable(
1530
1595
 
1531
1596
  # the properties below are optional
1532
1597
  contributor_insights_specification=dynamodb.CfnGlobalTable.ContributorInsightsSpecificationProperty(
1533
- enabled=False
1598
+ enabled=False,
1599
+
1600
+ # the properties below are optional
1601
+ mode="mode"
1534
1602
  ),
1535
1603
  read_on_demand_throughput_settings=dynamodb.CfnGlobalTable.ReadOnDemandThroughputSettingsProperty(
1536
1604
  max_read_request_units=123
@@ -2296,17 +2364,19 @@ class CfnGlobalTable(
2296
2364
  @jsii.data_type(
2297
2365
  jsii_type="aws-cdk-lib.aws_dynamodb.CfnGlobalTable.ContributorInsightsSpecificationProperty",
2298
2366
  jsii_struct_bases=[],
2299
- name_mapping={"enabled": "enabled"},
2367
+ name_mapping={"enabled": "enabled", "mode": "mode"},
2300
2368
  )
2301
2369
  class ContributorInsightsSpecificationProperty:
2302
2370
  def __init__(
2303
2371
  self,
2304
2372
  *,
2305
2373
  enabled: typing.Union[builtins.bool, _IResolvable_da3f097b],
2374
+ mode: typing.Optional[builtins.str] = None,
2306
2375
  ) -> None:
2307
2376
  '''Configures contributor insights settings for a replica or one of its indexes.
2308
2377
 
2309
2378
  :param enabled: Indicates whether CloudWatch Contributor Insights are to be enabled (true) or disabled (false).
2379
+ :param mode:
2310
2380
 
2311
2381
  :see: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-dynamodb-globaltable-contributorinsightsspecification.html
2312
2382
  :exampleMetadata: fixture=_generated
@@ -2318,15 +2388,21 @@ class CfnGlobalTable(
2318
2388
  from aws_cdk import aws_dynamodb as dynamodb
2319
2389
 
2320
2390
  contributor_insights_specification_property = dynamodb.CfnGlobalTable.ContributorInsightsSpecificationProperty(
2321
- enabled=False
2391
+ enabled=False,
2392
+
2393
+ # the properties below are optional
2394
+ mode="mode"
2322
2395
  )
2323
2396
  '''
2324
2397
  if __debug__:
2325
2398
  type_hints = typing.get_type_hints(_typecheckingstub__0c4c1ec1851b3df040f636031283503da693894fbb627b438be175be8c1d8995)
2326
2399
  check_type(argname="argument enabled", value=enabled, expected_type=type_hints["enabled"])
2400
+ check_type(argname="argument mode", value=mode, expected_type=type_hints["mode"])
2327
2401
  self._values: typing.Dict[builtins.str, typing.Any] = {
2328
2402
  "enabled": enabled,
2329
2403
  }
2404
+ if mode is not None:
2405
+ self._values["mode"] = mode
2330
2406
 
2331
2407
  @builtins.property
2332
2408
  def enabled(self) -> typing.Union[builtins.bool, _IResolvable_da3f097b]:
@@ -2338,6 +2414,14 @@ class CfnGlobalTable(
2338
2414
  assert result is not None, "Required property 'enabled' is missing"
2339
2415
  return typing.cast(typing.Union[builtins.bool, _IResolvable_da3f097b], result)
2340
2416
 
2417
+ @builtins.property
2418
+ def mode(self) -> typing.Optional[builtins.str]:
2419
+ '''
2420
+ :see: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-dynamodb-globaltable-contributorinsightsspecification.html#cfn-dynamodb-globaltable-contributorinsightsspecification-mode
2421
+ '''
2422
+ result = self._values.get("mode")
2423
+ return typing.cast(typing.Optional[builtins.str], result)
2424
+
2341
2425
  def __eq__(self, rhs: typing.Any) -> builtins.bool:
2342
2426
  return isinstance(rhs, self.__class__) and rhs._values == self._values
2343
2427
 
@@ -3225,7 +3309,10 @@ class CfnGlobalTable(
3225
3309
 
3226
3310
  # the properties below are optional
3227
3311
  contributor_insights_specification=dynamodb.CfnGlobalTable.ContributorInsightsSpecificationProperty(
3228
- enabled=False
3312
+ enabled=False,
3313
+
3314
+ # the properties below are optional
3315
+ mode="mode"
3229
3316
  ),
3230
3317
  read_on_demand_throughput_settings=dynamodb.CfnGlobalTable.ReadOnDemandThroughputSettingsProperty(
3231
3318
  max_read_request_units=123
@@ -3451,7 +3538,10 @@ class CfnGlobalTable(
3451
3538
 
3452
3539
  # the properties below are optional
3453
3540
  contributor_insights_specification=dynamodb.CfnGlobalTable.ContributorInsightsSpecificationProperty(
3454
- enabled=False
3541
+ enabled=False,
3542
+
3543
+ # the properties below are optional
3544
+ mode="mode"
3455
3545
  ),
3456
3546
  deletion_protection_enabled=False,
3457
3547
  global_secondary_indexes=[dynamodb.CfnGlobalTable.ReplicaGlobalSecondaryIndexSpecificationProperty(
@@ -3459,7 +3549,10 @@ class CfnGlobalTable(
3459
3549
 
3460
3550
  # the properties below are optional
3461
3551
  contributor_insights_specification=dynamodb.CfnGlobalTable.ContributorInsightsSpecificationProperty(
3462
- enabled=False
3552
+ enabled=False,
3553
+
3554
+ # the properties below are optional
3555
+ mode="mode"
3463
3556
  ),
3464
3557
  read_on_demand_throughput_settings=dynamodb.CfnGlobalTable.ReadOnDemandThroughputSettingsProperty(
3465
3558
  max_read_request_units=123
@@ -4502,7 +4595,10 @@ class CfnGlobalTableProps:
4502
4595
 
4503
4596
  # the properties below are optional
4504
4597
  contributor_insights_specification=dynamodb.CfnGlobalTable.ContributorInsightsSpecificationProperty(
4505
- enabled=False
4598
+ enabled=False,
4599
+
4600
+ # the properties below are optional
4601
+ mode="mode"
4506
4602
  ),
4507
4603
  deletion_protection_enabled=False,
4508
4604
  global_secondary_indexes=[dynamodb.CfnGlobalTable.ReplicaGlobalSecondaryIndexSpecificationProperty(
@@ -4510,7 +4606,10 @@ class CfnGlobalTableProps:
4510
4606
 
4511
4607
  # the properties below are optional
4512
4608
  contributor_insights_specification=dynamodb.CfnGlobalTable.ContributorInsightsSpecificationProperty(
4513
- enabled=False
4609
+ enabled=False,
4610
+
4611
+ # the properties below are optional
4612
+ mode="mode"
4514
4613
  ),
4515
4614
  read_on_demand_throughput_settings=dynamodb.CfnGlobalTable.ReadOnDemandThroughputSettingsProperty(
4516
4615
  max_read_request_units=123
@@ -4989,7 +5088,10 @@ class CfnTable(
4989
5088
  )],
4990
5089
  billing_mode="billingMode",
4991
5090
  contributor_insights_specification=dynamodb.CfnTable.ContributorInsightsSpecificationProperty(
4992
- enabled=False
5091
+ enabled=False,
5092
+
5093
+ # the properties below are optional
5094
+ mode="mode"
4993
5095
  ),
4994
5096
  deletion_protection_enabled=False,
4995
5097
  global_secondary_indexes=[dynamodb.CfnTable.GlobalSecondaryIndexProperty(
@@ -5005,7 +5107,10 @@ class CfnTable(
5005
5107
 
5006
5108
  # the properties below are optional
5007
5109
  contributor_insights_specification=dynamodb.CfnTable.ContributorInsightsSpecificationProperty(
5008
- enabled=False
5110
+ enabled=False,
5111
+
5112
+ # the properties below are optional
5113
+ mode="mode"
5009
5114
  ),
5010
5115
  on_demand_throughput=dynamodb.CfnTable.OnDemandThroughputProperty(
5011
5116
  max_read_request_units=123,
@@ -5671,17 +5776,19 @@ class CfnTable(
5671
5776
  @jsii.data_type(
5672
5777
  jsii_type="aws-cdk-lib.aws_dynamodb.CfnTable.ContributorInsightsSpecificationProperty",
5673
5778
  jsii_struct_bases=[],
5674
- name_mapping={"enabled": "enabled"},
5779
+ name_mapping={"enabled": "enabled", "mode": "mode"},
5675
5780
  )
5676
5781
  class ContributorInsightsSpecificationProperty:
5677
5782
  def __init__(
5678
5783
  self,
5679
5784
  *,
5680
5785
  enabled: typing.Union[builtins.bool, _IResolvable_da3f097b],
5786
+ mode: typing.Optional[builtins.str] = None,
5681
5787
  ) -> None:
5682
5788
  '''The settings used to enable or disable CloudWatch Contributor Insights.
5683
5789
 
5684
5790
  :param enabled: Indicates whether CloudWatch Contributor Insights are to be enabled (true) or disabled (false).
5791
+ :param mode:
5685
5792
 
5686
5793
  :see: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-dynamodb-table-contributorinsightsspecification.html
5687
5794
  :exampleMetadata: fixture=_generated
@@ -5693,15 +5800,21 @@ class CfnTable(
5693
5800
  from aws_cdk import aws_dynamodb as dynamodb
5694
5801
 
5695
5802
  contributor_insights_specification_property = dynamodb.CfnTable.ContributorInsightsSpecificationProperty(
5696
- enabled=False
5803
+ enabled=False,
5804
+
5805
+ # the properties below are optional
5806
+ mode="mode"
5697
5807
  )
5698
5808
  '''
5699
5809
  if __debug__:
5700
5810
  type_hints = typing.get_type_hints(_typecheckingstub__0a8b688e9e547ebf94c63195c5144ea544272eec7f4f0112bdff07a522156c82)
5701
5811
  check_type(argname="argument enabled", value=enabled, expected_type=type_hints["enabled"])
5812
+ check_type(argname="argument mode", value=mode, expected_type=type_hints["mode"])
5702
5813
  self._values: typing.Dict[builtins.str, typing.Any] = {
5703
5814
  "enabled": enabled,
5704
5815
  }
5816
+ if mode is not None:
5817
+ self._values["mode"] = mode
5705
5818
 
5706
5819
  @builtins.property
5707
5820
  def enabled(self) -> typing.Union[builtins.bool, _IResolvable_da3f097b]:
@@ -5713,6 +5826,14 @@ class CfnTable(
5713
5826
  assert result is not None, "Required property 'enabled' is missing"
5714
5827
  return typing.cast(typing.Union[builtins.bool, _IResolvable_da3f097b], result)
5715
5828
 
5829
+ @builtins.property
5830
+ def mode(self) -> typing.Optional[builtins.str]:
5831
+ '''
5832
+ :see: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-dynamodb-table-contributorinsightsspecification.html#cfn-dynamodb-table-contributorinsightsspecification-mode
5833
+ '''
5834
+ result = self._values.get("mode")
5835
+ return typing.cast(typing.Optional[builtins.str], result)
5836
+
5716
5837
  def __eq__(self, rhs: typing.Any) -> builtins.bool:
5717
5838
  return isinstance(rhs, self.__class__) and rhs._values == self._values
5718
5839
 
@@ -5855,7 +5976,10 @@ class CfnTable(
5855
5976
 
5856
5977
  # the properties below are optional
5857
5978
  contributor_insights_specification=dynamodb.CfnTable.ContributorInsightsSpecificationProperty(
5858
- enabled=False
5979
+ enabled=False,
5980
+
5981
+ # the properties below are optional
5982
+ mode="mode"
5859
5983
  ),
5860
5984
  on_demand_throughput=dynamodb.CfnTable.OnDemandThroughputProperty(
5861
5985
  max_read_request_units=123,
@@ -7398,7 +7522,10 @@ class CfnTableProps:
7398
7522
  )],
7399
7523
  billing_mode="billingMode",
7400
7524
  contributor_insights_specification=dynamodb.CfnTable.ContributorInsightsSpecificationProperty(
7401
- enabled=False
7525
+ enabled=False,
7526
+
7527
+ # the properties below are optional
7528
+ mode="mode"
7402
7529
  ),
7403
7530
  deletion_protection_enabled=False,
7404
7531
  global_secondary_indexes=[dynamodb.CfnTable.GlobalSecondaryIndexProperty(
@@ -7414,7 +7541,10 @@ class CfnTableProps:
7414
7541
 
7415
7542
  # the properties below are optional
7416
7543
  contributor_insights_specification=dynamodb.CfnTable.ContributorInsightsSpecificationProperty(
7417
- enabled=False
7544
+ enabled=False,
7545
+
7546
+ # the properties below are optional
7547
+ mode="mode"
7418
7548
  ),
7419
7549
  on_demand_throughput=dynamodb.CfnTable.OnDemandThroughputProperty(
7420
7550
  max_read_request_units=123,
@@ -9578,6 +9708,38 @@ class MaxThroughputProps:
9578
9708
  )
9579
9709
 
9580
9710
 
9711
+ @jsii.enum(jsii_type="aws-cdk-lib.aws_dynamodb.MultiRegionConsistency")
9712
+ class MultiRegionConsistency(enum.Enum):
9713
+ '''Global table multi-region consistency mode.
9714
+
9715
+ :see: https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/V2globaltables_HowItWorks.html#V2globaltables_HowItWorks.consistency-modes-mrsc
9716
+ :exampleMetadata: infused
9717
+
9718
+ Example::
9719
+
9720
+ import aws_cdk as cdk
9721
+
9722
+
9723
+ app = cdk.App()
9724
+ stack = cdk.Stack(app, "Stack", env=cdk.Environment(region="us-west-2"))
9725
+
9726
+ mrsc_table = dynamodb.TableV2(stack, "MRSCTable",
9727
+ partition_key=dynamodb.Attribute(name="pk", type=dynamodb.AttributeType.STRING),
9728
+ multi_region_consistency=dynamodb.MultiRegionConsistency.STRONG,
9729
+ replicas=[dynamodb.ReplicaTableProps(region="us-east-1"), dynamodb.ReplicaTableProps(region="us-east-2")
9730
+ ]
9731
+ )
9732
+ '''
9733
+
9734
+ EVENTUAL = "EVENTUAL"
9735
+ '''Default consistency mode for Global Tables.
9736
+
9737
+ Multi-region eventual consistency.
9738
+ '''
9739
+ STRONG = "STRONG"
9740
+ '''Multi-region strong consistency.'''
9741
+
9742
+
9581
9743
  @jsii.enum(jsii_type="aws-cdk-lib.aws_dynamodb.Operation")
9582
9744
  class Operation(enum.Enum):
9583
9745
  '''Supported DynamoDB table operations.'''
@@ -13950,12 +14112,14 @@ class TableProps(TableOptions):
13950
14112
  "encryption": "encryption",
13951
14113
  "global_secondary_indexes": "globalSecondaryIndexes",
13952
14114
  "local_secondary_indexes": "localSecondaryIndexes",
14115
+ "multi_region_consistency": "multiRegionConsistency",
13953
14116
  "removal_policy": "removalPolicy",
13954
14117
  "replicas": "replicas",
13955
14118
  "sort_key": "sortKey",
13956
14119
  "table_name": "tableName",
13957
14120
  "time_to_live_attribute": "timeToLiveAttribute",
13958
14121
  "warm_throughput": "warmThroughput",
14122
+ "witness_region": "witnessRegion",
13959
14123
  },
13960
14124
  )
13961
14125
  class TablePropsV2(TableOptionsV2):
@@ -13976,12 +14140,14 @@ class TablePropsV2(TableOptionsV2):
13976
14140
  encryption: typing.Optional[TableEncryptionV2] = None,
13977
14141
  global_secondary_indexes: typing.Optional[typing.Sequence[typing.Union["GlobalSecondaryIndexPropsV2", typing.Dict[builtins.str, typing.Any]]]] = None,
13978
14142
  local_secondary_indexes: typing.Optional[typing.Sequence[typing.Union["LocalSecondaryIndexProps", typing.Dict[builtins.str, typing.Any]]]] = None,
14143
+ multi_region_consistency: typing.Optional[MultiRegionConsistency] = None,
13979
14144
  removal_policy: typing.Optional[_RemovalPolicy_9f93c814] = None,
13980
14145
  replicas: typing.Optional[typing.Sequence[typing.Union["ReplicaTableProps", typing.Dict[builtins.str, typing.Any]]]] = None,
13981
14146
  sort_key: typing.Optional[typing.Union[Attribute, typing.Dict[builtins.str, typing.Any]]] = None,
13982
14147
  table_name: typing.Optional[builtins.str] = None,
13983
14148
  time_to_live_attribute: typing.Optional[builtins.str] = None,
13984
14149
  warm_throughput: typing.Optional[typing.Union["WarmThroughput", typing.Dict[builtins.str, typing.Any]]] = None,
14150
+ witness_region: typing.Optional[builtins.str] = None,
13985
14151
  ) -> None:
13986
14152
  '''Properties used to configure a DynamoDB table.
13987
14153
 
@@ -13999,12 +14165,14 @@ class TablePropsV2(TableOptionsV2):
13999
14165
  :param encryption: The server-side encryption. Default: TableEncryptionV2.dynamoOwnedKey()
14000
14166
  :param global_secondary_indexes: Global secondary indexes. Note: You can provide a maximum of 20 global secondary indexes. Default: - no global secondary indexes
14001
14167
  :param local_secondary_indexes: Local secondary indexes. Note: You can only provide a maximum of 5 local secondary indexes. Default: - no local secondary indexes
14168
+ :param multi_region_consistency: Specifies the consistency mode for a new global table. Default: MultiRegionConsistency.EVENTUAL
14002
14169
  :param removal_policy: The removal policy applied to the table. Default: RemovalPolicy.RETAIN
14003
14170
  :param replicas: Replica tables to deploy with the primary table. Note: Adding replica tables allows you to use your table as a global table. You cannot specify a replica table in the region that the primary table will be deployed to. Replica tables will only be supported if the stack deployment region is defined. Default: - no replica tables
14004
14171
  :param sort_key: Sort key attribute definition. Default: - no sort key
14005
14172
  :param table_name: The name of the table. Default: - generated by CloudFormation
14006
14173
  :param time_to_live_attribute: The name of the TTL attribute. Default: - TTL is disabled
14007
14174
  :param warm_throughput: The warm throughput configuration for the table. Default: - no warm throughput is configured
14175
+ :param witness_region: The witness Region for the MRSC global table. A MRSC global table can be configured with either three replicas, or with two replicas and one witness. Note: Witness region cannot be specified for a Multi-Region Eventual Consistency (MREC) Global Table. Witness regions are only supported for Multi-Region Strong Consistency (MRSC) Global Tables. Default: - no witness region
14008
14176
 
14009
14177
  :exampleMetadata: infused
14010
14178
 
@@ -14016,12 +14184,12 @@ class TablePropsV2(TableOptionsV2):
14016
14184
  app = cdk.App()
14017
14185
  stack = cdk.Stack(app, "Stack", env=cdk.Environment(region="us-west-2"))
14018
14186
 
14019
- global_table = dynamodb.TableV2(stack, "GlobalTable",
14187
+ mrsc_table = dynamodb.TableV2(stack, "MRSCTable",
14020
14188
  partition_key=dynamodb.Attribute(name="pk", type=dynamodb.AttributeType.STRING),
14021
- # applies to all replicas, i.e., us-west-2, us-east-1, us-east-2
14022
- removal_policy=cdk.RemovalPolicy.DESTROY,
14023
- replicas=[dynamodb.ReplicaTableProps(region="us-east-1"), dynamodb.ReplicaTableProps(region="us-east-2")
14024
- ]
14189
+ multi_region_consistency=dynamodb.MultiRegionConsistency.STRONG,
14190
+ replicas=[dynamodb.ReplicaTableProps(region="us-east-1")
14191
+ ],
14192
+ witness_region="us-east-2"
14025
14193
  )
14026
14194
  '''
14027
14195
  if isinstance(point_in_time_recovery_specification, dict):
@@ -14048,12 +14216,14 @@ class TablePropsV2(TableOptionsV2):
14048
14216
  check_type(argname="argument encryption", value=encryption, expected_type=type_hints["encryption"])
14049
14217
  check_type(argname="argument global_secondary_indexes", value=global_secondary_indexes, expected_type=type_hints["global_secondary_indexes"])
14050
14218
  check_type(argname="argument local_secondary_indexes", value=local_secondary_indexes, expected_type=type_hints["local_secondary_indexes"])
14219
+ check_type(argname="argument multi_region_consistency", value=multi_region_consistency, expected_type=type_hints["multi_region_consistency"])
14051
14220
  check_type(argname="argument removal_policy", value=removal_policy, expected_type=type_hints["removal_policy"])
14052
14221
  check_type(argname="argument replicas", value=replicas, expected_type=type_hints["replicas"])
14053
14222
  check_type(argname="argument sort_key", value=sort_key, expected_type=type_hints["sort_key"])
14054
14223
  check_type(argname="argument table_name", value=table_name, expected_type=type_hints["table_name"])
14055
14224
  check_type(argname="argument time_to_live_attribute", value=time_to_live_attribute, expected_type=type_hints["time_to_live_attribute"])
14056
14225
  check_type(argname="argument warm_throughput", value=warm_throughput, expected_type=type_hints["warm_throughput"])
14226
+ check_type(argname="argument witness_region", value=witness_region, expected_type=type_hints["witness_region"])
14057
14227
  self._values: typing.Dict[builtins.str, typing.Any] = {
14058
14228
  "partition_key": partition_key,
14059
14229
  }
@@ -14083,6 +14253,8 @@ class TablePropsV2(TableOptionsV2):
14083
14253
  self._values["global_secondary_indexes"] = global_secondary_indexes
14084
14254
  if local_secondary_indexes is not None:
14085
14255
  self._values["local_secondary_indexes"] = local_secondary_indexes
14256
+ if multi_region_consistency is not None:
14257
+ self._values["multi_region_consistency"] = multi_region_consistency
14086
14258
  if removal_policy is not None:
14087
14259
  self._values["removal_policy"] = removal_policy
14088
14260
  if replicas is not None:
@@ -14095,6 +14267,8 @@ class TablePropsV2(TableOptionsV2):
14095
14267
  self._values["time_to_live_attribute"] = time_to_live_attribute
14096
14268
  if warm_throughput is not None:
14097
14269
  self._values["warm_throughput"] = warm_throughput
14270
+ if witness_region is not None:
14271
+ self._values["witness_region"] = witness_region
14098
14272
 
14099
14273
  @builtins.property
14100
14274
  def contributor_insights(self) -> typing.Optional[builtins.bool]:
@@ -14240,6 +14414,15 @@ class TablePropsV2(TableOptionsV2):
14240
14414
  result = self._values.get("local_secondary_indexes")
14241
14415
  return typing.cast(typing.Optional[typing.List["LocalSecondaryIndexProps"]], result)
14242
14416
 
14417
+ @builtins.property
14418
+ def multi_region_consistency(self) -> typing.Optional[MultiRegionConsistency]:
14419
+ '''Specifies the consistency mode for a new global table.
14420
+
14421
+ :default: MultiRegionConsistency.EVENTUAL
14422
+ '''
14423
+ result = self._values.get("multi_region_consistency")
14424
+ return typing.cast(typing.Optional[MultiRegionConsistency], result)
14425
+
14243
14426
  @builtins.property
14244
14427
  def removal_policy(self) -> typing.Optional[_RemovalPolicy_9f93c814]:
14245
14428
  '''The removal policy applied to the table.
@@ -14298,6 +14481,20 @@ class TablePropsV2(TableOptionsV2):
14298
14481
  result = self._values.get("warm_throughput")
14299
14482
  return typing.cast(typing.Optional["WarmThroughput"], result)
14300
14483
 
14484
+ @builtins.property
14485
+ def witness_region(self) -> typing.Optional[builtins.str]:
14486
+ '''The witness Region for the MRSC global table.
14487
+
14488
+ A MRSC global table can be configured with either three replicas, or with two replicas and one witness.
14489
+
14490
+ Note: Witness region cannot be specified for a Multi-Region Eventual Consistency (MREC) Global Table.
14491
+ Witness regions are only supported for Multi-Region Strong Consistency (MRSC) Global Tables.
14492
+
14493
+ :default: - no witness region
14494
+ '''
14495
+ result = self._values.get("witness_region")
14496
+ return typing.cast(typing.Optional[builtins.str], result)
14497
+
14301
14498
  def __eq__(self, rhs: typing.Any) -> builtins.bool:
14302
14499
  return isinstance(rhs, self.__class__) and rhs._values == self._values
14303
14500
 
@@ -14327,12 +14524,12 @@ class TableV2(
14327
14524
  app = cdk.App()
14328
14525
  stack = cdk.Stack(app, "Stack", env=cdk.Environment(region="us-west-2"))
14329
14526
 
14330
- global_table = dynamodb.TableV2(stack, "GlobalTable",
14527
+ mrsc_table = dynamodb.TableV2(stack, "MRSCTable",
14331
14528
  partition_key=dynamodb.Attribute(name="pk", type=dynamodb.AttributeType.STRING),
14332
- # applies to all replicas, i.e., us-west-2, us-east-1, us-east-2
14333
- removal_policy=cdk.RemovalPolicy.DESTROY,
14334
- replicas=[dynamodb.ReplicaTableProps(region="us-east-1"), dynamodb.ReplicaTableProps(region="us-east-2")
14335
- ]
14529
+ multi_region_consistency=dynamodb.MultiRegionConsistency.STRONG,
14530
+ replicas=[dynamodb.ReplicaTableProps(region="us-east-1")
14531
+ ],
14532
+ witness_region="us-east-2"
14336
14533
  )
14337
14534
  '''
14338
14535
 
@@ -14347,12 +14544,14 @@ class TableV2(
14347
14544
  encryption: typing.Optional[TableEncryptionV2] = None,
14348
14545
  global_secondary_indexes: typing.Optional[typing.Sequence[typing.Union["GlobalSecondaryIndexPropsV2", typing.Dict[builtins.str, typing.Any]]]] = None,
14349
14546
  local_secondary_indexes: typing.Optional[typing.Sequence[typing.Union["LocalSecondaryIndexProps", typing.Dict[builtins.str, typing.Any]]]] = None,
14547
+ multi_region_consistency: typing.Optional[MultiRegionConsistency] = None,
14350
14548
  removal_policy: typing.Optional[_RemovalPolicy_9f93c814] = None,
14351
14549
  replicas: typing.Optional[typing.Sequence[typing.Union["ReplicaTableProps", typing.Dict[builtins.str, typing.Any]]]] = None,
14352
14550
  sort_key: typing.Optional[typing.Union[Attribute, typing.Dict[builtins.str, typing.Any]]] = None,
14353
14551
  table_name: typing.Optional[builtins.str] = None,
14354
14552
  time_to_live_attribute: typing.Optional[builtins.str] = None,
14355
14553
  warm_throughput: typing.Optional[typing.Union["WarmThroughput", typing.Dict[builtins.str, typing.Any]]] = None,
14554
+ witness_region: typing.Optional[builtins.str] = None,
14356
14555
  contributor_insights: typing.Optional[builtins.bool] = None,
14357
14556
  deletion_protection: typing.Optional[builtins.bool] = None,
14358
14557
  kinesis_stream: typing.Optional[_IStream_4e2457d2] = None,
@@ -14371,12 +14570,14 @@ class TableV2(
14371
14570
  :param encryption: The server-side encryption. Default: TableEncryptionV2.dynamoOwnedKey()
14372
14571
  :param global_secondary_indexes: Global secondary indexes. Note: You can provide a maximum of 20 global secondary indexes. Default: - no global secondary indexes
14373
14572
  :param local_secondary_indexes: Local secondary indexes. Note: You can only provide a maximum of 5 local secondary indexes. Default: - no local secondary indexes
14573
+ :param multi_region_consistency: Specifies the consistency mode for a new global table. Default: MultiRegionConsistency.EVENTUAL
14374
14574
  :param removal_policy: The removal policy applied to the table. Default: RemovalPolicy.RETAIN
14375
14575
  :param replicas: Replica tables to deploy with the primary table. Note: Adding replica tables allows you to use your table as a global table. You cannot specify a replica table in the region that the primary table will be deployed to. Replica tables will only be supported if the stack deployment region is defined. Default: - no replica tables
14376
14576
  :param sort_key: Sort key attribute definition. Default: - no sort key
14377
14577
  :param table_name: The name of the table. Default: - generated by CloudFormation
14378
14578
  :param time_to_live_attribute: The name of the TTL attribute. Default: - TTL is disabled
14379
14579
  :param warm_throughput: The warm throughput configuration for the table. Default: - no warm throughput is configured
14580
+ :param witness_region: The witness Region for the MRSC global table. A MRSC global table can be configured with either three replicas, or with two replicas and one witness. Note: Witness region cannot be specified for a Multi-Region Eventual Consistency (MREC) Global Table. Witness regions are only supported for Multi-Region Strong Consistency (MRSC) Global Tables. Default: - no witness region
14380
14581
  :param contributor_insights: Whether CloudWatch contributor insights is enabled. Default: false
14381
14582
  :param deletion_protection: Whether deletion protection is enabled. Default: false
14382
14583
  :param kinesis_stream: Kinesis Data Stream to capture item level changes. Default: - no Kinesis Data Stream
@@ -14397,12 +14598,14 @@ class TableV2(
14397
14598
  encryption=encryption,
14398
14599
  global_secondary_indexes=global_secondary_indexes,
14399
14600
  local_secondary_indexes=local_secondary_indexes,
14601
+ multi_region_consistency=multi_region_consistency,
14400
14602
  removal_policy=removal_policy,
14401
14603
  replicas=replicas,
14402
14604
  sort_key=sort_key,
14403
14605
  table_name=table_name,
14404
14606
  time_to_live_attribute=time_to_live_attribute,
14405
14607
  warm_throughput=warm_throughput,
14608
+ witness_region=witness_region,
14406
14609
  contributor_insights=contributor_insights,
14407
14610
  deletion_protection=deletion_protection,
14408
14611
  kinesis_stream=kinesis_stream,
@@ -16553,6 +16756,7 @@ __all__ = [
16553
16756
  "InputFormat",
16554
16757
  "LocalSecondaryIndexProps",
16555
16758
  "MaxThroughputProps",
16759
+ "MultiRegionConsistency",
16556
16760
  "Operation",
16557
16761
  "OperationsMetricOptions",
16558
16762
  "PointInTimeRecoverySpecification",
@@ -16753,6 +16957,7 @@ def _typecheckingstub__51587895f2d228591cb8c1b278064c8ca442192e93e2e20c22de9e04b
16753
16957
  def _typecheckingstub__0c4c1ec1851b3df040f636031283503da693894fbb627b438be175be8c1d8995(
16754
16958
  *,
16755
16959
  enabled: typing.Union[builtins.bool, _IResolvable_da3f097b],
16960
+ mode: typing.Optional[builtins.str] = None,
16756
16961
  ) -> None:
16757
16962
  """Type checking stubs"""
16758
16963
  pass
@@ -17129,6 +17334,7 @@ def _typecheckingstub__09c7a32c39444fb07dbb26b4ad1f9b87ad574421e0b12ac175c090173
17129
17334
  def _typecheckingstub__0a8b688e9e547ebf94c63195c5144ea544272eec7f4f0112bdff07a522156c82(
17130
17335
  *,
17131
17336
  enabled: typing.Union[builtins.bool, _IResolvable_da3f097b],
17337
+ mode: typing.Optional[builtins.str] = None,
17132
17338
  ) -> None:
17133
17339
  """Type checking stubs"""
17134
17340
  pass
@@ -17825,12 +18031,14 @@ def _typecheckingstub__205e5df85e01c6c2d91d5922a57e3ed5903027748a8b3222622bebd10
17825
18031
  encryption: typing.Optional[TableEncryptionV2] = None,
17826
18032
  global_secondary_indexes: typing.Optional[typing.Sequence[typing.Union[GlobalSecondaryIndexPropsV2, typing.Dict[builtins.str, typing.Any]]]] = None,
17827
18033
  local_secondary_indexes: typing.Optional[typing.Sequence[typing.Union[LocalSecondaryIndexProps, typing.Dict[builtins.str, typing.Any]]]] = None,
18034
+ multi_region_consistency: typing.Optional[MultiRegionConsistency] = None,
17828
18035
  removal_policy: typing.Optional[_RemovalPolicy_9f93c814] = None,
17829
18036
  replicas: typing.Optional[typing.Sequence[typing.Union[ReplicaTableProps, typing.Dict[builtins.str, typing.Any]]]] = None,
17830
18037
  sort_key: typing.Optional[typing.Union[Attribute, typing.Dict[builtins.str, typing.Any]]] = None,
17831
18038
  table_name: typing.Optional[builtins.str] = None,
17832
18039
  time_to_live_attribute: typing.Optional[builtins.str] = None,
17833
18040
  warm_throughput: typing.Optional[typing.Union[WarmThroughput, typing.Dict[builtins.str, typing.Any]]] = None,
18041
+ witness_region: typing.Optional[builtins.str] = None,
17834
18042
  ) -> None:
17835
18043
  """Type checking stubs"""
17836
18044
  pass
@@ -17845,12 +18053,14 @@ def _typecheckingstub__9ea47b003cdb497ff620f1410260696f97dbb2b00fa8558235f23771f
17845
18053
  encryption: typing.Optional[TableEncryptionV2] = None,
17846
18054
  global_secondary_indexes: typing.Optional[typing.Sequence[typing.Union[GlobalSecondaryIndexPropsV2, typing.Dict[builtins.str, typing.Any]]]] = None,
17847
18055
  local_secondary_indexes: typing.Optional[typing.Sequence[typing.Union[LocalSecondaryIndexProps, typing.Dict[builtins.str, typing.Any]]]] = None,
18056
+ multi_region_consistency: typing.Optional[MultiRegionConsistency] = None,
17848
18057
  removal_policy: typing.Optional[_RemovalPolicy_9f93c814] = None,
17849
18058
  replicas: typing.Optional[typing.Sequence[typing.Union[ReplicaTableProps, typing.Dict[builtins.str, typing.Any]]]] = None,
17850
18059
  sort_key: typing.Optional[typing.Union[Attribute, typing.Dict[builtins.str, typing.Any]]] = None,
17851
18060
  table_name: typing.Optional[builtins.str] = None,
17852
18061
  time_to_live_attribute: typing.Optional[builtins.str] = None,
17853
18062
  warm_throughput: typing.Optional[typing.Union[WarmThroughput, typing.Dict[builtins.str, typing.Any]]] = None,
18063
+ witness_region: typing.Optional[builtins.str] = None,
17854
18064
  contributor_insights: typing.Optional[builtins.bool] = None,
17855
18065
  deletion_protection: typing.Optional[builtins.bool] = None,
17856
18066
  kinesis_stream: typing.Optional[_IStream_4e2457d2] = None,