aws-cdk.aws-s3tables-alpha 2.212.0a0__py3-none-any.whl → 2.213.0a0__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.aws-s3tables-alpha might be problematic. Click here for more details.

@@ -156,11 +156,38 @@ encrypted_bucket_auto = TableBucket(scope, "EncryptedTableBucketAuto",
156
156
  )
157
157
  ```
158
158
 
159
+ ### Controlling Table Permissions
160
+
161
+ ```python
162
+ # Grant the principal read permissions to the table
163
+ account_id = "123456789012"
164
+ table.grant_read(iam.AccountPrincipal(account_id))
165
+
166
+ # Grant the role write permissions to the table
167
+ role = iam.Role(stack, "MyRole", assumed_by=iam.ServicePrincipal("sample"))
168
+ table.grant_write(role)
169
+
170
+ # Grant the user read and write permissions to the table
171
+ table.grant_read_write(iam.User(stack, "MyUser"))
172
+
173
+ # Grant an account permissions to the table
174
+ table.grant_read_write(iam.AccountPrincipal(account_id))
175
+
176
+ # Add custom resource policy statements
177
+ permissions = iam.PolicyStatement(
178
+ effect=iam.Effect.ALLOW,
179
+ actions=["s3tables:*"],
180
+ principals=[iam.ServicePrincipal("example.aws.internal")],
181
+ resources=["*"]
182
+ )
183
+
184
+ table.add_to_resource_policy(permissions)
185
+ ```
186
+
159
187
  ## Coming Soon
160
188
 
161
189
  L2 Construct support for:
162
190
 
163
- * Table Policy
164
191
  * KMS encryption support for Tables
165
192
  '''
166
193
  from pkgutil import extend_path
@@ -198,6 +225,7 @@ from ._jsii import *
198
225
  import aws_cdk as _aws_cdk_ceddda9d
199
226
  import aws_cdk.aws_iam as _aws_cdk_aws_iam_ceddda9d
200
227
  import aws_cdk.aws_kms as _aws_cdk_aws_kms_ceddda9d
228
+ import aws_cdk.aws_s3tables as _aws_cdk_aws_s3tables_ceddda9d
201
229
  import constructs as _constructs_77d1e7e8
202
230
 
203
231
 
@@ -407,6 +435,83 @@ class ITable(_aws_cdk_ceddda9d.IResource, typing_extensions.Protocol):
407
435
  '''
408
436
  ...
409
437
 
438
+ @jsii.member(jsii_name="addToResourcePolicy")
439
+ def add_to_resource_policy(
440
+ self,
441
+ statement: _aws_cdk_aws_iam_ceddda9d.PolicyStatement,
442
+ ) -> _aws_cdk_aws_iam_ceddda9d.AddToResourcePolicyResult:
443
+ '''(experimental) Adds a statement to the resource policy for a principal (i.e. account/role/service) to perform actions on this table.
444
+
445
+ Note that the policy statement may or may not be added to the policy.
446
+ For example, when an ``ITable`` is created from an existing table,
447
+ it's not possible to tell whether the table already has a policy
448
+ attached, let alone to re-use that policy to add more statements to it.
449
+ So it's safest to do nothing in these cases.
450
+
451
+ :param statement: the policy statement to be added to the table's policy.
452
+
453
+ :return:
454
+
455
+ metadata about the execution of this method. If the policy
456
+ was not added, the value of ``statementAdded`` will be ``false``. You
457
+ should always check this value to make sure that the operation was
458
+ actually carried out. Otherwise, synthesis and deploy will terminate
459
+ silently, which may be confusing.
460
+
461
+ :stability: experimental
462
+ '''
463
+ ...
464
+
465
+ @jsii.member(jsii_name="grantRead")
466
+ def grant_read(
467
+ self,
468
+ identity: _aws_cdk_aws_iam_ceddda9d.IGrantable,
469
+ ) -> _aws_cdk_aws_iam_ceddda9d.Grant:
470
+ '''(experimental) Grant read permissions for this table to an IAM principal (Role/Group/User).
471
+
472
+ If the parent TableBucket of this table has encryption,
473
+ you should grant kms:Decrypt permission to use this key to the same principal.
474
+
475
+ :param identity: The principal to allow read permissions to.
476
+
477
+ :stability: experimental
478
+ '''
479
+ ...
480
+
481
+ @jsii.member(jsii_name="grantReadWrite")
482
+ def grant_read_write(
483
+ self,
484
+ identity: _aws_cdk_aws_iam_ceddda9d.IGrantable,
485
+ ) -> _aws_cdk_aws_iam_ceddda9d.Grant:
486
+ '''(experimental) Grant read and write permissions for this table to an IAM principal (Role/Group/User).
487
+
488
+ If the parent TableBucket of this table has encryption,
489
+ you should grant kms:GenerateDataKey and kms:Decrypt permission
490
+ to use this key to the same principal.
491
+
492
+ :param identity: The principal to allow read and write permissions to.
493
+
494
+ :stability: experimental
495
+ '''
496
+ ...
497
+
498
+ @jsii.member(jsii_name="grantWrite")
499
+ def grant_write(
500
+ self,
501
+ identity: _aws_cdk_aws_iam_ceddda9d.IGrantable,
502
+ ) -> _aws_cdk_aws_iam_ceddda9d.Grant:
503
+ '''(experimental) Grant write permissions for this table to an IAM principal (Role/Group/User).
504
+
505
+ If the parent TableBucket of this table has encryption,
506
+ you should grant kms:GenerateDataKey and kms:Decrypt permission
507
+ to use this key to the same principal.
508
+
509
+ :param identity: The principal to allow write permissions to.
510
+
511
+ :stability: experimental
512
+ '''
513
+ ...
514
+
410
515
 
411
516
  class _ITableProxy(
412
517
  jsii.proxy_for(_aws_cdk_ceddda9d.IResource), # type: ignore[misc]
@@ -458,6 +563,95 @@ class _ITableProxy(
458
563
  '''
459
564
  return typing.cast(typing.Optional[builtins.str], jsii.get(self, "region"))
460
565
 
566
+ @jsii.member(jsii_name="addToResourcePolicy")
567
+ def add_to_resource_policy(
568
+ self,
569
+ statement: _aws_cdk_aws_iam_ceddda9d.PolicyStatement,
570
+ ) -> _aws_cdk_aws_iam_ceddda9d.AddToResourcePolicyResult:
571
+ '''(experimental) Adds a statement to the resource policy for a principal (i.e. account/role/service) to perform actions on this table.
572
+
573
+ Note that the policy statement may or may not be added to the policy.
574
+ For example, when an ``ITable`` is created from an existing table,
575
+ it's not possible to tell whether the table already has a policy
576
+ attached, let alone to re-use that policy to add more statements to it.
577
+ So it's safest to do nothing in these cases.
578
+
579
+ :param statement: the policy statement to be added to the table's policy.
580
+
581
+ :return:
582
+
583
+ metadata about the execution of this method. If the policy
584
+ was not added, the value of ``statementAdded`` will be ``false``. You
585
+ should always check this value to make sure that the operation was
586
+ actually carried out. Otherwise, synthesis and deploy will terminate
587
+ silently, which may be confusing.
588
+
589
+ :stability: experimental
590
+ '''
591
+ if __debug__:
592
+ type_hints = typing.get_type_hints(_typecheckingstub__da6cde6f4428a664d5a067b88ed42d6a9c66af2a44cb2211d25ecd28073c5cf3)
593
+ check_type(argname="argument statement", value=statement, expected_type=type_hints["statement"])
594
+ return typing.cast(_aws_cdk_aws_iam_ceddda9d.AddToResourcePolicyResult, jsii.invoke(self, "addToResourcePolicy", [statement]))
595
+
596
+ @jsii.member(jsii_name="grantRead")
597
+ def grant_read(
598
+ self,
599
+ identity: _aws_cdk_aws_iam_ceddda9d.IGrantable,
600
+ ) -> _aws_cdk_aws_iam_ceddda9d.Grant:
601
+ '''(experimental) Grant read permissions for this table to an IAM principal (Role/Group/User).
602
+
603
+ If the parent TableBucket of this table has encryption,
604
+ you should grant kms:Decrypt permission to use this key to the same principal.
605
+
606
+ :param identity: The principal to allow read permissions to.
607
+
608
+ :stability: experimental
609
+ '''
610
+ if __debug__:
611
+ type_hints = typing.get_type_hints(_typecheckingstub__3e83bfa5470edaff0a4a96df441439dc54d0e9371b70d2571426e560cb4ae2eb)
612
+ check_type(argname="argument identity", value=identity, expected_type=type_hints["identity"])
613
+ return typing.cast(_aws_cdk_aws_iam_ceddda9d.Grant, jsii.invoke(self, "grantRead", [identity]))
614
+
615
+ @jsii.member(jsii_name="grantReadWrite")
616
+ def grant_read_write(
617
+ self,
618
+ identity: _aws_cdk_aws_iam_ceddda9d.IGrantable,
619
+ ) -> _aws_cdk_aws_iam_ceddda9d.Grant:
620
+ '''(experimental) Grant read and write permissions for this table to an IAM principal (Role/Group/User).
621
+
622
+ If the parent TableBucket of this table has encryption,
623
+ you should grant kms:GenerateDataKey and kms:Decrypt permission
624
+ to use this key to the same principal.
625
+
626
+ :param identity: The principal to allow read and write permissions to.
627
+
628
+ :stability: experimental
629
+ '''
630
+ if __debug__:
631
+ type_hints = typing.get_type_hints(_typecheckingstub__6e9db385d2bd54ad234de96ad643e346812e81e4cf447d2e614c92f8ce02037d)
632
+ check_type(argname="argument identity", value=identity, expected_type=type_hints["identity"])
633
+ return typing.cast(_aws_cdk_aws_iam_ceddda9d.Grant, jsii.invoke(self, "grantReadWrite", [identity]))
634
+
635
+ @jsii.member(jsii_name="grantWrite")
636
+ def grant_write(
637
+ self,
638
+ identity: _aws_cdk_aws_iam_ceddda9d.IGrantable,
639
+ ) -> _aws_cdk_aws_iam_ceddda9d.Grant:
640
+ '''(experimental) Grant write permissions for this table to an IAM principal (Role/Group/User).
641
+
642
+ If the parent TableBucket of this table has encryption,
643
+ you should grant kms:GenerateDataKey and kms:Decrypt permission
644
+ to use this key to the same principal.
645
+
646
+ :param identity: The principal to allow write permissions to.
647
+
648
+ :stability: experimental
649
+ '''
650
+ if __debug__:
651
+ type_hints = typing.get_type_hints(_typecheckingstub__580625b8fab3a16de8ff8d5024b24a235d5bc9597470275f3fd5c04ef950a9d9)
652
+ check_type(argname="argument identity", value=identity, expected_type=type_hints["identity"])
653
+ return typing.cast(_aws_cdk_aws_iam_ceddda9d.Grant, jsii.invoke(self, "grantWrite", [identity]))
654
+
461
655
  # Adding a "__jsii_proxy_class__(): typing.Type" function to the interface
462
656
  typing.cast(typing.Any, ITable).__jsii_proxy_class__ = lambda : _ITableProxy
463
657
 
@@ -1655,6 +1849,87 @@ class Table(
1655
1849
  check_type(argname="argument table_name", value=table_name, expected_type=type_hints["table_name"])
1656
1850
  return typing.cast(None, jsii.sinvoke(cls, "validateTableName", [table_name]))
1657
1851
 
1852
+ @jsii.member(jsii_name="addToResourcePolicy")
1853
+ def add_to_resource_policy(
1854
+ self,
1855
+ statement: _aws_cdk_aws_iam_ceddda9d.PolicyStatement,
1856
+ ) -> _aws_cdk_aws_iam_ceddda9d.AddToResourcePolicyResult:
1857
+ '''(experimental) Adds a statement to the resource policy for a principal (i.e. account/role/service) to perform actions on this table.
1858
+
1859
+ Note that the policy statement may or may not be added to the policy.
1860
+ For example, when an ``ITable`` is created from an existing table,
1861
+ it's not possible to tell whether the table already has a policy
1862
+ attached, let alone to re-use that policy to add more statements to it.
1863
+ So it's safest to do nothing in these cases.
1864
+
1865
+ :param statement: -
1866
+
1867
+ :stability: experimental
1868
+ '''
1869
+ if __debug__:
1870
+ type_hints = typing.get_type_hints(_typecheckingstub__bf2cc6b0089371bf3b3d86048c16f309f2afb3d7329dc28525f622d9e8006e27)
1871
+ check_type(argname="argument statement", value=statement, expected_type=type_hints["statement"])
1872
+ return typing.cast(_aws_cdk_aws_iam_ceddda9d.AddToResourcePolicyResult, jsii.invoke(self, "addToResourcePolicy", [statement]))
1873
+
1874
+ @jsii.member(jsii_name="grantRead")
1875
+ def grant_read(
1876
+ self,
1877
+ identity: _aws_cdk_aws_iam_ceddda9d.IGrantable,
1878
+ ) -> _aws_cdk_aws_iam_ceddda9d.Grant:
1879
+ '''(experimental) Grant read permissions for this table to an IAM principal (Role/Group/User).
1880
+
1881
+ If the parent TableBucket of this table has encryption,
1882
+ you should grant kms:Decrypt permission to use this key to the same principal.
1883
+
1884
+ :param identity: -
1885
+
1886
+ :stability: experimental
1887
+ '''
1888
+ if __debug__:
1889
+ type_hints = typing.get_type_hints(_typecheckingstub__f0556fb0bd61a76d9f9bdbab13c49228511a3523caa64f6dbed93963966ed96c)
1890
+ check_type(argname="argument identity", value=identity, expected_type=type_hints["identity"])
1891
+ return typing.cast(_aws_cdk_aws_iam_ceddda9d.Grant, jsii.invoke(self, "grantRead", [identity]))
1892
+
1893
+ @jsii.member(jsii_name="grantReadWrite")
1894
+ def grant_read_write(
1895
+ self,
1896
+ identity: _aws_cdk_aws_iam_ceddda9d.IGrantable,
1897
+ ) -> _aws_cdk_aws_iam_ceddda9d.Grant:
1898
+ '''(experimental) Grant read and write permissions for this table to an IAM principal (Role/Group/User).
1899
+
1900
+ If the parent TableBucket of this table has encryption,
1901
+ you should grant kms:GenerateDataKey and kms:Decrypt permission
1902
+ to use this key to the same principal.
1903
+
1904
+ :param identity: -
1905
+
1906
+ :stability: experimental
1907
+ '''
1908
+ if __debug__:
1909
+ type_hints = typing.get_type_hints(_typecheckingstub__f751d804f7db1fb6bfea578e65d8642e7c39a6078f8effb3cc12bd1d6e5cdd45)
1910
+ check_type(argname="argument identity", value=identity, expected_type=type_hints["identity"])
1911
+ return typing.cast(_aws_cdk_aws_iam_ceddda9d.Grant, jsii.invoke(self, "grantReadWrite", [identity]))
1912
+
1913
+ @jsii.member(jsii_name="grantWrite")
1914
+ def grant_write(
1915
+ self,
1916
+ identity: _aws_cdk_aws_iam_ceddda9d.IGrantable,
1917
+ ) -> _aws_cdk_aws_iam_ceddda9d.Grant:
1918
+ '''(experimental) Grant write permissions for this table to an IAM principal (Role/Group/User).
1919
+
1920
+ If the parent TableBucket of this table has encryption,
1921
+ you should grant kms:GenerateDataKey and kms:Decrypt permission
1922
+ to use this key to the same principal.
1923
+
1924
+ :param identity: -
1925
+
1926
+ :stability: experimental
1927
+ '''
1928
+ if __debug__:
1929
+ type_hints = typing.get_type_hints(_typecheckingstub__782a3a885790eb02b5e9bbd37dd4b038ae3f5d0bdcf890b812c9284899e029ce)
1930
+ check_type(argname="argument identity", value=identity, expected_type=type_hints["identity"])
1931
+ return typing.cast(_aws_cdk_aws_iam_ceddda9d.Grant, jsii.invoke(self, "grantWrite", [identity]))
1932
+
1658
1933
  @jsii.python.classproperty
1659
1934
  @jsii.member(jsii_name="PROPERTY_INJECTION_ID")
1660
1935
  def PROPERTY_INJECTION_ID(cls) -> builtins.str:
@@ -1691,6 +1966,33 @@ class Table(
1691
1966
  '''
1692
1967
  return typing.cast(builtins.str, jsii.get(self, "tableName"))
1693
1968
 
1969
+ @builtins.property
1970
+ @jsii.member(jsii_name="tablePolicy")
1971
+ def table_policy(
1972
+ self,
1973
+ ) -> typing.Optional[_aws_cdk_aws_s3tables_ceddda9d.CfnTablePolicy]:
1974
+ '''(experimental) The resource policy for this table.
1975
+
1976
+ :stability: experimental
1977
+ '''
1978
+ return typing.cast(typing.Optional[_aws_cdk_aws_s3tables_ceddda9d.CfnTablePolicy], jsii.get(self, "tablePolicy"))
1979
+
1980
+ @builtins.property
1981
+ @jsii.member(jsii_name="autoCreatePolicy")
1982
+ def _auto_create_policy(self) -> builtins.bool:
1983
+ '''(experimental) Indicates if a table resource policy should automatically created upon the first call to ``addToResourcePolicy``.
1984
+
1985
+ :stability: experimental
1986
+ '''
1987
+ return typing.cast(builtins.bool, jsii.get(self, "autoCreatePolicy"))
1988
+
1989
+ @_auto_create_policy.setter
1990
+ def _auto_create_policy(self, value: builtins.bool) -> None:
1991
+ if __debug__:
1992
+ type_hints = typing.get_type_hints(_typecheckingstub__cc8c67ff83da04c70c080f40fd29333e2e8cae2c2f37dd6606ad76db5c4cc5d7)
1993
+ check_type(argname="argument value", value=value, expected_type=type_hints["value"])
1994
+ jsii.set(self, "autoCreatePolicy", value) # pyright: ignore[reportArgumentType]
1995
+
1694
1996
 
1695
1997
  @jsii.data_type(
1696
1998
  jsii_type="@aws-cdk/aws-s3tables-alpha.TableAttributes",
@@ -2632,6 +2934,190 @@ class TableBucketProps:
2632
2934
  )
2633
2935
 
2634
2936
 
2937
+ class TablePolicy(
2938
+ _aws_cdk_ceddda9d.Resource,
2939
+ metaclass=jsii.JSIIMeta,
2940
+ jsii_type="@aws-cdk/aws-s3tables-alpha.TablePolicy",
2941
+ ):
2942
+ '''(experimental) A Policy for S3 Tables.
2943
+
2944
+ You will almost never need to use this construct directly.
2945
+ Instead, Table.addToResourcePolicy can be used to add more policies to your table directly
2946
+
2947
+ :stability: experimental
2948
+ :exampleMetadata: fixture=_generated
2949
+
2950
+ Example::
2951
+
2952
+ # The code below shows an example of how to instantiate this type.
2953
+ # The values are placeholders you should change.
2954
+ import aws_cdk.aws_s3tables_alpha as s3tables_alpha
2955
+ import aws_cdk as cdk
2956
+ from aws_cdk import aws_iam as iam
2957
+
2958
+ # policy_document: iam.PolicyDocument
2959
+ # table: s3tables_alpha.Table
2960
+
2961
+ table_policy = s3tables_alpha.TablePolicy(self, "MyTablePolicy",
2962
+ table=table,
2963
+
2964
+ # the properties below are optional
2965
+ removal_policy=cdk.RemovalPolicy.DESTROY,
2966
+ resource_policy=policy_document
2967
+ )
2968
+ '''
2969
+
2970
+ def __init__(
2971
+ self,
2972
+ scope: _constructs_77d1e7e8.Construct,
2973
+ id: builtins.str,
2974
+ *,
2975
+ table: ITable,
2976
+ removal_policy: typing.Optional[_aws_cdk_ceddda9d.RemovalPolicy] = None,
2977
+ resource_policy: typing.Optional[_aws_cdk_aws_iam_ceddda9d.PolicyDocument] = None,
2978
+ ) -> None:
2979
+ '''
2980
+ :param scope: -
2981
+ :param id: -
2982
+ :param table: (experimental) The associated table.
2983
+ :param removal_policy: (experimental) Policy to apply when the policy is removed from this stack. Default: - RemovalPolicy.DESTROY.
2984
+ :param resource_policy: (experimental) The policy document for the table's resource policy. Default: undefined An empty iam.PolicyDocument will be initialized
2985
+
2986
+ :stability: experimental
2987
+ '''
2988
+ if __debug__:
2989
+ type_hints = typing.get_type_hints(_typecheckingstub__8b78bf56e8d94ea2b7e7602cfb78ea18ec614a55b94a18e39d69bd1c23964cf8)
2990
+ check_type(argname="argument scope", value=scope, expected_type=type_hints["scope"])
2991
+ check_type(argname="argument id", value=id, expected_type=type_hints["id"])
2992
+ props = TablePolicyProps(
2993
+ table=table, removal_policy=removal_policy, resource_policy=resource_policy
2994
+ )
2995
+
2996
+ jsii.create(self.__class__, self, [scope, id, props])
2997
+
2998
+ @jsii.python.classproperty
2999
+ @jsii.member(jsii_name="PROPERTY_INJECTION_ID")
3000
+ def PROPERTY_INJECTION_ID(cls) -> builtins.str:
3001
+ '''(experimental) Uniquely identifies this class.
3002
+
3003
+ :stability: experimental
3004
+ '''
3005
+ return typing.cast(builtins.str, jsii.sget(cls, "PROPERTY_INJECTION_ID"))
3006
+
3007
+ @builtins.property
3008
+ @jsii.member(jsii_name="document")
3009
+ def document(self) -> _aws_cdk_aws_iam_ceddda9d.PolicyDocument:
3010
+ '''(experimental) The IAM PolicyDocument containing permissions represented by this policy.
3011
+
3012
+ :stability: experimental
3013
+ '''
3014
+ return typing.cast(_aws_cdk_aws_iam_ceddda9d.PolicyDocument, jsii.get(self, "document"))
3015
+
3016
+
3017
+ @jsii.data_type(
3018
+ jsii_type="@aws-cdk/aws-s3tables-alpha.TablePolicyProps",
3019
+ jsii_struct_bases=[],
3020
+ name_mapping={
3021
+ "table": "table",
3022
+ "removal_policy": "removalPolicy",
3023
+ "resource_policy": "resourcePolicy",
3024
+ },
3025
+ )
3026
+ class TablePolicyProps:
3027
+ def __init__(
3028
+ self,
3029
+ *,
3030
+ table: ITable,
3031
+ removal_policy: typing.Optional[_aws_cdk_ceddda9d.RemovalPolicy] = None,
3032
+ resource_policy: typing.Optional[_aws_cdk_aws_iam_ceddda9d.PolicyDocument] = None,
3033
+ ) -> None:
3034
+ '''(experimental) Parameters for constructing a TablePolicy.
3035
+
3036
+ :param table: (experimental) The associated table.
3037
+ :param removal_policy: (experimental) Policy to apply when the policy is removed from this stack. Default: - RemovalPolicy.DESTROY.
3038
+ :param resource_policy: (experimental) The policy document for the table's resource policy. Default: undefined An empty iam.PolicyDocument will be initialized
3039
+
3040
+ :stability: experimental
3041
+ :exampleMetadata: fixture=_generated
3042
+
3043
+ Example::
3044
+
3045
+ # The code below shows an example of how to instantiate this type.
3046
+ # The values are placeholders you should change.
3047
+ import aws_cdk.aws_s3tables_alpha as s3tables_alpha
3048
+ import aws_cdk as cdk
3049
+ from aws_cdk import aws_iam as iam
3050
+
3051
+ # policy_document: iam.PolicyDocument
3052
+ # table: s3tables_alpha.Table
3053
+
3054
+ table_policy_props = s3tables_alpha.TablePolicyProps(
3055
+ table=table,
3056
+
3057
+ # the properties below are optional
3058
+ removal_policy=cdk.RemovalPolicy.DESTROY,
3059
+ resource_policy=policy_document
3060
+ )
3061
+ '''
3062
+ if __debug__:
3063
+ type_hints = typing.get_type_hints(_typecheckingstub__b086238e24aebc145195c4cca70cd83d65abedf1539c0b11b96843994c862fb8)
3064
+ check_type(argname="argument table", value=table, expected_type=type_hints["table"])
3065
+ check_type(argname="argument removal_policy", value=removal_policy, expected_type=type_hints["removal_policy"])
3066
+ check_type(argname="argument resource_policy", value=resource_policy, expected_type=type_hints["resource_policy"])
3067
+ self._values: typing.Dict[builtins.str, typing.Any] = {
3068
+ "table": table,
3069
+ }
3070
+ if removal_policy is not None:
3071
+ self._values["removal_policy"] = removal_policy
3072
+ if resource_policy is not None:
3073
+ self._values["resource_policy"] = resource_policy
3074
+
3075
+ @builtins.property
3076
+ def table(self) -> ITable:
3077
+ '''(experimental) The associated table.
3078
+
3079
+ :stability: experimental
3080
+ '''
3081
+ result = self._values.get("table")
3082
+ assert result is not None, "Required property 'table' is missing"
3083
+ return typing.cast(ITable, result)
3084
+
3085
+ @builtins.property
3086
+ def removal_policy(self) -> typing.Optional[_aws_cdk_ceddda9d.RemovalPolicy]:
3087
+ '''(experimental) Policy to apply when the policy is removed from this stack.
3088
+
3089
+ :default: - RemovalPolicy.DESTROY.
3090
+
3091
+ :stability: experimental
3092
+ '''
3093
+ result = self._values.get("removal_policy")
3094
+ return typing.cast(typing.Optional[_aws_cdk_ceddda9d.RemovalPolicy], result)
3095
+
3096
+ @builtins.property
3097
+ def resource_policy(
3098
+ self,
3099
+ ) -> typing.Optional[_aws_cdk_aws_iam_ceddda9d.PolicyDocument]:
3100
+ '''(experimental) The policy document for the table's resource policy.
3101
+
3102
+ :default: undefined An empty iam.PolicyDocument will be initialized
3103
+
3104
+ :stability: experimental
3105
+ '''
3106
+ result = self._values.get("resource_policy")
3107
+ return typing.cast(typing.Optional[_aws_cdk_aws_iam_ceddda9d.PolicyDocument], result)
3108
+
3109
+ def __eq__(self, rhs: typing.Any) -> builtins.bool:
3110
+ return isinstance(rhs, self.__class__) and rhs._values == self._values
3111
+
3112
+ def __ne__(self, rhs: typing.Any) -> builtins.bool:
3113
+ return not (rhs == self)
3114
+
3115
+ def __repr__(self) -> str:
3116
+ return "TablePolicyProps(%s)" % ", ".join(
3117
+ k + "=" + repr(v) for k, v in self._values.items()
3118
+ )
3119
+
3120
+
2635
3121
  @jsii.data_type(
2636
3122
  jsii_type="@aws-cdk/aws-s3tables-alpha.TableProps",
2637
3123
  jsii_struct_bases=[],
@@ -3007,6 +3493,8 @@ __all__ = [
3007
3493
  "TableBucketPolicy",
3008
3494
  "TableBucketPolicyProps",
3009
3495
  "TableBucketProps",
3496
+ "TablePolicy",
3497
+ "TablePolicyProps",
3010
3498
  "TableProps",
3011
3499
  "UnreferencedFileRemoval",
3012
3500
  "UnreferencedFileRemovalStatus",
@@ -3022,6 +3510,30 @@ def _typecheckingstub__ea606cde59917b73fdb198d73eabdbbe686fdbd73e01ef72284a9061e
3022
3510
  """Type checking stubs"""
3023
3511
  pass
3024
3512
 
3513
+ def _typecheckingstub__da6cde6f4428a664d5a067b88ed42d6a9c66af2a44cb2211d25ecd28073c5cf3(
3514
+ statement: _aws_cdk_aws_iam_ceddda9d.PolicyStatement,
3515
+ ) -> None:
3516
+ """Type checking stubs"""
3517
+ pass
3518
+
3519
+ def _typecheckingstub__3e83bfa5470edaff0a4a96df441439dc54d0e9371b70d2571426e560cb4ae2eb(
3520
+ identity: _aws_cdk_aws_iam_ceddda9d.IGrantable,
3521
+ ) -> None:
3522
+ """Type checking stubs"""
3523
+ pass
3524
+
3525
+ def _typecheckingstub__6e9db385d2bd54ad234de96ad643e346812e81e4cf447d2e614c92f8ce02037d(
3526
+ identity: _aws_cdk_aws_iam_ceddda9d.IGrantable,
3527
+ ) -> None:
3528
+ """Type checking stubs"""
3529
+ pass
3530
+
3531
+ def _typecheckingstub__580625b8fab3a16de8ff8d5024b24a235d5bc9597470275f3fd5c04ef950a9d9(
3532
+ identity: _aws_cdk_aws_iam_ceddda9d.IGrantable,
3533
+ ) -> None:
3534
+ """Type checking stubs"""
3535
+ pass
3536
+
3025
3537
  def _typecheckingstub__a7c10542c60e15926bb4ef59925c4f6c0878400e041897780edddaa65054d627(
3026
3538
  statement: _aws_cdk_aws_iam_ceddda9d.PolicyStatement,
3027
3539
  ) -> None:
@@ -3157,6 +3669,36 @@ def _typecheckingstub__536e137c7e7454507b9ec796514d014c3913e8c528dfeba351b5e0e36
3157
3669
  """Type checking stubs"""
3158
3670
  pass
3159
3671
 
3672
+ def _typecheckingstub__bf2cc6b0089371bf3b3d86048c16f309f2afb3d7329dc28525f622d9e8006e27(
3673
+ statement: _aws_cdk_aws_iam_ceddda9d.PolicyStatement,
3674
+ ) -> None:
3675
+ """Type checking stubs"""
3676
+ pass
3677
+
3678
+ def _typecheckingstub__f0556fb0bd61a76d9f9bdbab13c49228511a3523caa64f6dbed93963966ed96c(
3679
+ identity: _aws_cdk_aws_iam_ceddda9d.IGrantable,
3680
+ ) -> None:
3681
+ """Type checking stubs"""
3682
+ pass
3683
+
3684
+ def _typecheckingstub__f751d804f7db1fb6bfea578e65d8642e7c39a6078f8effb3cc12bd1d6e5cdd45(
3685
+ identity: _aws_cdk_aws_iam_ceddda9d.IGrantable,
3686
+ ) -> None:
3687
+ """Type checking stubs"""
3688
+ pass
3689
+
3690
+ def _typecheckingstub__782a3a885790eb02b5e9bbd37dd4b038ae3f5d0bdcf890b812c9284899e029ce(
3691
+ identity: _aws_cdk_aws_iam_ceddda9d.IGrantable,
3692
+ ) -> None:
3693
+ """Type checking stubs"""
3694
+ pass
3695
+
3696
+ def _typecheckingstub__cc8c67ff83da04c70c080f40fd29333e2e8cae2c2f37dd6606ad76db5c4cc5d7(
3697
+ value: builtins.bool,
3698
+ ) -> None:
3699
+ """Type checking stubs"""
3700
+ pass
3701
+
3160
3702
  def _typecheckingstub__20a648b98b2aa2a4eec0f744feac0d8ec3ee06e18fb2a623e889d224bf8fec03(
3161
3703
  *,
3162
3704
  table_arn: builtins.str,
@@ -3284,6 +3826,26 @@ def _typecheckingstub__aa14ccf904c2576c446af7122d6335d3a92b012274a231120ab28c942
3284
3826
  """Type checking stubs"""
3285
3827
  pass
3286
3828
 
3829
+ def _typecheckingstub__8b78bf56e8d94ea2b7e7602cfb78ea18ec614a55b94a18e39d69bd1c23964cf8(
3830
+ scope: _constructs_77d1e7e8.Construct,
3831
+ id: builtins.str,
3832
+ *,
3833
+ table: ITable,
3834
+ removal_policy: typing.Optional[_aws_cdk_ceddda9d.RemovalPolicy] = None,
3835
+ resource_policy: typing.Optional[_aws_cdk_aws_iam_ceddda9d.PolicyDocument] = None,
3836
+ ) -> None:
3837
+ """Type checking stubs"""
3838
+ pass
3839
+
3840
+ def _typecheckingstub__b086238e24aebc145195c4cca70cd83d65abedf1539c0b11b96843994c862fb8(
3841
+ *,
3842
+ table: ITable,
3843
+ removal_policy: typing.Optional[_aws_cdk_ceddda9d.RemovalPolicy] = None,
3844
+ resource_policy: typing.Optional[_aws_cdk_aws_iam_ceddda9d.PolicyDocument] = None,
3845
+ ) -> None:
3846
+ """Type checking stubs"""
3847
+ pass
3848
+
3287
3849
  def _typecheckingstub__adbbcc05d3dc39dfd296a872f006be429c733d0afc6f602e57bd2bede716f05e(
3288
3850
  *,
3289
3851
  namespace: INamespace,
@@ -33,9 +33,9 @@ import constructs._jsii
33
33
 
34
34
  __jsii_assembly__ = jsii.JSIIAssembly.load(
35
35
  "@aws-cdk/aws-s3tables-alpha",
36
- "2.212.0-alpha.0",
36
+ "2.213.0-alpha.0",
37
37
  __name__[0:-6],
38
- "aws-s3tables-alpha@2.212.0-alpha.0.jsii.tgz",
38
+ "aws-s3tables-alpha@2.213.0-alpha.0.jsii.tgz",
39
39
  )
40
40
 
41
41
  __all__ = [
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: aws-cdk.aws-s3tables-alpha
3
- Version: 2.212.0a0
3
+ Version: 2.213.0a0
4
4
  Summary: CDK Constructs for S3 Tables
5
5
  Home-page: https://github.com/aws/aws-cdk
6
6
  Author: Amazon Web Services
@@ -22,7 +22,7 @@ Requires-Python: ~=3.9
22
22
  Description-Content-Type: text/markdown
23
23
  License-File: LICENSE
24
24
  License-File: NOTICE
25
- Requires-Dist: aws-cdk-lib <3.0.0,>=2.212.0
25
+ Requires-Dist: aws-cdk-lib <3.0.0,>=2.213.0
26
26
  Requires-Dist: constructs <11.0.0,>=10.0.0
27
27
  Requires-Dist: jsii <2.0.0,>=1.113.0
28
28
  Requires-Dist: publication >=0.0.3
@@ -185,9 +185,36 @@ encrypted_bucket_auto = TableBucket(scope, "EncryptedTableBucketAuto",
185
185
  )
186
186
  ```
