aws-cdk-lib 2.212.0__py3-none-any.whl → 2.213.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.

aws_cdk/_jsii/__init__.py CHANGED
@@ -34,7 +34,7 @@ import aws_cdk.cloud_assembly_schema._jsii
34
34
  import constructs._jsii
35
35
 
36
36
  __jsii_assembly__ = jsii.JSIIAssembly.load(
37
- "aws-cdk-lib", "2.212.0", __name__[0:-6], "aws-cdk-lib@2.212.0.jsii.tgz"
37
+ "aws-cdk-lib", "2.213.0", __name__[0:-6], "aws-cdk-lib@2.213.0.jsii.tgz"
38
38
  )
39
39
 
40
40
  __all__ = [
@@ -18,7 +18,9 @@ By default, `TableV2` will create a single table in the main deployment region r
18
18
  ```python
19
19
  table = dynamodb.TableV2(self, "Table",
20
20
  partition_key=dynamodb.Attribute(name="pk", type=dynamodb.AttributeType.STRING),
21
- contributor_insights=True,
21
+ contributor_insights_specification=dynamodb.ContributorInsightsSpecification(
22
+ enabled=True
23
+ ),
22
24
  table_class=dynamodb.TableClass.STANDARD_INFREQUENT_ACCESS,
23
25
  point_in_time_recovery_specification=dynamodb.PointInTimeRecoverySpecification(
24
26
  point_in_time_recovery_enabled=True
@@ -68,12 +70,12 @@ global_table.add_replica(region="us-east-2", deletion_protection=True)
68
70
 
69
71
  The following properties are configurable on a per-replica basis, but will be inherited from the `TableV2` properties if not specified:
70
72
 
71
- * contributorInsights
73
+ * contributorInsightsSpecification
72
74
  * deletionProtection
73
75
  * pointInTimeRecoverySpecification
74
76
  * tableClass
75
77
  * readCapacity (only configurable if the `TableV2` billing mode is `PROVISIONED`)
76
- * globalSecondaryIndexes (only `contributorInsights` and `readCapacity`)
78
+ * globalSecondaryIndexes (only `contributorInsightsSpecification` and `readCapacity`)
77
79
 
78
80
  The following example shows how to define properties on a per-replica basis:
79
81
 
@@ -86,7 +88,9 @@ stack = cdk.Stack(app, "Stack", env=cdk.Environment(region="us-west-2"))
86
88
 
87
89
  global_table = dynamodb.TableV2(stack, "GlobalTable",
88
90
  partition_key=dynamodb.Attribute(name="pk", type=dynamodb.AttributeType.STRING),
89
- contributor_insights=True,
91
+ contributor_insights_specification=dynamodb.ContributorInsightsSpecification(
92
+ enabled=True
93
+ ),
90
94
  point_in_time_recovery_specification=dynamodb.PointInTimeRecoverySpecification(
91
95
  point_in_time_recovery_enabled=True
92
96
  ),
@@ -98,7 +102,9 @@ global_table = dynamodb.TableV2(stack, "GlobalTable",
98
102
  )
99
103
  ), dynamodb.ReplicaTableProps(
100
104
  region="us-east-2",
101
- contributor_insights=False
105
+ contributor_insights_specification=dynamodb.ContributorInsightsSpecification(
106
+ enabled=False
107
+ )
102
108
  )
103
109
  ]
104
110
  )
@@ -430,7 +436,7 @@ table = dynamodb.TableV2(self, "Table",
430
436
  )
431
437
  ```
432
438
 
433
- All `globalSecondaryIndexes` for replica tables are inherited from the primary table. You can configure `contributorInsights` and `readCapacity` for each `globalSecondaryIndex` on a per-replica basis:
439
+ All `globalSecondaryIndexes` for replica tables are inherited from the primary table. You can configure `contributorInsightsSpecification` and `readCapacity` for each `globalSecondaryIndex` on a per-replica basis:
434
440
 
435
441
  ```python
436
442
  import aws_cdk as cdk
@@ -441,7 +447,9 @@ stack = cdk.Stack(app, "Stack", env=cdk.Environment(region="us-west-2"))
441
447
 
442
448
  global_table = dynamodb.TableV2(stack, "GlobalTable",
443
449
  partition_key=dynamodb.Attribute(name="pk", type=dynamodb.AttributeType.STRING),
444
- contributor_insights=True,
450
+ contributor_insights_specification=dynamodb.ContributorInsightsSpecification(
451
+ enabled=True
452
+ ),
445
453
  billing=dynamodb.Billing.provisioned(
446
454
  read_capacity=dynamodb.Capacity.fixed(10),
447
455
  write_capacity=dynamodb.Capacity.autoscaled(max_capacity=10)
@@ -468,7 +476,9 @@ global_table = dynamodb.TableV2(stack, "GlobalTable",
468
476
  region="us-east-2",
469
477
  global_secondary_index_options={
470
478
  "gsi2": dynamodb.ReplicaGlobalSecondaryIndexOptions(
471
- contributor_insights=False
479
+ contributor_insights_specification=dynamodb.ContributorInsightsSpecification(
480
+ enabled=False
481
+ )
472
482
  )
473
483
  }
474
484
  )
@@ -586,25 +596,37 @@ table = dynamodb.TableV2(self, "Table",
586
596
 
587
597
  ## Contributor Insights
588
598
 
589
- Enabling `contributorInsights` for `TableV2` will provide information about the most accessed and throttled items in a table or `globalSecondaryIndex`. DynamoDB delivers this information to you via CloudWatch Contributor Insights rules, reports, and graphs of report data.
599
+ Enabling `contributorInsightSpecification` for `TableV2` will provide information about the most accessed and throttled or throttled only items in a table or `globalSecondaryIndex`. DynamoDB delivers this information to you via CloudWatch Contributor Insights rules, reports, and graphs of report data.
600
+
601
+ By default, Contributor Insights for DynamoDB monitors all requests, including both the most accessed and most throttled items.
602
+ To limit the scope to only the most accessed or only the most throttled items, use the optional `mode` parameter.
603
+
604
+ * To monitor all traffic on a table or index, set `mode` to `ContributorInsightsMode.ACCESSED_AND_THROTTLED_KEYS`.
605
+ * To monitor only throttled traffic on a table or index, set `mode` to `ContributorInsightsMode.THROTTLED_KEYS`.
590
606
 
591
607
  ```python
592
608
  table = dynamodb.TableV2(self, "Table",
593
609
  partition_key=dynamodb.Attribute(name="pk", type=dynamodb.AttributeType.STRING),
594
- contributor_insights=True
610
+ contributor_insights_specification=dynamodb.ContributorInsightsSpecification(
611
+ enabled=True,
612
+ mode=dynamodb.ContributorInsightsMode.ACCESSED_AND_THROTTLED_KEYS
613
+ )
595
614
  )
596
615
  ```
597
616
 
598
- When you use `Table`, you can enable contributor insights for a table or specific global secondary index by setting `contributorInsightsEnabled` to `true`.
617
+ When you use `Table`, you can enable contributor insights for a table or specific global secondary index by setting `contributorInsightsSpecification` parameter `enabled` to `true`.
599
618
 
600
619
  ```python
601
620
  table = dynamodb.Table(self, "Table",
602
621
  partition_key=dynamodb.Attribute(name="pk", type=dynamodb.AttributeType.STRING),
603
- contributor_insights_enabled=True
622
+ contributor_insights_specification=dynamodb.ContributorInsightsSpecification( # for a table
623
+ enabled=True,
624
+ mode=dynamodb.ContributorInsightsMode.THROTTLED_KEYS)
604
625
  )
605
626
 
606
627
  table.add_global_secondary_index(
607
- contributor_insights_enabled=True, # for a specific global secondary index
628
+ contributor_insights_specification=dynamodb.ContributorInsightsSpecification( # for a specific global secondary index
629
+ enabled=True),
608
630
  index_name="gsi",
609
631
  partition_key=dynamodb.Attribute(name="pk", type=dynamodb.AttributeType.STRING)
610
632
  )
@@ -7990,6 +8012,121 @@ class CfnTableProps:
7990
8012
  )
7991
8013
 
7992
8014
 