187
187
 
188
+ ### Controlling Table Permissions
189
+
190
+ ```python
191
+ # Grant the principal read permissions to the table
192
+ account_id = "123456789012"
193
+ table.grant_read(iam.AccountPrincipal(account_id))
194
+
195
+ # Grant the role write permissions to the table
196
+ role = iam.Role(stack, "MyRole", assumed_by=iam.ServicePrincipal("sample"))
197
+ table.grant_write(role)
198
+
199
+ # Grant the user read and write permissions to the table
200
+ table.grant_read_write(iam.User(stack, "MyUser"))
201
+
202
+ # Grant an account permissions to the table
203
+ table.grant_read_write(iam.AccountPrincipal(account_id))
204
+
205
+ # Add custom resource policy statements
206
+ permissions = iam.PolicyStatement(
207
+ effect=iam.Effect.ALLOW,
208
+ actions=["s3tables:*"],
209
+ principals=[iam.ServicePrincipal("example.aws.internal")],
210
+ resources=["*"]
211
+ )
212
+
213
+ table.add_to_resource_policy(permissions)
214
+ ```
215
+
188
216
  ## Coming Soon
189
217
 
190
218
  L2 Construct support for:
191
219
 
192
- * Table Policy
193
220
  * KMS encryption support for Tables
@@ -0,0 +1,10 @@
1
+ aws_cdk/aws_s3tables_alpha/__init__.py,sha256=HBYS-WiHLol69mRGqPrLIuVmn4gbDPTlIeNUUfZcofo,157772
2
+ aws_cdk/aws_s3tables_alpha/py.typed,sha256=AbpHGcgLb-kRsJGnwFEktk7uzpZOCcBY74-YBdrKVGs,1
3
+ aws_cdk/aws_s3tables_alpha/_jsii/__init__.py,sha256=BPv-B-K9JbimVrJR2hjQdOf5F_oGzn85v_4lhooyCjc,1489
4
+ aws_cdk/aws_s3tables_alpha/_jsii/aws-s3tables-alpha@2.213.0-alpha.0.jsii.tgz,sha256=3d4sz_06Ixkwi9Oq2HjL2fkHSLgR2ihMS9WZBJKZb5s,88857
5
+ aws_cdk_aws_s3tables_alpha-2.213.0a0.dist-info/LICENSE,sha256=y47tc38H0C4DpGljYUZDl8XxidQjNxxGLq-K4jwv6Xc,11391
6
+ aws_cdk_aws_s3tables_alpha-2.213.0a0.dist-info/METADATA,sha256=zSb_F12LibvCNuML8J7uv-UOErq_mL7hjpromuvYChY,7238
7
+ aws_cdk_aws_s3tables_alpha-2.213.0a0.dist-info/NOTICE,sha256=ZDV6_xBfMvhFtjjBh_f6lJjhZ2AEWWAGGkx2kLKHiuc,113
8
+ aws_cdk_aws_s3tables_alpha-2.213.0a0.dist-info/WHEEL,sha256=iAkIy5fosb7FzIOwONchHf19Qu7_1wCWyFNR5gu9nU0,91
9
+ aws_cdk_aws_s3tables_alpha-2.213.0a0.dist-info/top_level.txt,sha256=1TALAKbuUGsMSrfKWEf268lySCmcqSEO6cDYe_XlLHM,8
10
+ aws_cdk_aws_s3tables_alpha-2.213.0a0.dist-info/RECORD,,
@@ -1,10 +0,0 @@
1
- aws_cdk/aws_s3tables_alpha/__init__.py,sha256=QmCNmghPpBAzY8ACPD6zOLII25mW9ZCFp_EebGnR8Vs,134643
2
- aws_cdk/aws_s3tables_alpha/py.typed,sha256=AbpHGcgLb-kRsJGnwFEktk7uzpZOCcBY74-YBdrKVGs,1
3
- aws_cdk/aws_s3tables_alpha/_jsii/__init__.py,sha256=zDvEZ9WaGAQbxl5VqvFxD5v5W0VTMkRp_Ag-pHeKGPc,1489
4
- aws_cdk/aws_s3tables_alpha/_jsii/aws-s3tables-alpha@2.212.0-alpha.0.jsii.tgz,sha256=ldEWmK__oZzpHNLKY0karAGE7N_VUGVBdZrmfp4DyXE,81240
5
- aws_cdk_aws_s3tables_alpha-2.212.0a0.dist-info/LICENSE,sha256=y47tc38H0C4DpGljYUZDl8XxidQjNxxGLq-K4jwv6Xc,11391
6
- aws_cdk_aws_s3tables_alpha-2.212.0a0.dist-info/METADATA,sha256=UZCQ1YTOyzbxv9CM_22fMIhnLqGvYkyYEpxn31JjsUA,6452
7
- aws_cdk_aws_s3tables_alpha-2.212.0a0.dist-info/NOTICE,sha256=ZDV6_xBfMvhFtjjBh_f6lJjhZ2AEWWAGGkx2kLKHiuc,113
8
- aws_cdk_aws_s3tables_alpha-2.212.0a0.dist-info/WHEEL,sha256=iAkIy5fosb7FzIOwONchHf19Qu7_1wCWyFNR5gu9nU0,91
9
- aws_cdk_aws_s3tables_alpha-2.212.0a0.dist-info/top_level.txt,sha256=1TALAKbuUGsMSrfKWEf268lySCmcqSEO6cDYe_XlLHM,8
10
- aws_cdk_aws_s3tables_alpha-2.212.0a0.dist-info/RECORD,,