8015
+ @jsii.enum(jsii_type="aws-cdk-lib.aws_dynamodb.ContributorInsightsMode")
8016
+ class ContributorInsightsMode(enum.Enum):
8017
+ '''DynamoDB's Contributor Insights Mode.
8018
+
8019
+ :see: https://docs.aws.amazon.com/AWSCloudFormation/latest/TemplateReference/aws-properties-dynamodb-table-contributorinsightsspecification.html
8020
+ :exampleMetadata: infused
8021
+
8022
+ Example::
8023
+
8024
+ table = dynamodb.TableV2(self, "Table",
8025
+ partition_key=dynamodb.Attribute(name="pk", type=dynamodb.AttributeType.STRING),
8026
+ contributor_insights_specification=dynamodb.ContributorInsightsSpecification(
8027
+ enabled=True,
8028
+ mode=dynamodb.ContributorInsightsMode.ACCESSED_AND_THROTTLED_KEYS
8029
+ )
8030
+ )
8031
+ '''
8032
+
8033
+ ACCESSED_AND_THROTTLED_KEYS = "ACCESSED_AND_THROTTLED_KEYS"
8034
+ '''Emits metrics for all read and write requests, whether successful or throttled.'''
8035
+ THROTTLED_KEYS = "THROTTLED_KEYS"
8036
+ '''Emits metrics for read and write requests that were throttled.'''
8037
+
8038
+
8039
+ @jsii.data_type(
8040
+ jsii_type="aws-cdk-lib.aws_dynamodb.ContributorInsightsSpecification",
8041
+ jsii_struct_bases=[],
8042
+ name_mapping={"enabled": "enabled", "mode": "mode"},
8043
+ )
8044
+ class ContributorInsightsSpecification:
8045
+ def __init__(
8046
+ self,
8047
+ *,
8048
+ enabled: builtins.bool,
8049
+ mode: typing.Optional[ContributorInsightsMode] = None,
8050
+ ) -> None:
8051
+ '''Reference to ContributorInsightsSpecification.
8052
+
8053
+ :param enabled: Indicates whether contributor insights is enabled. Default: false
8054
+ :param mode: Indicates the type of metrics captured by contributor insights. Default: ACCESSED_AND_THROTTLED_KEYS
8055
+
8056
+ :exampleMetadata: infused
8057
+
8058
+ Example::
8059
+
8060
+ import aws_cdk as cdk
8061
+
8062
+
8063
+ app = cdk.App()
8064
+ stack = cdk.Stack(app, "Stack", env=cdk.Environment(region="us-west-2"))
8065
+
8066
+ global_table = dynamodb.TableV2(stack, "GlobalTable",
8067
+ partition_key=dynamodb.Attribute(name="pk", type=dynamodb.AttributeType.STRING),
8068
+ contributor_insights_specification=dynamodb.ContributorInsightsSpecification(
8069
+ enabled=True
8070
+ ),
8071
+ point_in_time_recovery_specification=dynamodb.PointInTimeRecoverySpecification(
8072
+ point_in_time_recovery_enabled=True
8073
+ ),
8074
+ replicas=[dynamodb.ReplicaTableProps(
8075
+ region="us-east-1",
8076
+ table_class=dynamodb.TableClass.STANDARD_INFREQUENT_ACCESS,
8077
+ point_in_time_recovery_specification=dynamodb.PointInTimeRecoverySpecification(
8078
+ point_in_time_recovery_enabled=False
8079
+ )
8080
+ ), dynamodb.ReplicaTableProps(
8081
+ region="us-east-2",
8082
+ contributor_insights_specification=dynamodb.ContributorInsightsSpecification(
8083
+ enabled=False
8084
+ )
8085
+ )
8086
+ ]
8087
+ )
8088
+ '''
8089
+ if __debug__:
8090
+ type_hints = typing.get_type_hints(_typecheckingstub__656543bd456aefaef11a80dfb0950fe5597d4bc0465f2f4fdec81a81dfe7358d)
8091
+ check_type(argname="argument enabled", value=enabled, expected_type=type_hints["enabled"])
8092
+ check_type(argname="argument mode", value=mode, expected_type=type_hints["mode"])
8093
+ self._values: typing.Dict[builtins.str, typing.Any] = {
8094
+ "enabled": enabled,
8095
+ }
8096
+ if mode is not None:
8097
+ self._values["mode"] = mode
8098
+
8099
+ @builtins.property
8100
+ def enabled(self) -> builtins.bool:
8101
+ '''Indicates whether contributor insights is enabled.
8102
+
8103
+ :default: false
8104
+ '''
8105
+ result = self._values.get("enabled")
8106
+ assert result is not None, "Required property 'enabled' is missing"
8107
+ return typing.cast(builtins.bool, result)
8108
+
8109
+ @builtins.property
8110
+ def mode(self) -> typing.Optional[ContributorInsightsMode]:
8111
+ '''Indicates the type of metrics captured by contributor insights.
8112
+
8113
+ :default: ACCESSED_AND_THROTTLED_KEYS
8114
+ '''
8115
+ result = self._values.get("mode")
8116
+ return typing.cast(typing.Optional[ContributorInsightsMode], result)
8117
+
8118
+ def __eq__(self, rhs: typing.Any) -> builtins.bool:
8119
+ return isinstance(rhs, self.__class__) and rhs._values == self._values
8120
+
8121
+ def __ne__(self, rhs: typing.Any) -> builtins.bool:
8122
+ return not (rhs == self)
8123
+
8124
+ def __repr__(self) -> str:
8125
+ return "ContributorInsightsSpecification(%s)" % ", ".join(
8126
+ k + "=" + repr(v) for k, v in self._values.items()
8127
+ )
8128
+
8129
+
7993
8130
  @jsii.data_type(
7994
8131
  jsii_type="aws-cdk-lib.aws_dynamodb.CsvOptions",
7995
8132
  jsii_struct_bases=[],
@@ -9800,7 +9937,9 @@ class PointInTimeRecoverySpecification:
9800
9937
 
9801
9938
  table = dynamodb.TableV2(self, "Table",
9802
9939
  partition_key=dynamodb.Attribute(name="pk", type=dynamodb.AttributeType.STRING),
9803
- contributor_insights=True,
9940
+ contributor_insights_specification=dynamodb.ContributorInsightsSpecification(
9941
+ enabled=True
9942
+ ),
9804
9943
  table_class=dynamodb.TableClass.STANDARD_INFREQUENT_ACCESS,
9805
9944
  point_in_time_recovery_specification=dynamodb.PointInTimeRecoverySpecification(
9806
9945
  point_in_time_recovery_enabled=True
@@ -9875,6 +10014,7 @@ class ProjectionType(enum.Enum):
9875
10014
  jsii_struct_bases=[],
9876
10015
  name_mapping={
9877
10016
  "contributor_insights": "contributorInsights",
10017
+ "contributor_insights_specification": "contributorInsightsSpecification",
9878
10018
  "max_read_request_units": "maxReadRequestUnits",
9879
10019
  "read_capacity": "readCapacity",
9880
10020
  },
@@ -9884,12 +10024,14 @@ class ReplicaGlobalSecondaryIndexOptions:
9884
10024
  self,
9885
10025
  *,
9886
10026
  contributor_insights: typing.Optional[builtins.bool] = None,
10027
+ contributor_insights_specification: typing.Optional[typing.Union[ContributorInsightsSpecification, typing.Dict[builtins.str, typing.Any]]] = None,
9887
10028
  max_read_request_units: typing.Optional[jsii.Number] = None,
9888
10029
  read_capacity: typing.Optional[Capacity] = None,
9889
10030
  ) -> None:
9890
10031
  '''Options used to configure global secondary indexes on a replica table.
9891
10032
 
9892
- :param contributor_insights: Whether CloudWatch contributor insights is enabled for a specific global secondary index on a replica table. Default: - inherited from the primary table
10033
+ :param contributor_insights: (deprecated) Whether CloudWatch contributor insights is enabled for a specific global secondary index on a replica table. Default: - inherited from the primary table
10034
+ :param contributor_insights_specification: Whether CloudWatch contributor insights is enabled and what mode is selected for a specific global secondary index on a replica table. Default: - contributor insights is not enabled
9893
10035
  :param max_read_request_units: The maximum read request units for a specific global secondary index on a replica table. Note: This can only be configured if primary table billing is PAY_PER_REQUEST. Default: - inherited from the primary table
9894
10036
  :param read_capacity: The read capacity for a specific global secondary index on a replica table. Note: This can only be configured if primary table billing is provisioned. Default: - inherited from the primary table
9895
10037
 
@@ -9905,7 +10047,9 @@ class ReplicaGlobalSecondaryIndexOptions:
9905
10047
 
9906
10048
  global_table = dynamodb.TableV2(stack, "GlobalTable",
9907
10049
  partition_key=dynamodb.Attribute(name="pk", type=dynamodb.AttributeType.STRING),
9908
- contributor_insights=True,
10050
+ contributor_insights_specification=dynamodb.ContributorInsightsSpecification(
10051
+ enabled=True
10052
+ ),
9909
10053
  billing=dynamodb.Billing.provisioned(
9910
10054
  read_capacity=dynamodb.Capacity.fixed(10),
9911
10055
  write_capacity=dynamodb.Capacity.autoscaled(max_capacity=10)
@@ -9932,21 +10076,28 @@ class ReplicaGlobalSecondaryIndexOptions:
9932
10076
  region="us-east-2",
9933
10077
  global_secondary_index_options={
9934
10078
  "gsi2": dynamodb.ReplicaGlobalSecondaryIndexOptions(
9935
- contributor_insights=False
10079
+ contributor_insights_specification=dynamodb.ContributorInsightsSpecification(
10080
+ enabled=False
10081
+ )
9936
10082
  )
9937
10083
  }
9938
10084
  )
9939
10085
  ]
9940
10086
  )
9941
10087
  '''
10088
+ if isinstance(contributor_insights_specification, dict):
10089
+ contributor_insights_specification = ContributorInsightsSpecification(**contributor_insights_specification)
9942
10090
  if __debug__:
9943
10091
  type_hints = typing.get_type_hints(_typecheckingstub__eaa3a170e1978a5997011b8319bcd83bf34642dac50e342aad0705ee28b15714)
9944
10092
  check_type(argname="argument contributor_insights", value=contributor_insights, expected_type=type_hints["contributor_insights"])
10093
+ check_type(argname="argument contributor_insights_specification", value=contributor_insights_specification, expected_type=type_hints["contributor_insights_specification"])
9945
10094
  check_type(argname="argument max_read_request_units", value=max_read_request_units, expected_type=type_hints["max_read_request_units"])
9946
10095
  check_type(argname="argument read_capacity", value=read_capacity, expected_type=type_hints["read_capacity"])
9947
10096
  self._values: typing.Dict[builtins.str, typing.Any] = {}
9948
10097
  if contributor_insights is not None:
9949
10098
  self._values["contributor_insights"] = contributor_insights
10099
+ if contributor_insights_specification is not None:
10100
+ self._values["contributor_insights_specification"] = contributor_insights_specification
9950
10101
  if max_read_request_units is not None:
9951
10102
  self._values["max_read_request_units"] = max_read_request_units
9952
10103
  if read_capacity is not None:
@@ -9954,13 +10105,28 @@ class ReplicaGlobalSecondaryIndexOptions:
9954
10105
 
9955
10106
  @builtins.property
9956
10107
  def contributor_insights(self) -> typing.Optional[builtins.bool]:
9957
- '''Whether CloudWatch contributor insights is enabled for a specific global secondary index on a replica table.
10108
+ '''(deprecated) Whether CloudWatch contributor insights is enabled for a specific global secondary index on a replica table.
9958
10109
 
9959
10110
  :default: - inherited from the primary table
10111
+
10112
+ :deprecated: use ``contributorInsightsSpecification`` instead
10113
+
10114
+ :stability: deprecated
9960
10115
  '''
9961
10116
  result = self._values.get("contributor_insights")
9962
10117
  return typing.cast(typing.Optional[builtins.bool], result)
9963
10118
 
10119
+ @builtins.property
10120
+ def contributor_insights_specification(
10121
+ self,
10122
+ ) -> typing.Optional[ContributorInsightsSpecification]:
10123
+ '''Whether CloudWatch contributor insights is enabled and what mode is selected for a specific global secondary index on a replica table.
10124
+
10125
+ :default: - contributor insights is not enabled
10126
+ '''
10127
+ result = self._values.get("contributor_insights_specification")
10128
+ return typing.cast(typing.Optional[ContributorInsightsSpecification], result)
10129
+
9964
10130
  @builtins.property
9965
10131
  def max_read_request_units(self) -> typing.Optional[jsii.Number]:
9966
10132
  '''The maximum read request units for a specific global secondary index on a replica table.
@@ -12707,7 +12873,9 @@ class TableClass(enum.Enum):
12707
12873
 
12708
12874
  table = dynamodb.TableV2(self, "Table",
12709
12875
  partition_key=dynamodb.Attribute(name="pk", type=dynamodb.AttributeType.STRING),
12710
- contributor_insights=True,
12876
+ contributor_insights_specification=dynamodb.ContributorInsightsSpecification(
12877
+ enabled=True
12878
+ ),
12711
12879
  table_class=dynamodb.TableClass.STANDARD_INFREQUENT_ACCESS,
12712
12880
  point_in_time_recovery_specification=dynamodb.PointInTimeRecoverySpecification(
12713
12881
  point_in_time_recovery_enabled=True
@@ -12837,6 +13005,7 @@ typing.cast(typing.Any, TableEncryptionV2).__jsii_proxy_class__ = lambda : _Tabl
12837
13005
  "sort_key": "sortKey",
12838
13006
  "billing_mode": "billingMode",
12839
13007
  "contributor_insights_enabled": "contributorInsightsEnabled",
13008
+ "contributor_insights_specification": "contributorInsightsSpecification",
12840
13009
  "deletion_protection": "deletionProtection",
12841
13010
  "encryption": "encryption",
12842
13011
  "encryption_key": "encryptionKey",
@@ -12867,6 +13036,7 @@ class TableOptions(SchemaOptions):
12867
13036
  sort_key: typing.Optional[typing.Union[Attribute, typing.Dict[builtins.str, typing.Any]]] = None,
12868
13037
  billing_mode: typing.Optional[BillingMode] = None,
12869
13038
  contributor_insights_enabled: typing.Optional[builtins.bool] = None,
13039
+ contributor_insights_specification: typing.Optional[typing.Union[ContributorInsightsSpecification, typing.Dict[builtins.str, typing.Any]]] = None,
12870
13040
  deletion_protection: typing.Optional[builtins.bool] = None,
12871
13041
  encryption: typing.Optional[TableEncryption] = None,
12872
13042
  encryption_key: typing.Optional[_IKey_5f11635f] = None,
@@ -12895,7 +13065,8 @@ class TableOptions(SchemaOptions):
12895
13065
  :param partition_key: Partition key attribute definition.
12896
13066
  :param sort_key: Sort key attribute definition. Default: no sort key
12897
13067
  :param billing_mode: Specify how you are charged for read and write throughput and how you manage capacity. Default: PROVISIONED if ``replicationRegions`` is not specified, PAY_PER_REQUEST otherwise
12898
- :param contributor_insights_enabled: Whether CloudWatch contributor insights is enabled. Default: false
13068
+ :param contributor_insights_enabled: (deprecated) Whether CloudWatch contributor insights is enabled. Default: false
13069
+ :param contributor_insights_specification: Whether CloudWatch contributor insights is enabled and what mode is selected. Default: - contributor insights is not enabled
12899
13070
  :param deletion_protection: Enables deletion protection for the table. Default: false
12900
13071
  :param encryption: Whether server-side encryption with an AWS managed customer master key is enabled. This property cannot be set if ``serverSideEncryption`` is set. .. epigraph:: **NOTE**: if you set this to ``CUSTOMER_MANAGED`` and ``encryptionKey`` is not specified, the key that the Tablet generates for you will be created with default permissions. If you are using CDKv2, these permissions will be sufficient to enable the key for use with DynamoDB tables. If you are using CDKv1, make sure the feature flag ``@aws-cdk/aws-kms:defaultKeyPolicies`` is set to ``true`` in your ``cdk.json``. Default: - The table is encrypted with an encryption key managed by DynamoDB, and you are not charged any fee for using it.
12901
13072
  :param encryption_key: External KMS key to use for table encryption. This property can only be set if ``encryption`` is set to ``TableEncryption.CUSTOMER_MANAGED``. Default: - If ``encryption`` is set to ``TableEncryption.CUSTOMER_MANAGED`` and this property is undefined, a new KMS key will be created and associated with this table. If ``encryption`` and this property are both undefined, then the table is encrypted with an encryption key managed by DynamoDB, and you are not charged any fee for using it.
@@ -12943,6 +13114,12 @@ class TableOptions(SchemaOptions):
12943
13114
  # the properties below are optional
12944
13115
  billing_mode=dynamodb.BillingMode.PAY_PER_REQUEST,
12945
13116
  contributor_insights_enabled=False,
13117
+ contributor_insights_specification=dynamodb.ContributorInsightsSpecification(
13118
+ enabled=False,
13119
+
13120
+ # the properties below are optional
13121
+ mode=dynamodb.ContributorInsightsMode.ACCESSED_AND_THROTTLED_KEYS
13122
+ ),
12946
13123
  deletion_protection=False,
12947
13124
  encryption=dynamodb.TableEncryption.DEFAULT,
12948
13125
  encryption_key=key,
@@ -12989,6 +13166,8 @@ class TableOptions(SchemaOptions):
12989
13166
  partition_key = Attribute(**partition_key)
12990
13167
  if isinstance(sort_key, dict):
12991
13168
  sort_key = Attribute(**sort_key)
13169
+ if isinstance(contributor_insights_specification, dict):
13170
+ contributor_insights_specification = ContributorInsightsSpecification(**contributor_insights_specification)
12992
13171
  if isinstance(import_source, dict):
12993
13172
  import_source = ImportSourceSpecification(**import_source)
12994
13173
  if isinstance(point_in_time_recovery_specification, dict):
@@ -13001,6 +13180,7 @@ class TableOptions(SchemaOptions):
13001
13180
  check_type(argname="argument sort_key", value=sort_key, expected_type=type_hints["sort_key"])
13002
13181
  check_type(argname="argument billing_mode", value=billing_mode, expected_type=type_hints["billing_mode"])
13003
13182
  check_type(argname="argument contributor_insights_enabled", value=contributor_insights_enabled, expected_type=type_hints["contributor_insights_enabled"])
13183
+ check_type(argname="argument contributor_insights_specification", value=contributor_insights_specification, expected_type=type_hints["contributor_insights_specification"])
13004
13184
  check_type(argname="argument deletion_protection", value=deletion_protection, expected_type=type_hints["deletion_protection"])
13005
13185
  check_type(argname="argument encryption", value=encryption, expected_type=type_hints["encryption"])
13006
13186
  check_type(argname="argument encryption_key", value=encryption_key, expected_type=type_hints["encryption_key"])
@@ -13030,6 +13210,8 @@ class TableOptions(SchemaOptions):
13030
13210
  self._values["billing_mode"] = billing_mode
13031
13211
  if contributor_insights_enabled is not None:
13032
13212
  self._values["contributor_insights_enabled"] = contributor_insights_enabled
13213
+ if contributor_insights_specification is not None:
13214
+ self._values["contributor_insights_specification"] = contributor_insights_specification
13033
13215
  if deletion_protection is not None:
13034
13216
  self._values["deletion_protection"] = deletion_protection
13035
13217
  if encryption is not None:
@@ -13098,13 +13280,28 @@ class TableOptions(SchemaOptions):
13098
13280
 
13099
13281
  @builtins.property
13100
13282
  def contributor_insights_enabled(self) -> typing.Optional[builtins.bool]:
13101
- '''Whether CloudWatch contributor insights is enabled.
13283
+ '''(deprecated) Whether CloudWatch contributor insights is enabled.
13102
13284
 
13103
13285
  :default: false
13286
+
13287
+ :deprecated: use `contributorInsightsSpecification instead
13288
+
13289
+ :stability: deprecated
13104
13290
  '''
13105
13291
  result = self._values.get("contributor_insights_enabled")
13106
13292
  return typing.cast(typing.Optional[builtins.bool], result)
13107
13293
 
13294
+ @builtins.property
13295
+ def contributor_insights_specification(
13296
+ self,
13297
+ ) -> typing.Optional[ContributorInsightsSpecification]:
13298
+ '''Whether CloudWatch contributor insights is enabled and what mode is selected.
13299
+
13300
+ :default: - contributor insights is not enabled
13301
+ '''
13302
+ result = self._values.get("contributor_insights_specification")
13303
+ return typing.cast(typing.Optional[ContributorInsightsSpecification], result)
13304
+
13108
13305
  @builtins.property
13109
13306
  def deletion_protection(self) -> typing.Optional[builtins.bool]:
13110
13307
  '''Enables deletion protection for the table.
@@ -13369,6 +13566,7 @@ class TableOptions(SchemaOptions):
13369
13566
  jsii_struct_bases=[],
13370
13567
  name_mapping={
13371
13568
  "contributor_insights": "contributorInsights",
13569
+ "contributor_insights_specification": "contributorInsightsSpecification",
13372
13570
  "deletion_protection": "deletionProtection",
13373
13571
  "kinesis_stream": "kinesisStream",
13374
13572
  "point_in_time_recovery": "pointInTimeRecovery",
@@ -13383,6 +13581,7 @@ class TableOptionsV2:
13383
13581
  self,
13384
13582
  *,
13385
13583
  contributor_insights: typing.Optional[builtins.bool] = None,
13584
+ contributor_insights_specification: typing.Optional[typing.Union[ContributorInsightsSpecification, typing.Dict[builtins.str, typing.Any]]] = None,
13386
13585
  deletion_protection: typing.Optional[builtins.bool] = None,
13387
13586
  kinesis_stream: typing.Optional[_IStream_4e2457d2] = None,
13388
13587
  point_in_time_recovery: typing.Optional[builtins.bool] = None,
@@ -13393,7 +13592,8 @@ class TableOptionsV2:
13393
13592
  ) -> None:
13394
13593
  '''Options used to configure a DynamoDB table.
13395
13594
 
13396
- :param contributor_insights: Whether CloudWatch contributor insights is enabled. Default: false
13595
+ :param contributor_insights: (deprecated) Whether CloudWatch contributor insights is enabled. Default: false
13596
+ :param contributor_insights_specification: Whether CloudWatch contributor insights is enabled and what mode is selected. Default: - contributor insights is not enabled
13397
13597
  :param deletion_protection: Whether deletion protection is enabled. Default: false
13398
13598
  :param kinesis_stream: Kinesis Data Stream to capture item level changes. Default: - no Kinesis Data Stream
13399
13599
  :param point_in_time_recovery: (deprecated) Whether point-in-time recovery is enabled. Default: false - point in time recovery is not enabled.
@@ -13417,6 +13617,12 @@ class TableOptionsV2:
13417
13617
 
13418
13618
  table_options_v2 = dynamodb.TableOptionsV2(
13419
13619
  contributor_insights=False,
13620
+ contributor_insights_specification=dynamodb.ContributorInsightsSpecification(
13621
+ enabled=False,
13622
+
13623
+ # the properties below are optional
13624
+ mode=dynamodb.ContributorInsightsMode.ACCESSED_AND_THROTTLED_KEYS
13625
+ ),
13420
13626
  deletion_protection=False,
13421
13627
  kinesis_stream=stream,
13422
13628
  point_in_time_recovery=False,
@@ -13434,11 +13640,14 @@ class TableOptionsV2:
13434
13640
  )]
13435
13641
  )
13436
13642
  '''
13643
+ if isinstance(contributor_insights_specification, dict):
13644
+ contributor_insights_specification = ContributorInsightsSpecification(**contributor_insights_specification)
13437
13645
  if isinstance(point_in_time_recovery_specification, dict):
13438
13646
  point_in_time_recovery_specification = PointInTimeRecoverySpecification(**point_in_time_recovery_specification)
13439
13647
  if __debug__:
13440
13648
  type_hints = typing.get_type_hints(_typecheckingstub__1b65ee3c8ef5c3b632f4d1fad233252caadaa5f607c0fd92f49b64933f1de51c)
13441
13649
  check_type(argname="argument contributor_insights", value=contributor_insights, expected_type=type_hints["contributor_insights"])
13650
+ check_type(argname="argument contributor_insights_specification", value=contributor_insights_specification, expected_type=type_hints["contributor_insights_specification"])
13442
13651
  check_type(argname="argument deletion_protection", value=deletion_protection, expected_type=type_hints["deletion_protection"])
13443
13652
  check_type(argname="argument kinesis_stream", value=kinesis_stream, expected_type=type_hints["kinesis_stream"])
13444
13653
  check_type(argname="argument point_in_time_recovery", value=point_in_time_recovery, expected_type=type_hints["point_in_time_recovery"])
@@ -13449,6 +13658,8 @@ class TableOptionsV2:
13449
13658
  self._values: typing.Dict[builtins.str, typing.Any] = {}
13450
13659
  if contributor_insights is not None:
13451
13660
  self._values["contributor_insights"] = contributor_insights
13661
+ if contributor_insights_specification is not None:
13662
+ self._values["contributor_insights_specification"] = contributor_insights_specification
13452
13663
  if deletion_protection is not None:
13453
13664
  self._values["deletion_protection"] = deletion_protection
13454
13665
  if kinesis_stream is not None:
@@ -13466,13 +13677,28 @@ class TableOptionsV2:
13466
13677
 
13467
13678
  @builtins.property
13468
13679
  def contributor_insights(self) -> typing.Optional[builtins.bool]:
13469
- '''Whether CloudWatch contributor insights is enabled.
13680
+ '''(deprecated) Whether CloudWatch contributor insights is enabled.
13470
13681
 
13471
13682
  :default: false
13683
+
13684
+ :deprecated: use ``contributorInsightsSpecification`` instead
13685
+
13686
+ :stability: deprecated
13472
13687
  '''
13473
13688
  result = self._values.get("contributor_insights")
13474
13689
  return typing.cast(typing.Optional[builtins.bool], result)
13475
13690
 
13691
+ @builtins.property
13692
+ def contributor_insights_specification(
13693
+ self,
13694
+ ) -> typing.Optional[ContributorInsightsSpecification]:
13695
+ '''Whether CloudWatch contributor insights is enabled and what mode is selected.
13696
+
13697
+ :default: - contributor insights is not enabled
13698
+ '''
13699
+ result = self._values.get("contributor_insights_specification")
13700
+ return typing.cast(typing.Optional[ContributorInsightsSpecification], result)
13701
+
13476
13702
  @builtins.property
13477
13703
  def deletion_protection(self) -> typing.Optional[builtins.bool]:
13478
13704
  '''Whether deletion protection is enabled.
@@ -13564,6 +13790,7 @@ class TableOptionsV2:
13564
13790
  "sort_key": "sortKey",
13565
13791
  "billing_mode": "billingMode",
13566
13792
  "contributor_insights_enabled": "contributorInsightsEnabled",
13793
+ "contributor_insights_specification": "contributorInsightsSpecification",
13567
13794
  "deletion_protection": "deletionProtection",
13568
13795
  "encryption": "encryption",
13569
13796
  "encryption_key": "encryptionKey",
@@ -13597,6 +13824,7 @@ class TableProps(TableOptions):
13597
13824
  sort_key: typing.Optional[typing.Union[Attribute, typing.Dict[builtins.str, typing.Any]]] = None,
13598
13825
  billing_mode: typing.Optional[BillingMode] = None,
13599
13826
  contributor_insights_enabled: typing.Optional[builtins.bool] = None,
13827
+ contributor_insights_specification: typing.Optional[typing.Union[ContributorInsightsSpecification, typing.Dict[builtins.str, typing.Any]]] = None,
13600
13828
  deletion_protection: typing.Optional[builtins.bool] = None,
13601
13829
  encryption: typing.Optional[TableEncryption] = None,
13602
13830
  encryption_key: typing.Optional[_IKey_5f11635f] = None,
@@ -13626,7 +13854,8 @@ class TableProps(TableOptions):
13626
13854
  :param partition_key: Partition key attribute definition.
13627
13855
  :param sort_key: Sort key attribute definition. Default: no sort key
13628
13856
  :param billing_mode: Specify how you are charged for read and write throughput and how you manage capacity. Default: PROVISIONED if ``replicationRegions`` is not specified, PAY_PER_REQUEST otherwise
13629
- :param contributor_insights_enabled: Whether CloudWatch contributor insights is enabled. Default: false
13857
+ :param contributor_insights_enabled: (deprecated) Whether CloudWatch contributor insights is enabled. Default: false
13858
+ :param contributor_insights_specification: Whether CloudWatch contributor insights is enabled and what mode is selected. Default: - contributor insights is not enabled
13630
13859
  :param deletion_protection: Enables deletion protection for the table. Default: false
13631
13860
  :param encryption: Whether server-side encryption with an AWS managed customer master key is enabled. This property cannot be set if ``serverSideEncryption`` is set. .. epigraph:: **NOTE**: if you set this to ``CUSTOMER_MANAGED`` and ``encryptionKey`` is not specified, the key that the Tablet generates for you will be created with default permissions. If you are using CDKv2, these permissions will be sufficient to enable the key for use with DynamoDB tables. If you are using CDKv1, make sure the feature flag ``@aws-cdk/aws-kms:defaultKeyPolicies`` is set to ``true`` in your ``cdk.json``. Default: - The table is encrypted with an encryption key managed by DynamoDB, and you are not charged any fee for using it.
13632
13861
  :param encryption_key: External KMS key to use for table encryption. This property can only be set if ``encryption`` is set to ``TableEncryption.CUSTOMER_MANAGED``. Default: - If ``encryption`` is set to ``TableEncryption.CUSTOMER_MANAGED`` and this property is undefined, a new KMS key will be created and associated with this table. If ``encryption`` and this property are both undefined, then the table is encrypted with an encryption key managed by DynamoDB, and you are not charged any fee for using it.
@@ -13681,6 +13910,8 @@ class TableProps(TableOptions):
13681
13910
  partition_key = Attribute(**partition_key)
13682
13911
  if isinstance(sort_key, dict):
13683
13912
  sort_key = Attribute(**sort_key)
13913
+ if isinstance(contributor_insights_specification, dict):
13914
+ contributor_insights_specification = ContributorInsightsSpecification(**contributor_insights_specification)
13684
13915
  if isinstance(import_source, dict):
13685
13916
  import_source = ImportSourceSpecification(**import_source)
13686
13917
  if isinstance(point_in_time_recovery_specification, dict):
@@ -13693,6 +13924,7 @@ class TableProps(TableOptions):
13693
13924
  check_type(argname="argument sort_key", value=sort_key, expected_type=type_hints["sort_key"])
13694
13925
  check_type(argname="argument billing_mode", value=billing_mode, expected_type=type_hints["billing_mode"])
13695
13926
  check_type(argname="argument contributor_insights_enabled", value=contributor_insights_enabled, expected_type=type_hints["contributor_insights_enabled"])
13927
+ check_type(argname="argument contributor_insights_specification", value=contributor_insights_specification, expected_type=type_hints["contributor_insights_specification"])
13696
13928
  check_type(argname="argument deletion_protection", value=deletion_protection, expected_type=type_hints["deletion_protection"])
13697
13929
  check_type(argname="argument encryption", value=encryption, expected_type=type_hints["encryption"])
13698
13930
  check_type(argname="argument encryption_key", value=encryption_key, expected_type=type_hints["encryption_key"])
@@ -13725,6 +13957,8 @@ class TableProps(TableOptions):
13725
13957
  self._values["billing_mode"] = billing_mode
13726
13958
  if contributor_insights_enabled is not None:
13727
13959
  self._values["contributor_insights_enabled"] = contributor_insights_enabled
13960
+ if contributor_insights_specification is not None:
13961
+ self._values["contributor_insights_specification"] = contributor_insights_specification
13728
13962
  if deletion_protection is not None:
13729
13963
  self._values["deletion_protection"] = deletion_protection
13730
13964
  if encryption is not None:
@@ -13799,13 +14033,28 @@ class TableProps(TableOptions):
13799
14033
 
13800
14034
  @builtins.property
13801
14035
  def contributor_insights_enabled(self) -> typing.Optional[builtins.bool]:
13802
- '''Whether CloudWatch contributor insights is enabled.
14036
+ '''(deprecated) Whether CloudWatch contributor insights is enabled.
13803
14037
 
13804
14038
  :default: false
14039
+
14040
+ :deprecated: use `contributorInsightsSpecification instead
14041
+
14042
+ :stability: deprecated
13805
14043
  '''
13806
14044
  result = self._values.get("contributor_insights_enabled")
13807
14045
  return typing.cast(typing.Optional[builtins.bool], result)
13808
14046
 
14047
+ @builtins.property
14048
+ def contributor_insights_specification(
14049
+ self,
14050
+ ) -> typing.Optional[ContributorInsightsSpecification]:
14051
+ '''Whether CloudWatch contributor insights is enabled and what mode is selected.
14052
+
14053
+ :default: - contributor insights is not enabled
14054
+ '''
14055
+ result = self._values.get("contributor_insights_specification")
14056
+ return typing.cast(typing.Optional[ContributorInsightsSpecification], result)
14057
+
13809
14058
  @builtins.property
13810
14059
  def deletion_protection(self) -> typing.Optional[builtins.bool]:
13811
14060
  '''Enables deletion protection for the table.
@@ -14099,6 +14348,7 @@ class TableProps(TableOptions):
14099
14348
  jsii_struct_bases=[TableOptionsV2],
14100
14349
  name_mapping={
14101
14350
  "contributor_insights": "contributorInsights",
14351
+ "contributor_insights_specification": "contributorInsightsSpecification",
14102
14352
  "deletion_protection": "deletionProtection",
14103
14353
  "kinesis_stream": "kinesisStream",
14104
14354
  "point_in_time_recovery": "pointInTimeRecovery",
@@ -14127,6 +14377,7 @@ class TablePropsV2(TableOptionsV2):
14127
14377
  self,
14128
14378
  *,
14129
14379
  contributor_insights: typing.Optional[builtins.bool] = None,
14380
+ contributor_insights_specification: typing.Optional[typing.Union[ContributorInsightsSpecification, typing.Dict[builtins.str, typing.Any]]] = None,
14130
14381
  deletion_protection: typing.Optional[builtins.bool] = None,
14131
14382
  kinesis_stream: typing.Optional[_IStream_4e2457d2] = None,
14132
14383
  point_in_time_recovery: typing.Optional[builtins.bool] = None,
@@ -14151,7 +14402,8 @@ class TablePropsV2(TableOptionsV2):
14151
14402
  ) -> None:
14152
14403
  '''Properties used to configure a DynamoDB table.
14153
14404
 
14154
- :param contributor_insights: Whether CloudWatch contributor insights is enabled. Default: false
14405
+ :param contributor_insights: (deprecated) Whether CloudWatch contributor insights is enabled. Default: false
14406
+ :param contributor_insights_specification: Whether CloudWatch contributor insights is enabled and what mode is selected. Default: - contributor insights is not enabled
14155
14407
  :param deletion_protection: Whether deletion protection is enabled. Default: false
14156
14408
  :param kinesis_stream: Kinesis Data Stream to capture item level changes. Default: - no Kinesis Data Stream
14157
14409
  :param point_in_time_recovery: (deprecated) Whether point-in-time recovery is enabled. Default: false - point in time recovery is not enabled.
@@ -14187,11 +14439,12 @@ class TablePropsV2(TableOptionsV2):
14187
14439
  mrsc_table = dynamodb.TableV2(stack, "MRSCTable",
14188
14440
  partition_key=dynamodb.Attribute(name="pk", type=dynamodb.AttributeType.STRING),
14189
14441
  multi_region_consistency=dynamodb.MultiRegionConsistency.STRONG,
14190
- replicas=[dynamodb.ReplicaTableProps(region="us-east-1")
14191
- ],
14192
- witness_region="us-east-2"
14442
+ replicas=[dynamodb.ReplicaTableProps(region="us-east-1"), dynamodb.ReplicaTableProps(region="us-east-2")
14443
+ ]
14193
14444
  )
14194
14445
  '''
14446
+ if isinstance(contributor_insights_specification, dict):
14447
+ contributor_insights_specification = ContributorInsightsSpecification(**contributor_insights_specification)
14195
14448
  if isinstance(point_in_time_recovery_specification, dict):
14196
14449
  point_in_time_recovery_specification = PointInTimeRecoverySpecification(**point_in_time_recovery_specification)
14197
14450
  if isinstance(partition_key, dict):
@@ -14203,6 +14456,7 @@ class TablePropsV2(TableOptionsV2):
14203
14456
  if __debug__:
14204
14457
  type_hints = typing.get_type_hints(_typecheckingstub__205e5df85e01c6c2d91d5922a57e3ed5903027748a8b3222622bebd1077e84ba)
14205
14458
  check_type(argname="argument contributor_insights", value=contributor_insights, expected_type=type_hints["contributor_insights"])
14459
+ check_type(argname="argument contributor_insights_specification", value=contributor_insights_specification, expected_type=type_hints["contributor_insights_specification"])
14206
14460
  check_type(argname="argument deletion_protection", value=deletion_protection, expected_type=type_hints["deletion_protection"])
14207
14461
  check_type(argname="argument kinesis_stream", value=kinesis_stream, expected_type=type_hints["kinesis_stream"])
14208
14462
  check_type(argname="argument point_in_time_recovery", value=point_in_time_recovery, expected_type=type_hints["point_in_time_recovery"])
@@ -14229,6 +14483,8 @@ class TablePropsV2(TableOptionsV2):
14229
14483
  }
14230
14484
  if contributor_insights is not None:
14231
14485
  self._values["contributor_insights"] = contributor_insights
14486
+ if contributor_insights_specification is not None:
14487
+ self._values["contributor_insights_specification"] = contributor_insights_specification
14232
14488
  if deletion_protection is not None:
14233
14489
  self._values["deletion_protection"] = deletion_protection
14234
14490
  if kinesis_stream is not None:
@@ -14272,13 +14528,28 @@ class TablePropsV2(TableOptionsV2):
14272
14528
 
14273
14529
  @builtins.property
14274
14530
  def contributor_insights(self) -> typing.Optional[builtins.bool]:
14275
- '''Whether CloudWatch contributor insights is enabled.
14531
+ '''(deprecated) Whether CloudWatch contributor insights is enabled.
14276
14532
 
14277
14533
  :default: false
14534
+
14535
+ :deprecated: use ``contributorInsightsSpecification`` instead
14536
+
14537
+ :stability: deprecated
14278
14538
  '''
14279
14539
  result = self._values.get("contributor_insights")
14280
14540
  return typing.cast(typing.Optional[builtins.bool], result)
14281
14541
 
14542
+ @builtins.property
14543
+ def contributor_insights_specification(
14544
+ self,
14545
+ ) -> typing.Optional[ContributorInsightsSpecification]:
14546
+ '''Whether CloudWatch contributor insights is enabled and what mode is selected.
14547
+
14548
+ :default: - contributor insights is not enabled
14549
+ '''
14550
+ result = self._values.get("contributor_insights_specification")
14551
+ return typing.cast(typing.Optional[ContributorInsightsSpecification], result)
14552
+
14282
14553
  @builtins.property
14283
14554
  def deletion_protection(self) -> typing.Optional[builtins.bool]:
14284
14555
  '''Whether deletion protection is enabled.
@@ -14553,6 +14824,7 @@ class TableV2(
14553
14824
  warm_throughput: typing.Optional[typing.Union["WarmThroughput", typing.Dict[builtins.str, typing.Any]]] = None,
14554
14825
  witness_region: typing.Optional[builtins.str] = None,
14555
14826
  contributor_insights: typing.Optional[builtins.bool] = None,
14827
+ contributor_insights_specification: typing.Optional[typing.Union[ContributorInsightsSpecification, typing.Dict[builtins.str, typing.Any]]] = None,
14556
14828
  deletion_protection: typing.Optional[builtins.bool] = None,
14557
14829
  kinesis_stream: typing.Optional[_IStream_4e2457d2] = None,
14558
14830
  point_in_time_recovery: typing.Optional[builtins.bool] = None,
@@ -14578,7 +14850,8 @@ class TableV2(
14578
14850
  :param time_to_live_attribute: The name of the TTL attribute. Default: - TTL is disabled
14579
14851
  :param warm_throughput: The warm throughput configuration for the table. Default: - no warm throughput is configured
14580
14852
  :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
14581
- :param contributor_insights: Whether CloudWatch contributor insights is enabled. Default: false
14853
+ :param contributor_insights: (deprecated) Whether CloudWatch contributor insights is enabled. Default: false
14854
+ :param contributor_insights_specification: Whether CloudWatch contributor insights is enabled and what mode is selected. Default: - contributor insights is not enabled
14582
14855
  :param deletion_protection: Whether deletion protection is enabled. Default: false
14583
14856
  :param kinesis_stream: Kinesis Data Stream to capture item level changes. Default: - no Kinesis Data Stream
14584
14857
  :param point_in_time_recovery: (deprecated) Whether point-in-time recovery is enabled. Default: false - point in time recovery is not enabled.
@@ -14607,6 +14880,7 @@ class TableV2(
14607
14880
  warm_throughput=warm_throughput,
14608
14881
  witness_region=witness_region,
14609
14882
  contributor_insights=contributor_insights,
14883
+ contributor_insights_specification=contributor_insights_specification,
14610
14884
  deletion_protection=deletion_protection,
14611
14885
  kinesis_stream=kinesis_stream,
14612
14886
  point_in_time_recovery=point_in_time_recovery,
@@ -14787,6 +15061,7 @@ class TableV2(
14787
15061
  max_read_request_units: typing.Optional[jsii.Number] = None,
14788
15062
  read_capacity: typing.Optional[Capacity] = None,
14789
15063
  contributor_insights: typing.Optional[builtins.bool] = None,
15064
+ contributor_insights_specification: typing.Optional[typing.Union[ContributorInsightsSpecification, typing.Dict[builtins.str, typing.Any]]] = None,
14790
15065
  deletion_protection: typing.Optional[builtins.bool] = None,
14791
15066
  kinesis_stream: typing.Optional[_IStream_4e2457d2] = None,
14792
15067
  point_in_time_recovery: typing.Optional[builtins.bool] = None,
@@ -14803,7 +15078,8 @@ class TableV2(
14803
15078
  :param global_secondary_index_options: Options used to configure global secondary index properties. Default: - inherited from the primary table
14804
15079
  :param max_read_request_units: The maximum read request units. Note: This can only be configured if the primary table billing is PAY_PER_REQUEST. Default: - inherited from the primary table
14805
15080
  :param read_capacity: The read capacity. Note: This can only be configured if the primary table billing is provisioned. Default: - inherited from the primary table
14806
- :param contributor_insights: Whether CloudWatch contributor insights is enabled. Default: false
15081
+ :param contributor_insights: (deprecated) Whether CloudWatch contributor insights is enabled. Default: false
15082
+ :param contributor_insights_specification: Whether CloudWatch contributor insights is enabled and what mode is selected. Default: - contributor insights is not enabled
14807
15083
  :param deletion_protection: Whether deletion protection is enabled. Default: false
14808
15084
  :param kinesis_stream: Kinesis Data Stream to capture item level changes. Default: - no Kinesis Data Stream
14809
15085
  :param point_in_time_recovery: (deprecated) Whether point-in-time recovery is enabled. Default: false - point in time recovery is not enabled.
@@ -14818,6 +15094,7 @@ class TableV2(
14818
15094
  max_read_request_units=max_read_request_units,
14819
15095
  read_capacity=read_capacity,
14820
15096
  contributor_insights=contributor_insights,
15097
+ contributor_insights_specification=contributor_insights_specification,
14821
15098
  deletion_protection=deletion_protection,
14822
15099
  kinesis_stream=kinesis_stream,
14823
15100
  point_in_time_recovery=point_in_time_recovery,
@@ -15215,6 +15492,7 @@ class WarmThroughput:
15215
15492
  "partition_key": "partitionKey",
15216
15493
  "sort_key": "sortKey",
15217
15494
  "contributor_insights_enabled": "contributorInsightsEnabled",
15495
+ "contributor_insights_specification": "contributorInsightsSpecification",
15218
15496
  "max_read_request_units": "maxReadRequestUnits",
15219
15497
  "max_write_request_units": "maxWriteRequestUnits",
15220
15498
  "read_capacity": "readCapacity",
@@ -15232,6 +15510,7 @@ class GlobalSecondaryIndexProps(SecondaryIndexProps, SchemaOptions):
15232
15510
  partition_key: typing.Union[Attribute, typing.Dict[builtins.str, typing.Any]],
15233
15511
  sort_key: typing.Optional[typing.Union[Attribute, typing.Dict[builtins.str, typing.Any]]] = None,
15234
15512
  contributor_insights_enabled: typing.Optional[builtins.bool] = None,
15513
+ contributor_insights_specification: typing.Optional[typing.Union[ContributorInsightsSpecification, typing.Dict[builtins.str, typing.Any]]] = None,
15235
15514
  max_read_request_units: typing.Optional[jsii.Number] = None,
15236
15515
  max_write_request_units: typing.Optional[jsii.Number] = None,
15237
15516
  read_capacity: typing.Optional[jsii.Number] = None,
@@ -15245,7 +15524,8 @@ class GlobalSecondaryIndexProps(SecondaryIndexProps, SchemaOptions):
15245
15524
  :param projection_type: The set of attributes that are projected into the secondary index. Default: ALL
15246
15525
  :param partition_key: Partition key attribute definition.
15247
15526
  :param sort_key: Sort key attribute definition. Default: no sort key
15248
- :param contributor_insights_enabled: Whether CloudWatch contributor insights is enabled for the specified global secondary index. Default: false
15527
+ :param contributor_insights_enabled: (deprecated) Whether CloudWatch contributor insights is enabled for the specified global secondary index. Default: false
15528
+ :param contributor_insights_specification: Whether CloudWatch contributor insights is enabled and what mode is selected. Default: - contributor insights is not enabled
15249
15529
  :param max_read_request_units: The maximum read request units for the global secondary index. Can only be provided if table billingMode is PAY_PER_REQUEST. Default: - on-demand throughput is disabled
15250
15530
  :param max_write_request_units: The maximum write request units for the global secondary index. Can only be provided if table billingMode is PAY_PER_REQUEST. Default: - on-demand throughput is disabled
15251
15531
  :param read_capacity: The read capacity for the global secondary index. Can only be provided if table billingMode is Provisioned or undefined. Default: 5
@@ -15258,11 +15538,14 @@ class GlobalSecondaryIndexProps(SecondaryIndexProps, SchemaOptions):
15258
15538
 
15259
15539
  table = dynamodb.Table(self, "Table",
15260
15540
  partition_key=dynamodb.Attribute(name="pk", type=dynamodb.AttributeType.STRING),
15261
- contributor_insights_enabled=True
15541
+ contributor_insights_specification=dynamodb.ContributorInsightsSpecification( # for a table
15542
+ enabled=True,
15543
+ mode=dynamodb.ContributorInsightsMode.THROTTLED_KEYS)
15262
15544
  )
15263
15545
 
15264
15546
  table.add_global_secondary_index(
15265
- contributor_insights_enabled=True, # for a specific global secondary index
15547
+ contributor_insights_specification=dynamodb.ContributorInsightsSpecification( # for a specific global secondary index
15548
+ enabled=True),
15266
15549
  index_name="gsi",
15267
15550
  partition_key=dynamodb.Attribute(name="pk", type=dynamodb.AttributeType.STRING)
15268
15551
  )
@@ -15271,6 +15554,8 @@ class GlobalSecondaryIndexProps(SecondaryIndexProps, SchemaOptions):
15271
15554
  partition_key = Attribute(**partition_key)
15272
15555
  if isinstance(sort_key, dict):
15273
15556
  sort_key = Attribute(**sort_key)
15557
+ if isinstance(contributor_insights_specification, dict):
15558
+ contributor_insights_specification = ContributorInsightsSpecification(**contributor_insights_specification)
15274
15559
  if isinstance(warm_throughput, dict):
15275
15560
  warm_throughput = WarmThroughput(**warm_throughput)
15276
15561
  if __debug__:
@@ -15281,6 +15566,7 @@ class GlobalSecondaryIndexProps(SecondaryIndexProps, SchemaOptions):
15281
15566
  check_type(argname="argument partition_key", value=partition_key, expected_type=type_hints["partition_key"])
15282
15567
  check_type(argname="argument sort_key", value=sort_key, expected_type=type_hints["sort_key"])
15283
15568
  check_type(argname="argument contributor_insights_enabled", value=contributor_insights_enabled, expected_type=type_hints["contributor_insights_enabled"])
15569
+ check_type(argname="argument contributor_insights_specification", value=contributor_insights_specification, expected_type=type_hints["contributor_insights_specification"])
15284
15570
  check_type(argname="argument max_read_request_units", value=max_read_request_units, expected_type=type_hints["max_read_request_units"])
15285
15571
  check_type(argname="argument max_write_request_units", value=max_write_request_units, expected_type=type_hints["max_write_request_units"])
15286
15572
  check_type(argname="argument read_capacity", value=read_capacity, expected_type=type_hints["read_capacity"])
@@ -15298,6 +15584,8 @@ class GlobalSecondaryIndexProps(SecondaryIndexProps, SchemaOptions):
15298
15584
  self._values["sort_key"] = sort_key
15299
15585
  if contributor_insights_enabled is not None:
15300
15586
  self._values["contributor_insights_enabled"] = contributor_insights_enabled
15587
+ if contributor_insights_specification is not None:
15588
+ self._values["contributor_insights_specification"] = contributor_insights_specification
15301
15589
  if max_read_request_units is not None:
15302
15590
  self._values["max_read_request_units"] = max_read_request_units
15303
15591
  if max_write_request_units is not None:
@@ -15352,13 +15640,28 @@ class GlobalSecondaryIndexProps(SecondaryIndexProps, SchemaOptions):
15352
15640
 
15353
15641
  @builtins.property
15354
15642
  def contributor_insights_enabled(self) -> typing.Optional[builtins.bool]:
15355
- '''Whether CloudWatch contributor insights is enabled for the specified global secondary index.
15643
+ '''(deprecated) Whether CloudWatch contributor insights is enabled for the specified global secondary index.
15356
15644
 
15357
15645
  :default: false
15646
+
15647
+ :deprecated: use ``contributorInsightsSpecification`` instead
15648
+
15649
+ :stability: deprecated
15358
15650
  '''
15359
15651
  result = self._values.get("contributor_insights_enabled")
15360
15652
  return typing.cast(typing.Optional[builtins.bool], result)
15361
15653
 
15654
+ @builtins.property
15655
+ def contributor_insights_specification(
15656
+ self,
15657
+ ) -> typing.Optional[ContributorInsightsSpecification]:
15658
+ '''Whether CloudWatch contributor insights is enabled and what mode is selected.
15659
+
15660
+ :default: - contributor insights is not enabled
15661
+ '''
15662
+ result = self._values.get("contributor_insights_specification")
15663
+ return typing.cast(typing.Optional[ContributorInsightsSpecification], result)
15664
+
15362
15665
  @builtins.property
15363
15666
  def max_read_request_units(self) -> typing.Optional[jsii.Number]:
15364
15667
  '''The maximum read request units for the global secondary index.
@@ -16038,6 +16341,7 @@ class OperationsMetricOptions(SystemErrorsForOperationsMetricOptions):
16038
16341
  jsii_struct_bases=[TableOptionsV2],
16039
16342
  name_mapping={
16040
16343
  "contributor_insights": "contributorInsights",
16344
+ "contributor_insights_specification": "contributorInsightsSpecification",
16041
16345
  "deletion_protection": "deletionProtection",
16042
16346
  "kinesis_stream": "kinesisStream",
16043
16347
  "point_in_time_recovery": "pointInTimeRecovery",
@@ -16056,6 +16360,7 @@ class ReplicaTableProps(TableOptionsV2):
16056
16360
  self,
16057
16361
  *,
16058
16362
  contributor_insights: typing.Optional[builtins.bool] = None,
16363
+ contributor_insights_specification: typing.Optional[typing.Union[ContributorInsightsSpecification, typing.Dict[builtins.str, typing.Any]]] = None,
16059
16364
  deletion_protection: typing.Optional[builtins.bool] = None,
16060
16365
  kinesis_stream: typing.Optional[_IStream_4e2457d2] = None,
16061
16366
  point_in_time_recovery: typing.Optional[builtins.bool] = None,
@@ -16070,7 +16375,8 @@ class ReplicaTableProps(TableOptionsV2):
16070
16375
  ) -> None:
16071
16376
  '''Properties used to configure a replica table.
16072
16377
 
16073
- :param contributor_insights: Whether CloudWatch contributor insights is enabled. Default: false
16378
+ :param contributor_insights: (deprecated) Whether CloudWatch contributor insights is enabled. Default: false
16379
+ :param contributor_insights_specification: Whether CloudWatch contributor insights is enabled and what mode is selected. Default: - contributor insights is not enabled
16074
16380
  :param deletion_protection: Whether deletion protection is enabled. Default: false
16075
16381
  :param kinesis_stream: Kinesis Data Stream to capture item level changes. Default: - no Kinesis Data Stream
16076
16382
  :param point_in_time_recovery: (deprecated) Whether point-in-time recovery is enabled. Default: false - point in time recovery is not enabled.
@@ -16100,11 +16406,14 @@ class ReplicaTableProps(TableOptionsV2):
16100
16406
 
16101
16407
  global_table.add_replica(region="us-east-2", deletion_protection=True)
16102
16408
  '''
16409
+ if isinstance(contributor_insights_specification, dict):
16410
+ contributor_insights_specification = ContributorInsightsSpecification(**contributor_insights_specification)
16103
16411
  if isinstance(point_in_time_recovery_specification, dict):
16104
16412
  point_in_time_recovery_specification = PointInTimeRecoverySpecification(**point_in_time_recovery_specification)
16105
16413
  if __debug__:
16106
16414
  type_hints = typing.get_type_hints(_typecheckingstub__7500a741eaeb840f48aaefcd8fc5fbbb8b1082165601116ca363e5ddbaa79e6f)
16107
16415
  check_type(argname="argument contributor_insights", value=contributor_insights, expected_type=type_hints["contributor_insights"])
16416
+ check_type(argname="argument contributor_insights_specification", value=contributor_insights_specification, expected_type=type_hints["contributor_insights_specification"])
16108
16417
  check_type(argname="argument deletion_protection", value=deletion_protection, expected_type=type_hints["deletion_protection"])
16109
16418
  check_type(argname="argument kinesis_stream", value=kinesis_stream, expected_type=type_hints["kinesis_stream"])
16110
16419
  check_type(argname="argument point_in_time_recovery", value=point_in_time_recovery, expected_type=type_hints["point_in_time_recovery"])
@@ -16121,6 +16430,8 @@ class ReplicaTableProps(TableOptionsV2):
16121
16430
  }
16122
16431
  if contributor_insights is not None:
16123
16432
  self._values["contributor_insights"] = contributor_insights
16433
+ if contributor_insights_specification is not None:
16434
+ self._values["contributor_insights_specification"] = contributor_insights_specification
16124
16435
  if deletion_protection is not None:
16125
16436
  self._values["deletion_protection"] = deletion_protection
16126
16437
  if kinesis_stream is not None:
@@ -16144,13 +16455,28 @@ class ReplicaTableProps(TableOptionsV2):
16144
16455
 
16145
16456
  @builtins.property
16146
16457
  def contributor_insights(self) -> typing.Optional[builtins.bool]:
16147
- '''Whether CloudWatch contributor insights is enabled.
16458
+ '''(deprecated) Whether CloudWatch contributor insights is enabled.
16148
16459
 
16149
16460
  :default: false
16461
+
16462
+ :deprecated: use ``contributorInsightsSpecification`` instead
16463
+
16464
+ :stability: deprecated
16150
16465
  '''
16151
16466
  result = self._values.get("contributor_insights")
16152
16467
  return typing.cast(typing.Optional[builtins.bool], result)
16153
16468
 
16469
+ @builtins.property
16470
+ def contributor_insights_specification(
16471
+ self,
16472
+ ) -> typing.Optional[ContributorInsightsSpecification]:
16473
+ '''Whether CloudWatch contributor insights is enabled and what mode is selected.
16474
+
16475
+ :default: - contributor insights is not enabled
16476
+ '''
16477
+ result = self._values.get("contributor_insights_specification")
16478
+ return typing.cast(typing.Optional[ContributorInsightsSpecification], result)
16479
+
16154
16480
  @builtins.property
16155
16481
  def deletion_protection(self) -> typing.Optional[builtins.bool]:
16156
16482
  '''Whether deletion protection is enabled.
@@ -16318,6 +16644,7 @@ class Table(
16318
16644
  table_name: typing.Optional[builtins.str] = None,
16319
16645
  billing_mode: typing.Optional[BillingMode] = None,
16320
16646
  contributor_insights_enabled: typing.Optional[builtins.bool] = None,
16647
+ contributor_insights_specification: typing.Optional[typing.Union[ContributorInsightsSpecification, typing.Dict[builtins.str, typing.Any]]] = None,
16321
16648
  deletion_protection: typing.Optional[builtins.bool] = None,
16322
16649
  encryption: typing.Optional[TableEncryption] = None,
16323
16650
  encryption_key: typing.Optional[_IKey_5f11635f] = None,
@@ -16348,7 +16675,8 @@ class Table(
16348
16675
  :param kinesis_stream: Kinesis Data Stream to capture item-level changes for the table. Default: - no Kinesis Data Stream
16349
16676
  :param table_name: Enforces a particular physical table name. Default:
16350
16677
  :param billing_mode: Specify how you are charged for read and write throughput and how you manage capacity. Default: PROVISIONED if ``replicationRegions`` is not specified, PAY_PER_REQUEST otherwise
16351
- :param contributor_insights_enabled: Whether CloudWatch contributor insights is enabled. Default: false
16678
+ :param contributor_insights_enabled: (deprecated) Whether CloudWatch contributor insights is enabled. Default: false
16679
+ :param contributor_insights_specification: Whether CloudWatch contributor insights is enabled and what mode is selected. Default: - contributor insights is not enabled
16352
16680
  :param deletion_protection: Enables deletion protection for the table. Default: false
16353
16681
  :param encryption: Whether server-side encryption with an AWS managed customer master key is enabled. This property cannot be set if ``serverSideEncryption`` is set. .. epigraph:: **NOTE**: if you set this to ``CUSTOMER_MANAGED`` and ``encryptionKey`` is not specified, the key that the Tablet generates for you will be created with default permissions. If you are using CDKv2, these permissions will be sufficient to enable the key for use with DynamoDB tables. If you are using CDKv1, make sure the feature flag ``@aws-cdk/aws-kms:defaultKeyPolicies`` is set to ``true`` in your ``cdk.json``. Default: - The table is encrypted with an encryption key managed by DynamoDB, and you are not charged any fee for using it.
16354
16682
  :param encryption_key: External KMS key to use for table encryption. This property can only be set if ``encryption`` is set to ``TableEncryption.CUSTOMER_MANAGED``. Default: - If ``encryption`` is set to ``TableEncryption.CUSTOMER_MANAGED`` and this property is undefined, a new KMS key will be created and associated with this table. If ``encryption`` and this property are both undefined, then the table is encrypted with an encryption key managed by DynamoDB, and you are not charged any fee for using it.
@@ -16382,6 +16710,7 @@ class Table(
16382
16710
  table_name=table_name,
16383
16711
  billing_mode=billing_mode,
16384
16712
  contributor_insights_enabled=contributor_insights_enabled,
16713
+ contributor_insights_specification=contributor_insights_specification,
16385
16714
  deletion_protection=deletion_protection,
16386
16715
  encryption=encryption,
16387
16716
  encryption_key=encryption_key,
@@ -16498,6 +16827,7 @@ class Table(
16498
16827
  self,
16499
16828
  *,
16500
16829
  contributor_insights_enabled: typing.Optional[builtins.bool] = None,
16830
+ contributor_insights_specification: typing.Optional[typing.Union[ContributorInsightsSpecification, typing.Dict[builtins.str, typing.Any]]] = None,
16501
16831
  max_read_request_units: typing.Optional[jsii.Number] = None,
16502
16832
  max_write_request_units: typing.Optional[jsii.Number] = None,
16503
16833
  read_capacity: typing.Optional[jsii.Number] = None,
@@ -16511,7 +16841,8 @@ class Table(
16511
16841
  ) -> None:
16512
16842
  '''Add a global secondary index of table.
16513
16843
 
16514
- :param contributor_insights_enabled: Whether CloudWatch contributor insights is enabled for the specified global secondary index. Default: false
16844
+ :param contributor_insights_enabled: (deprecated) Whether CloudWatch contributor insights is enabled for the specified global secondary index. Default: false
16845
+ :param contributor_insights_specification: Whether CloudWatch contributor insights is enabled and what mode is selected. Default: - contributor insights is not enabled
16515
16846
  :param max_read_request_units: The maximum read request units for the global secondary index. Can only be provided if table billingMode is PAY_PER_REQUEST. Default: - on-demand throughput is disabled
16516
16847
  :param max_write_request_units: The maximum write request units for the global secondary index. Can only be provided if table billingMode is PAY_PER_REQUEST. Default: - on-demand throughput is disabled
16517
16848
  :param read_capacity: The read capacity for the global secondary index. Can only be provided if table billingMode is Provisioned or undefined. Default: 5
@@ -16525,6 +16856,7 @@ class Table(
16525
16856
  '''
16526
16857
  props = GlobalSecondaryIndexProps(
16527
16858
  contributor_insights_enabled=contributor_insights_enabled,
16859
+ contributor_insights_specification=contributor_insights_specification,
16528
16860
  max_read_request_units=max_read_request_units,
16529
16861
  max_write_request_units=max_write_request_units,
16530
16862
  read_capacity=read_capacity,
@@ -16744,6 +17076,8 @@ __all__ = [
16744
17076
  "CfnGlobalTableProps",
16745
17077
  "CfnTable",
16746
17078
  "CfnTableProps",
17079
+ "ContributorInsightsMode",
17080
+ "ContributorInsightsSpecification",
16747
17081
  "CsvOptions",
16748
17082
  "EnableScalingProps",
16749
17083
  "GlobalSecondaryIndexProps",
@@ -17509,6 +17843,14 @@ def _typecheckingstub__0b7f8e29621d526383ce725f2daafbe00b52cfe2381995edac86b72a6
17509
17843
  """Type checking stubs"""
17510
17844
  pass
17511
17845
 
17846
+ def _typecheckingstub__656543bd456aefaef11a80dfb0950fe5597d4bc0465f2f4fdec81a81dfe7358d(
17847
+ *,
17848
+ enabled: builtins.bool,
17849
+ mode: typing.Optional[ContributorInsightsMode] = None,
17850
+ ) -> None:
17851
+ """Type checking stubs"""
17852
+ pass
17853
+
17512
17854
  def _typecheckingstub__ea195ac1b9cf7ff33466083daefb8a95f1a8ce8a200cbc595c25050dc94670eb(
17513
17855
  *,
17514
17856
  delimiter: typing.Optional[builtins.str] = None,
@@ -17637,6 +17979,7 @@ def _typecheckingstub__4073f2e85ef31d8deba5f90be11b466e4a3f1ea003482bf5c4df5706f
17637
17979
  def _typecheckingstub__eaa3a170e1978a5997011b8319bcd83bf34642dac50e342aad0705ee28b15714(
17638
17980
  *,
17639
17981
  contributor_insights: typing.Optional[builtins.bool] = None,
17982
+ contributor_insights_specification: typing.Optional[typing.Union[ContributorInsightsSpecification, typing.Dict[builtins.str, typing.Any]]] = None,
17640
17983
  max_read_request_units: typing.Optional[jsii.Number] = None,
17641
17984
  read_capacity: typing.Optional[Capacity] = None,
17642
17985
  ) -> None:
@@ -17944,6 +18287,7 @@ def _typecheckingstub__dadf5733fac70178ab246582a0b777b8c203659229753a8396594d751
17944
18287
  sort_key: typing.Optional[typing.Union[Attribute, typing.Dict[builtins.str, typing.Any]]] = None,
17945
18288
  billing_mode: typing.Optional[BillingMode] = None,
17946
18289
  contributor_insights_enabled: typing.Optional[builtins.bool] = None,
18290
+ contributor_insights_specification: typing.Optional[typing.Union[ContributorInsightsSpecification, typing.Dict[builtins.str, typing.Any]]] = None,
17947
18291
  deletion_protection: typing.Optional[builtins.bool] = None,
17948
18292
  encryption: typing.Optional[TableEncryption] = None,
17949
18293
  encryption_key: typing.Optional[_IKey_5f11635f] = None,
@@ -17971,6 +18315,7 @@ def _typecheckingstub__dadf5733fac70178ab246582a0b777b8c203659229753a8396594d751
17971
18315
  def _typecheckingstub__1b65ee3c8ef5c3b632f4d1fad233252caadaa5f607c0fd92f49b64933f1de51c(
17972
18316
  *,
17973
18317
  contributor_insights: typing.Optional[builtins.bool] = None,
18318
+ contributor_insights_specification: typing.Optional[typing.Union[ContributorInsightsSpecification, typing.Dict[builtins.str, typing.Any]]] = None,
17974
18319
  deletion_protection: typing.Optional[builtins.bool] = None,
17975
18320
  kinesis_stream: typing.Optional[_IStream_4e2457d2] = None,
17976
18321
  point_in_time_recovery: typing.Optional[builtins.bool] = None,
@@ -17988,6 +18333,7 @@ def _typecheckingstub__00475a5e14af8c4c7049089f69b3d29ad81bc91e7e1f0a5a5b7b794a5
17988
18333
  sort_key: typing.Optional[typing.Union[Attribute, typing.Dict[builtins.str, typing.Any]]] = None,
17989
18334
  billing_mode: typing.Optional[BillingMode] = None,
17990
18335
  contributor_insights_enabled: typing.Optional[builtins.bool] = None,
18336
+ contributor_insights_specification: typing.Optional[typing.Union[ContributorInsightsSpecification, typing.Dict[builtins.str, typing.Any]]] = None,
17991
18337
  deletion_protection: typing.Optional[builtins.bool] = None,
17992
18338
  encryption: typing.Optional[TableEncryption] = None,
17993
18339
  encryption_key: typing.Optional[_IKey_5f11635f] = None,
@@ -18018,6 +18364,7 @@ def _typecheckingstub__00475a5e14af8c4c7049089f69b3d29ad81bc91e7e1f0a5a5b7b794a5
18018
18364
  def _typecheckingstub__205e5df85e01c6c2d91d5922a57e3ed5903027748a8b3222622bebd1077e84ba(
18019
18365
  *,
18020
18366
  contributor_insights: typing.Optional[builtins.bool] = None,
18367
+ contributor_insights_specification: typing.Optional[typing.Union[ContributorInsightsSpecification, typing.Dict[builtins.str, typing.Any]]] = None,
18021
18368
  deletion_protection: typing.Optional[builtins.bool] = None,
18022
18369
  kinesis_stream: typing.Optional[_IStream_4e2457d2] = None,
18023
18370
  point_in_time_recovery: typing.Optional[builtins.bool] = None,
@@ -18062,6 +18409,7 @@ def _typecheckingstub__9ea47b003cdb497ff620f1410260696f97dbb2b00fa8558235f23771f
18062
18409
  warm_throughput: typing.Optional[typing.Union[WarmThroughput, typing.Dict[builtins.str, typing.Any]]] = None,
18063
18410
  witness_region: typing.Optional[builtins.str] = None,
18064
18411
  contributor_insights: typing.Optional[builtins.bool] = None,
18412
+ contributor_insights_specification: typing.Optional[typing.Union[ContributorInsightsSpecification, typing.Dict[builtins.str, typing.Any]]] = None,
18065
18413
  deletion_protection: typing.Optional[builtins.bool] = None,
18066
18414
  kinesis_stream: typing.Optional[_IStream_4e2457d2] = None,
18067
18415
  point_in_time_recovery: typing.Optional[builtins.bool] = None,
@@ -18152,6 +18500,7 @@ def _typecheckingstub__7f586bf63a567e16bde337be791f392306be66abca1c4abb791989fb9
18152
18500
  partition_key: typing.Union[Attribute, typing.Dict[builtins.str, typing.Any]],
18153
18501
  sort_key: typing.Optional[typing.Union[Attribute, typing.Dict[builtins.str, typing.Any]]] = None,
18154
18502
  contributor_insights_enabled: typing.Optional[builtins.bool] = None,
18503
+ contributor_insights_specification: typing.Optional[typing.Union[ContributorInsightsSpecification, typing.Dict[builtins.str, typing.Any]]] = None,
18155
18504
  max_read_request_units: typing.Optional[jsii.Number] = None,
18156
18505
  max_write_request_units: typing.Optional[jsii.Number] = None,
18157
18506
  read_capacity: typing.Optional[jsii.Number] = None,
@@ -18209,6 +18558,7 @@ def _typecheckingstub__323fc564f2052282a189a09de9130b5d9a855212d7bd5a514ddb98a52
18209
18558
  def _typecheckingstub__7500a741eaeb840f48aaefcd8fc5fbbb8b1082165601116ca363e5ddbaa79e6f(
18210
18559
  *,
18211
18560
  contributor_insights: typing.Optional[builtins.bool] = None,
18561
+ contributor_insights_specification: typing.Optional[typing.Union[ContributorInsightsSpecification, typing.Dict[builtins.str, typing.Any]]] = None,
18212
18562
  deletion_protection: typing.Optional[builtins.bool] = None,
18213
18563
  kinesis_stream: typing.Optional[_IStream_4e2457d2] = None,
18214
18564
  point_in_time_recovery: typing.Optional[builtins.bool] = None,
@@ -18233,6 +18583,7 @@ def _typecheckingstub__b92f0ed514f00b57a2a41d754e55fe495d22b05b0ad4711b80ce00457
18233
18583
  table_name: typing.Optional[builtins.str] = None,
18234
18584
  billing_mode: typing.Optional[BillingMode] = None,
18235
18585
  contributor_insights_enabled: typing.Optional[builtins.bool] = None,
18586
+ contributor_insights_specification: typing.Optional[typing.Union[ContributorInsightsSpecification, typing.Dict[builtins.str, typing.Any]]] = None,
18236
18587
  deletion_protection: typing.Optional[builtins.bool] = None,
18237
18588
  encryption: typing.Optional[TableEncryption] = None,
18238
18589
  encryption_key: typing.Optional[_IKey_5f11635f] = None,
@@ -7167,20 +7167,35 @@ class Effect(enum.Enum):
7167
7167
 
7168
7168
  Example::
7169
7169
 
7170
- # books: apigateway.Resource
7171
- # iam_user: iam.User
7170
+ from aws_cdk.aws_apigatewayv2_authorizers import WebSocketIamAuthorizer
7171
+ from aws_cdk.aws_apigatewayv2_integrations import WebSocketLambdaIntegration
7172
7172
 
7173
+ # This function handles your connect route
7174
+ # connect_handler: lambda.Function
7173
7175
 
7174
- get_books = books.add_method("GET", apigateway.HttpIntegration("http://amazon.com"),
7175
- authorization_type=apigateway.AuthorizationType.IAM
7176
+
7177
+ web_socket_api = apigwv2.WebSocketApi(self, "WebSocketApi")
7178
+
7179
+ web_socket_api.add_route("$connect",
7180
+ integration=WebSocketLambdaIntegration("Integration", connect_handler),
7181
+ authorizer=WebSocketIamAuthorizer()
7182
+ )
7183
+
7184
+ # Create an IAM user (identity)
7185
+ user = iam.User(self, "User")
7186
+
7187
+ web_socket_arn = Stack.of(self).format_arn(
7188
+ service="execute-api",
7189
+ resource=web_socket_api.api_id
7176
7190
  )
7177
7191
 
7178
- iam_user.attach_inline_policy(iam.Policy(self, "AllowBooks",
7192
+ # Grant access to the IAM user
7193
+ user.attach_inline_policy(iam.Policy(self, "AllowInvoke",
7179
7194
  statements=[
7180
7195
  iam.PolicyStatement(
7181
7196
  actions=["execute-api:Invoke"],
7182
7197
  effect=iam.Effect.ALLOW,
7183
- resources=[get_books.method_arn]
7198
+ resources=[web_socket_arn]
7184
7199
  )
7185
7200
  ]
7186
7201
  ))
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: aws-cdk-lib
3
- Version: 2.212.0
3
+ Version: 2.213.0
4
4
  Summary: Version 2 of the AWS Cloud Development Kit library
5
5
  Home-page: https://github.com/aws/aws-cdk
6
6
  Author: Amazon Web Services
@@ -1,7 +1,7 @@
1
1
  aws_cdk/__init__.py,sha256=btMRAIhNj7vC5KSZuChgZVKgUQSRrYzHiyWXkNPrBAk,2059512
2
2
  aws_cdk/py.typed,sha256=AbpHGcgLb-kRsJGnwFEktk7uzpZOCcBY74-YBdrKVGs,1
3
- aws_cdk/_jsii/__init__.py,sha256=FQGnpy43URtrjBLj-J7yUC1qdgqUeSb8rzjWfTbnRY0,1543
4
- aws_cdk/_jsii/aws-cdk-lib@2.212.0.jsii.tgz,sha256=jfwcVoSSq6UI6HmdTLRX3aiPGZ2TsXdARj5Np9qP_2g,26105315
3
+ aws_cdk/_jsii/__init__.py,sha256=TDLGyIywde1CUuxFNDvJJ9cSHtK-Y1P0FzBg1Gmwl4k,1543
4
+ aws_cdk/_jsii/aws-cdk-lib@2.213.0.jsii.tgz,sha256=CYeqxUYpJF0__UgitKRZcidclDyZG3S1gnL7TvtXb6c,26108496
5
5
  aws_cdk/alexa_ask/__init__.py,sha256=yF4ftch7XArzAniw_xoUmGi3wLGeBqIUlOjBTHSxDb4,36370
6
6
  aws_cdk/assertions/__init__.py,sha256=Fe7BZZpx5cUrxKtNdGbU4eXue79txDh_GqjfLV5wgCM,94355
7
7
  aws_cdk/aws_accessanalyzer/__init__.py,sha256=DUc3YNvhPHvaaAXxcjJAyWmO9wHDdiZnn2VPkI2XSEw,76243
@@ -93,7 +93,7 @@ aws_cdk/aws_dms/__init__.py,sha256=fU7yqdoaPS2ffrZJpLZIwcw_J1KSwlFr4nEXL52GZjY,1
93
93
  aws_cdk/aws_docdb/__init__.py,sha256=cY7t_NaHYrl4zUs8puZimwMEicbfPZNgK1dZUB7clVo,348022
94
94
  aws_cdk/aws_docdbelastic/__init__.py,sha256=8ULf53CjSElODf5ZegB4vP1fvBXVjZjnQOA-D976_nE,46746
95
95
  aws_cdk/aws_dsql/__init__.py,sha256=yxfIt5heoIxyipy5P3-XKb7IZu3Mvo55AMGzfjURHXg,33758
96
- aws_cdk/aws_dynamodb/__init__.py,sha256=X-LNlwBTBp3u2BS708Zt_QeWoro2N5tfyO8zgN-BooM,1075748
96
+ aws_cdk/aws_dynamodb/__init__.py,sha256=KFM3bPncNLARgWCIbVnhdPh3kFhfZbCWmp0ZPmas8K4,1097186
97
97
  aws_cdk/aws_ec2/__init__.py,sha256=q7NugIfSGhA_6ObkfCA--nCbP2NnLzf-PlyOYcHmJyk,6291155
98
98
  aws_cdk/aws_ecr/__init__.py,sha256=MwJ4QDSK8kZVk_TMwVZfpj-gHvGN98GBguKiyExyTys,352617
99
99
  aws_cdk/aws_ecr_assets/__init__.py,sha256=h-ry7VGmOgTsHSW9-BfgXOmDCk4QES88onu750Nekrg,94631
@@ -135,7 +135,7 @@ aws_cdk/aws_groundstation/__init__.py,sha256=mrEOzbCUKEJRpB7KdZxnQ6B0JGT06gm2CiX
135
135
  aws_cdk/aws_guardduty/__init__.py,sha256=HpK0Xp0ZEKHFViJWpw7Q8KsGv98niDn-FsfwuQTDw9c,315285
136
136
  aws_cdk/aws_healthimaging/__init__.py,sha256=bNpcbOhCYjvvgCJwb6pbmA8BH_8RjtjKJZG8f40I8qQ,17410
137
137
  aws_cdk/aws_healthlake/__init__.py,sha256=dMFbQBLwb5u5qcae0VijYlqI8dU47O7F4Cr7uSPqFsE,55398
138
- aws_cdk/aws_iam/__init__.py,sha256=064dV_BrWGFndfKOCl33JFPlvBGAGiCe_lVDd3glTiI,911118
138
+ aws_cdk/aws_iam/__init__.py,sha256=thUPVEKe2StlUFFBBdwxkMGUk5v9Ue8EXAokNyjLSAY,911683
139
139
  aws_cdk/aws_identitystore/__init__.py,sha256=QX4XuB89CCjpcqbydzuvldtCW7bgbK7EB4HyM5H9A90,32130
140
140
  aws_cdk/aws_imagebuilder/__init__.py,sha256=mnDjURSkgKXiJ78lUaDaxv5iAvKnnsXSCTru6a0OTe4,607273
141
141
  aws_cdk/aws_inspector/__init__.py,sha256=RJ2_brj7Rsk7MIDshhp3D3B8O33_Arw2k17eWypbTS0,52710
@@ -303,9 +303,9 @@ aws_cdk/lambda_layer_node_proxy_agent/__init__.py,sha256=ssdgQwTnWcr4HFK6euFpZ93
303
303
  aws_cdk/pipelines/__init__.py,sha256=B3zHQMnbrmzONJslo84_s4WbFcqcx-OrDt2d2t8V60E,409841
304
304
  aws_cdk/region_info/__init__.py,sha256=5GAO_ld0t-3caLW28eV9FWHMrqRq5CyV1L4pFALx9Y4,39656
305
305
  aws_cdk/triggers/__init__.py,sha256=Rd5_IJ-9VJ-qzPzLfiLVMT6WA9NqoTDukBEwIcqJXIw,126167
306
- aws_cdk_lib-2.212.0.dist-info/LICENSE,sha256=y47tc38H0C4DpGljYUZDl8XxidQjNxxGLq-K4jwv6Xc,11391
307
- aws_cdk_lib-2.212.0.dist-info/METADATA,sha256=1BQQ69BntVKoZClY_9vIthjkS2Fd19W9vxISJQod2JE,77062
308
- aws_cdk_lib-2.212.0.dist-info/NOTICE,sha256=lrDSwMl9zn-5xv2z3qp2Rw6Nm8pARejpIJ5eXzJtuQk,41177
309
- aws_cdk_lib-2.212.0.dist-info/WHEEL,sha256=iAkIy5fosb7FzIOwONchHf19Qu7_1wCWyFNR5gu9nU0,91
310
- aws_cdk_lib-2.212.0.dist-info/top_level.txt,sha256=1TALAKbuUGsMSrfKWEf268lySCmcqSEO6cDYe_XlLHM,8
311
- aws_cdk_lib-2.212.0.dist-info/RECORD,,
306
+ aws_cdk_lib-2.213.0.dist-info/LICENSE,sha256=y47tc38H0C4DpGljYUZDl8XxidQjNxxGLq-K4jwv6Xc,11391
307
+ aws_cdk_lib-2.213.0.dist-info/METADATA,sha256=V2tGYSbb7edd3feTd8f3LhFm4zlRjU3mo5rVu78bSnI,77062
308
+ aws_cdk_lib-2.213.0.dist-info/NOTICE,sha256=lrDSwMl9zn-5xv2z3qp2Rw6Nm8pARejpIJ5eXzJtuQk,41177
309
+ aws_cdk_lib-2.213.0.dist-info/WHEEL,sha256=iAkIy5fosb7FzIOwONchHf19Qu7_1wCWyFNR5gu9nU0,91
310
+ aws_cdk_lib-2.213.0.dist-info/top_level.txt,sha256=1TALAKbuUGsMSrfKWEf268lySCmcqSEO6cDYe_XlLHM,8
311
+ aws_cdk_lib-2.213.0.dist-info/RECORD,,