aws-cdk.aws-s3tables-alpha 2.190.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.

@@ -0,0 +1,1397 @@
1
+ r'''
2
+ # Amazon S3 Tables Construct Library
3
+
4
+ <!--BEGIN STABILITY BANNER-->---
5
+
6
+
7
+ ![cdk-constructs: Experimental](https://img.shields.io/badge/cdk--constructs-experimental-important.svg?style=for-the-badge)
8
+
9
+ > The APIs of higher level constructs in this module are experimental and under active development.
10
+ > They are subject to non-backward compatible changes or removal in any future version. These are
11
+ > not subject to the [Semantic Versioning](https://semver.org/) model and breaking changes will be
12
+ > announced in the release notes. This means that while you may use them, you may need to update
13
+ > your source code when upgrading to a newer version of this package.
14
+
15
+ ---
16
+ <!--END STABILITY BANNER-->
17
+
18
+ ## Amazon S3 Tables
19
+
20
+ Amazon S3 Tables deliver the first cloud object store with built-in Apache Iceberg support and streamline storing tabular data at scale.
21
+
22
+ [Product Page](https://aws.amazon.com/s3/features/tables/) | [User Guide](https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-tables.html)
23
+
24
+ ## Usage
25
+
26
+ ### Define an S3 Table Bucket
27
+
28
+ ```python
29
+ # Build a Table bucket
30
+ sample_table_bucket = TableBucket(scope, "ExampleTableBucket",
31
+ table_bucket_name="example-bucket-1",
32
+ # optional fields:
33
+ unreferenced_file_removal=UnreferencedFileRemoval(
34
+ status=UnreferencedFileRemovalStatus.ENABLED,
35
+ noncurrent_days=20,
36
+ unreferenced_days=20
37
+ )
38
+ )
39
+ ```
40
+
41
+ Learn more about table buckets maintenance operations and default behavior from the [S3 Tables User Guide](https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-table-buckets-maintenance.html)
42
+
43
+ ### Controlling Table Bucket Permissions
44
+
45
+ ```python
46
+ # Grant the principal read permissions to the bucket and all tables within
47
+ account_id = "123456789012"
48
+ table_bucket.grant_read(iam.AccountPrincipal(account_id), "*")
49
+ # Grant the role write permissions to the bucket and all tables within
50
+ role = iam.Role(stack, "MyRole", assumed_by=iam.ServicePrincipal("sample"))
51
+ table_bucket.grant_write(role, "*")
52
+ # Grant the user read and write permissions to the bucket and all tables within
53
+ table_bucket.grant_read_write(iam.User(stack, "MyUser"), "*")
54
+
55
+ # Grant permissions to the bucket and a particular table within it
56
+ table_id = "6ba046b2-26de-44cf-9144-0c7862593a7b"
57
+ table_bucket.grant_read_write(iam.AccountPrincipal(account_id), table_id)
58
+
59
+ # Add custom resource policy statements
60
+ permissions = iam.PolicyStatement(
61
+ effect=iam.Effect.ALLOW,
62
+ actions=["s3tables:*"],
63
+ principals=[iam.ServicePrincipal("example.aws.internal")],
64
+ resources=["*"]
65
+ )
66
+
67
+ table_bucket.add_to_resource_policy(permissions)
68
+ ```
69
+
70
+ ## Coming Soon
71
+
72
+ L2 Construct support for:
73
+
74
+ * Namespaces
75
+ * Tables
76
+ '''
77
+ from pkgutil import extend_path
78
+ __path__ = extend_path(__path__, __name__)
79
+
80
+ import abc
81
+ import builtins
82
+ import datetime
83
+ import enum
84
+ import typing
85
+
86
+ import jsii
87
+ import publication
88
+ import typing_extensions
89
+
90
+ import typeguard
91
+ from importlib.metadata import version as _metadata_package_version
92
+ TYPEGUARD_MAJOR_VERSION = int(_metadata_package_version('typeguard').split('.')[0])
93
+
94
+ def check_type(argname: str, value: object, expected_type: typing.Any) -> typing.Any:
95
+ if TYPEGUARD_MAJOR_VERSION <= 2:
96
+ return typeguard.check_type(argname=argname, value=value, expected_type=expected_type) # type:ignore
97
+ else:
98
+ if isinstance(value, jsii._reference_map.InterfaceDynamicProxy): # pyright: ignore [reportAttributeAccessIssue]
99
+ pass
100
+ else:
101
+ if TYPEGUARD_MAJOR_VERSION == 3:
102
+ typeguard.config.collection_check_strategy = typeguard.CollectionCheckStrategy.ALL_ITEMS # type:ignore
103
+ typeguard.check_type(value=value, expected_type=expected_type) # type:ignore
104
+ else:
105
+ typeguard.check_type(value=value, expected_type=expected_type, collection_check_strategy=typeguard.CollectionCheckStrategy.ALL_ITEMS) # type:ignore
106
+
107
+ from ._jsii import *
108
+
109
+ import aws_cdk as _aws_cdk_ceddda9d
110
+ import aws_cdk.aws_iam as _aws_cdk_aws_iam_ceddda9d
111
+ import constructs as _constructs_77d1e7e8
112
+
113
+
114
+ @jsii.interface(jsii_type="@aws-cdk/aws-s3tables-alpha.ITableBucket")
115
+ class ITableBucket(_aws_cdk_ceddda9d.IResource, typing_extensions.Protocol):
116
+ '''(experimental) Interface definition for S3 Table Buckets.
117
+
118
+ :stability: experimental
119
+ '''
120
+
121
+ @builtins.property
122
+ @jsii.member(jsii_name="tableBucketArn")
123
+ def table_bucket_arn(self) -> builtins.str:
124
+ '''(experimental) The ARN of the table bucket.
125
+
126
+ :stability: experimental
127
+ :attribute: true
128
+ '''
129
+ ...
130
+
131
+ @builtins.property
132
+ @jsii.member(jsii_name="tableBucketName")
133
+ def table_bucket_name(self) -> builtins.str:
134
+ '''(experimental) The name of the table bucket.
135
+
136
+ :stability: experimental
137
+ :attribute: true
138
+ '''
139
+ ...
140
+
141
+ @builtins.property
142
+ @jsii.member(jsii_name="account")
143
+ def account(self) -> typing.Optional[builtins.str]:
144
+ '''(experimental) The accountId containing the table bucket.
145
+
146
+ :stability: experimental
147
+ :attribute: true
148
+ '''
149
+ ...
150
+
151
+ @builtins.property
152
+ @jsii.member(jsii_name="region")
153
+ def region(self) -> typing.Optional[builtins.str]:
154
+ '''(experimental) The region containing the table bucket.
155
+
156
+ :stability: experimental
157
+ :attribute: true
158
+ '''
159
+ ...
160
+
161
+ @jsii.member(jsii_name="addToResourcePolicy")
162
+ def add_to_resource_policy(
163
+ self,
164
+ statement: _aws_cdk_aws_iam_ceddda9d.PolicyStatement,
165
+ ) -> _aws_cdk_aws_iam_ceddda9d.AddToResourcePolicyResult:
166
+ '''(experimental) Adds a statement to the resource policy for a principal (i.e. account/role/service) to perform actions on this table bucket and/or its contents. Use ``tableBucketArn`` and ``arnForObjects(keys)`` to obtain ARNs for this bucket or objects.
167
+
168
+ Note that the policy statement may or may not be added to the policy.
169
+ For example, when an ``ITableBucket`` is created from an existing table bucket,
170
+ it's not possible to tell whether the bucket already has a policy
171
+ attached, let alone to re-use that policy to add more statements to it.
172
+ So it's safest to do nothing in these cases.
173
+
174
+ :param statement: the policy statement to be added to the bucket's policy.
175
+
176
+ :return:
177
+
178
+ metadata about the execution of this method. If the policy
179
+ was not added, the value of ``statementAdded`` will be ``false``. You
180
+ should always check this value to make sure that the operation was
181
+ actually carried out. Otherwise, synthesis and deploy will terminate
182
+ silently, which may be confusing.
183
+
184
+ :stability: experimental
185
+ '''
186
+ ...
187
+
188
+ @jsii.member(jsii_name="grantRead")
189
+ def grant_read(
190
+ self,
191
+ identity: _aws_cdk_aws_iam_ceddda9d.IGrantable,
192
+ table_id: builtins.str,
193
+ ) -> _aws_cdk_aws_iam_ceddda9d.Grant:
194
+ '''(experimental) Grant read permissions for this table bucket and its tables to an IAM principal (Role/Group/User).
195
+
196
+ :param identity: The principal to allow read permissions to.
197
+ :param table_id: Allow the permissions to all tables using '*' or to single table by its unique ID.
198
+
199
+ :stability: experimental
200
+ '''
201
+ ...
202
+
203
+ @jsii.member(jsii_name="grantReadWrite")
204
+ def grant_read_write(
205
+ self,
206
+ identity: _aws_cdk_aws_iam_ceddda9d.IGrantable,
207
+ table_id: builtins.str,
208
+ ) -> _aws_cdk_aws_iam_ceddda9d.Grant:
209
+ '''(experimental) Grant read and write permissions for this table bucket and its tables to an IAM principal (Role/Group/User).
210
+
211
+ :param identity: The principal to allow read and write permissions to.
212
+ :param table_id: Allow the permissions to all tables using '*' or to single table by its unique ID.
213
+
214
+ :stability: experimental
215
+ '''
216
+ ...
217
+
218
+ @jsii.member(jsii_name="grantWrite")
219
+ def grant_write(
220
+ self,
221
+ identity: _aws_cdk_aws_iam_ceddda9d.IGrantable,
222
+ table_id: builtins.str,
223
+ ) -> _aws_cdk_aws_iam_ceddda9d.Grant:
224
+ '''(experimental) Grant write permissions for this table bucket and its tables to an IAM principal (Role/Group/User).
225
+
226
+ :param identity: The principal to allow write permissions to.
227
+ :param table_id: Allow the permissions to all tables using '*' or to single table by its unique ID.
228
+
229
+ :stability: experimental
230
+ '''
231
+ ...
232
+
233
+
234
+ class _ITableBucketProxy(
235
+ jsii.proxy_for(_aws_cdk_ceddda9d.IResource), # type: ignore[misc]
236
+ ):
237
+ '''(experimental) Interface definition for S3 Table Buckets.
238
+
239
+ :stability: experimental
240
+ '''
241
+
242
+ __jsii_type__: typing.ClassVar[str] = "@aws-cdk/aws-s3tables-alpha.ITableBucket"
243
+
244
+ @builtins.property
245
+ @jsii.member(jsii_name="tableBucketArn")
246
+ def table_bucket_arn(self) -> builtins.str:
247
+ '''(experimental) The ARN of the table bucket.
248
+
249
+ :stability: experimental
250
+ :attribute: true
251
+ '''
252
+ return typing.cast(builtins.str, jsii.get(self, "tableBucketArn"))
253
+
254
+ @builtins.property
255
+ @jsii.member(jsii_name="tableBucketName")
256
+ def table_bucket_name(self) -> builtins.str:
257
+ '''(experimental) The name of the table bucket.
258
+
259
+ :stability: experimental
260
+ :attribute: true
261
+ '''
262
+ return typing.cast(builtins.str, jsii.get(self, "tableBucketName"))
263
+
264
+ @builtins.property
265
+ @jsii.member(jsii_name="account")
266
+ def account(self) -> typing.Optional[builtins.str]:
267
+ '''(experimental) The accountId containing the table bucket.
268
+
269
+ :stability: experimental
270
+ :attribute: true
271
+ '''
272
+ return typing.cast(typing.Optional[builtins.str], jsii.get(self, "account"))
273
+
274
+ @builtins.property
275
+ @jsii.member(jsii_name="region")
276
+ def region(self) -> typing.Optional[builtins.str]:
277
+ '''(experimental) The region containing the table bucket.
278
+
279
+ :stability: experimental
280
+ :attribute: true
281
+ '''
282
+ return typing.cast(typing.Optional[builtins.str], jsii.get(self, "region"))
283
+
284
+ @jsii.member(jsii_name="addToResourcePolicy")
285
+ def add_to_resource_policy(
286
+ self,
287
+ statement: _aws_cdk_aws_iam_ceddda9d.PolicyStatement,
288
+ ) -> _aws_cdk_aws_iam_ceddda9d.AddToResourcePolicyResult:
289
+ '''(experimental) Adds a statement to the resource policy for a principal (i.e. account/role/service) to perform actions on this table bucket and/or its contents. Use ``tableBucketArn`` and ``arnForObjects(keys)`` to obtain ARNs for this bucket or objects.
290
+
291
+ Note that the policy statement may or may not be added to the policy.
292
+ For example, when an ``ITableBucket`` is created from an existing table bucket,
293
+ it's not possible to tell whether the bucket already has a policy
294
+ attached, let alone to re-use that policy to add more statements to it.
295
+ So it's safest to do nothing in these cases.
296
+
297
+ :param statement: the policy statement to be added to the bucket's policy.
298
+
299
+ :return:
300
+
301
+ metadata about the execution of this method. If the policy
302
+ was not added, the value of ``statementAdded`` will be ``false``. You
303
+ should always check this value to make sure that the operation was
304
+ actually carried out. Otherwise, synthesis and deploy will terminate
305
+ silently, which may be confusing.
306
+
307
+ :stability: experimental
308
+ '''
309
+ if __debug__:
310
+ type_hints = typing.get_type_hints(_typecheckingstub__a7c10542c60e15926bb4ef59925c4f6c0878400e041897780edddaa65054d627)
311
+ check_type(argname="argument statement", value=statement, expected_type=type_hints["statement"])
312
+ return typing.cast(_aws_cdk_aws_iam_ceddda9d.AddToResourcePolicyResult, jsii.invoke(self, "addToResourcePolicy", [statement]))
313
+
314
+ @jsii.member(jsii_name="grantRead")
315
+ def grant_read(
316
+ self,
317
+ identity: _aws_cdk_aws_iam_ceddda9d.IGrantable,
318
+ table_id: builtins.str,
319
+ ) -> _aws_cdk_aws_iam_ceddda9d.Grant:
320
+ '''(experimental) Grant read permissions for this table bucket and its tables to an IAM principal (Role/Group/User).
321
+
322
+ :param identity: The principal to allow read permissions to.
323
+ :param table_id: Allow the permissions to all tables using '*' or to single table by its unique ID.
324
+
325
+ :stability: experimental
326
+ '''
327
+ if __debug__:
328
+ type_hints = typing.get_type_hints(_typecheckingstub__853d3e698d103ae1fe304d2239745ee798278fcd22f673c7ae8e9b33884c90a9)
329
+ check_type(argname="argument identity", value=identity, expected_type=type_hints["identity"])
330
+ check_type(argname="argument table_id", value=table_id, expected_type=type_hints["table_id"])
331
+ return typing.cast(_aws_cdk_aws_iam_ceddda9d.Grant, jsii.invoke(self, "grantRead", [identity, table_id]))
332
+
333
+ @jsii.member(jsii_name="grantReadWrite")
334
+ def grant_read_write(
335
+ self,
336
+ identity: _aws_cdk_aws_iam_ceddda9d.IGrantable,
337
+ table_id: builtins.str,
338
+ ) -> _aws_cdk_aws_iam_ceddda9d.Grant:
339
+ '''(experimental) Grant read and write permissions for this table bucket and its tables to an IAM principal (Role/Group/User).
340
+
341
+ :param identity: The principal to allow read and write permissions to.
342
+ :param table_id: Allow the permissions to all tables using '*' or to single table by its unique ID.
343
+
344
+ :stability: experimental
345
+ '''
346
+ if __debug__:
347
+ type_hints = typing.get_type_hints(_typecheckingstub__1c9eb5186509f26b2c015223d6e2614c16cc34d5c2608ca3903b133360e23990)
348
+ check_type(argname="argument identity", value=identity, expected_type=type_hints["identity"])
349
+ check_type(argname="argument table_id", value=table_id, expected_type=type_hints["table_id"])
350
+ return typing.cast(_aws_cdk_aws_iam_ceddda9d.Grant, jsii.invoke(self, "grantReadWrite", [identity, table_id]))
351
+
352
+ @jsii.member(jsii_name="grantWrite")
353
+ def grant_write(
354
+ self,
355
+ identity: _aws_cdk_aws_iam_ceddda9d.IGrantable,
356
+ table_id: builtins.str,
357
+ ) -> _aws_cdk_aws_iam_ceddda9d.Grant:
358
+ '''(experimental) Grant write permissions for this table bucket and its tables to an IAM principal (Role/Group/User).
359
+
360
+ :param identity: The principal to allow write permissions to.
361
+ :param table_id: Allow the permissions to all tables using '*' or to single table by its unique ID.
362
+
363
+ :stability: experimental
364
+ '''
365
+ if __debug__:
366
+ type_hints = typing.get_type_hints(_typecheckingstub__65fa831e505e76e1fe23a8a8d8ce97bb97ebff683edbf67f37020df64c040fdb)
367
+ check_type(argname="argument identity", value=identity, expected_type=type_hints["identity"])
368
+ check_type(argname="argument table_id", value=table_id, expected_type=type_hints["table_id"])
369
+ return typing.cast(_aws_cdk_aws_iam_ceddda9d.Grant, jsii.invoke(self, "grantWrite", [identity, table_id]))
370
+
371
+ # Adding a "__jsii_proxy_class__(): typing.Type" function to the interface
372
+ typing.cast(typing.Any, ITableBucket).__jsii_proxy_class__ = lambda : _ITableBucketProxy
373
+
374
+
375
+ @jsii.implements(ITableBucket)
376
+ class TableBucket(
377
+ _aws_cdk_ceddda9d.Resource,
378
+ metaclass=jsii.JSIIMeta,
379
+ jsii_type="@aws-cdk/aws-s3tables-alpha.TableBucket",
380
+ ):
381
+ '''(experimental) An S3 table bucket with helpers for associated resource policies.
382
+
383
+ This bucket may not yet have all features that exposed by the underlying CfnTableBucket.
384
+
385
+ :stability: experimental
386
+ :stateful: true
387
+
388
+ Example::
389
+
390
+ sample_table_bucket = TableBucket(scope, "ExampleTableBucket",
391
+ table_bucket_name="example-bucket",
392
+ # Optional fields:
393
+ unreferenced_file_removal=UnreferencedFileRemoval(
394
+ noncurrent_days=123,
395
+ status=UnreferencedFileRemovalStatus.ENABLED,
396
+ unreferenced_days=123
397
+ )
398
+ )
399
+ '''
400
+
401
+ def __init__(
402
+ self,
403
+ scope: _constructs_77d1e7e8.Construct,
404
+ id: builtins.str,
405
+ *,
406
+ table_bucket_name: builtins.str,
407
+ account: typing.Optional[builtins.str] = None,
408
+ region: typing.Optional[builtins.str] = None,
409
+ removal_policy: typing.Optional[_aws_cdk_ceddda9d.RemovalPolicy] = None,
410
+ unreferenced_file_removal: typing.Optional[typing.Union["UnreferencedFileRemoval", typing.Dict[builtins.str, typing.Any]]] = None,
411
+ ) -> None:
412
+ '''
413
+ :param scope: -
414
+ :param id: -
415
+ :param table_bucket_name: (experimental) Name of the S3 TableBucket.
416
+ :param account: (experimental) AWS Account ID of the table bucket owner. Default: - it's assumed the bucket belongs to the same account as the scope it's being imported into
417
+ :param region: (experimental) AWS region that the table bucket exists in. Default: - it's assumed the bucket is in the same region as the scope it's being imported into
418
+ :param removal_policy: (experimental) Controls what happens to this table bucket it it stoped being managed by cloudformation. Default: RETAIN
419
+ :param unreferenced_file_removal: (experimental) Unreferenced file removal settings for the S3 TableBucket. Default: Enabled with default values
420
+
421
+ :stability: experimental
422
+ '''
423
+ if __debug__:
424
+ type_hints = typing.get_type_hints(_typecheckingstub__c8d9c0bf5c954c2a6797301b7dc6cb8abd812336f3507addc92f72b805ec0a1e)
425
+ check_type(argname="argument scope", value=scope, expected_type=type_hints["scope"])
426
+ check_type(argname="argument id", value=id, expected_type=type_hints["id"])
427
+ props = TableBucketProps(
428
+ table_bucket_name=table_bucket_name,
429
+ account=account,
430
+ region=region,
431
+ removal_policy=removal_policy,
432
+ unreferenced_file_removal=unreferenced_file_removal,
433
+ )
434
+
435
+ jsii.create(self.__class__, self, [scope, id, props])
436
+
437
+ @jsii.member(jsii_name="fromTableBucketArn")
438
+ @builtins.classmethod
439
+ def from_table_bucket_arn(
440
+ cls,
441
+ scope: _constructs_77d1e7e8.Construct,
442
+ id: builtins.str,
443
+ table_bucket_arn: builtins.str,
444
+ ) -> ITableBucket:
445
+ '''(experimental) Defines a TableBucket construct from an external table bucket ARN.
446
+
447
+ :param scope: The parent creating construct (usually ``this``).
448
+ :param id: The construct's name.
449
+ :param table_bucket_arn: Amazon Resource Name (arn) of the table bucket.
450
+
451
+ :stability: experimental
452
+ '''
453
+ if __debug__:
454
+ type_hints = typing.get_type_hints(_typecheckingstub__03d844a802df53acfc8906e32d1d2bbab0d86fedd5fc2ef65296a8c7a0c368d5)
455
+ check_type(argname="argument scope", value=scope, expected_type=type_hints["scope"])
456
+ check_type(argname="argument id", value=id, expected_type=type_hints["id"])
457
+ check_type(argname="argument table_bucket_arn", value=table_bucket_arn, expected_type=type_hints["table_bucket_arn"])
458
+ return typing.cast(ITableBucket, jsii.sinvoke(cls, "fromTableBucketArn", [scope, id, table_bucket_arn]))
459
+
460
+ @jsii.member(jsii_name="fromTableBucketAttributes")
461
+ @builtins.classmethod
462
+ def from_table_bucket_attributes(
463
+ cls,
464
+ scope: _constructs_77d1e7e8.Construct,
465
+ id: builtins.str,
466
+ *,
467
+ account: typing.Optional[builtins.str] = None,
468
+ region: typing.Optional[builtins.str] = None,
469
+ table_bucket_arn: typing.Optional[builtins.str] = None,
470
+ table_bucket_name: typing.Optional[builtins.str] = None,
471
+ ) -> ITableBucket:
472
+ '''(experimental) Defines a TableBucket construct that represents an external table bucket.
473
+
474
+ :param scope: The parent creating construct (usually ``this``).
475
+ :param id: The construct's name.
476
+ :param account: (experimental) The accountId containing this table bucket. Default: account inferred from scope
477
+ :param region: (experimental) AWS region this table bucket exists in. Default: region inferred from scope
478
+ :param table_bucket_arn: (experimental) The table bucket's ARN. Default: tableBucketArn constructed from region, account and tableBucketName are provided
479
+ :param table_bucket_name: (experimental) The table bucket name, unique per region. Default: tableBucketName inferred from arn
480
+
481
+ :stability: experimental
482
+ '''
483
+ if __debug__:
484
+ type_hints = typing.get_type_hints(_typecheckingstub__6fd93d11fc9c336a7e785b6aaa945ba1d55d75eb3748b03a2030b08e3d152961)
485
+ check_type(argname="argument scope", value=scope, expected_type=type_hints["scope"])
486
+ check_type(argname="argument id", value=id, expected_type=type_hints["id"])
487
+ attrs = TableBucketAttributes(
488
+ account=account,
489
+ region=region,
490
+ table_bucket_arn=table_bucket_arn,
491
+ table_bucket_name=table_bucket_name,
492
+ )
493
+
494
+ return typing.cast(ITableBucket, jsii.sinvoke(cls, "fromTableBucketAttributes", [scope, id, attrs]))
495
+
496
+ @jsii.member(jsii_name="validateTableBucketName")
497
+ @builtins.classmethod
498
+ def validate_table_bucket_name(
499
+ cls,
500
+ bucket_name: typing.Optional[builtins.str] = None,
501
+ ) -> None:
502
+ '''(experimental) Throws an exception if the given table bucket name is not valid.
503
+
504
+ :param bucket_name: name of the bucket.
505
+
506
+ :stability: experimental
507
+ '''
508
+ if __debug__:
509
+ type_hints = typing.get_type_hints(_typecheckingstub__054bf3ff46c98611841750ec27c0d492c7ee0aa6480b03f4a250c1d73bf049f7)
510
+ check_type(argname="argument bucket_name", value=bucket_name, expected_type=type_hints["bucket_name"])
511
+ return typing.cast(None, jsii.sinvoke(cls, "validateTableBucketName", [bucket_name]))
512
+
513
+ @jsii.member(jsii_name="validateUnreferencedFileRemoval")
514
+ @builtins.classmethod
515
+ def validate_unreferenced_file_removal(
516
+ cls,
517
+ *,
518
+ noncurrent_days: typing.Optional[jsii.Number] = None,
519
+ status: typing.Optional["UnreferencedFileRemovalStatus"] = None,
520
+ unreferenced_days: typing.Optional[jsii.Number] = None,
521
+ ) -> None:
522
+ '''(experimental) Throws an exception if the given unreferencedFileRemovalProperty is not valid.
523
+
524
+ :param noncurrent_days: (experimental) Duration after which noncurrent files should be removed. Should be at least one day. Default: - See S3 Tables User Guide
525
+ :param status: (experimental) Status of unreferenced file removal. Can be Enabled or Disabled. Default: - See S3 Tables User Guide
526
+ :param unreferenced_days: (experimental) Duration after which unreferenced files should be removed. Should be at least one day. Default: - See S3 Tables User Guide
527
+
528
+ :stability: experimental
529
+ '''
530
+ unreferenced_file_removal = UnreferencedFileRemoval(
531
+ noncurrent_days=noncurrent_days,
532
+ status=status,
533
+ unreferenced_days=unreferenced_days,
534
+ )
535
+
536
+ return typing.cast(None, jsii.sinvoke(cls, "validateUnreferencedFileRemoval", [unreferenced_file_removal]))
537
+
538
+ @jsii.member(jsii_name="addToResourcePolicy")
539
+ def add_to_resource_policy(
540
+ self,
541
+ statement: _aws_cdk_aws_iam_ceddda9d.PolicyStatement,
542
+ ) -> _aws_cdk_aws_iam_ceddda9d.AddToResourcePolicyResult:
543
+ '''(experimental) Adds a statement to the resource policy for a principal (i.e. account/role/service) to perform actions on this table bucket and/or its contents. Use ``tableBucketArn`` and ``arnForObjects(keys)`` to obtain ARNs for this bucket or objects.
544
+
545
+ Note that the policy statement may or may not be added to the policy.
546
+ For example, when an ``ITableBucket`` is created from an existing table bucket,
547
+ it's not possible to tell whether the bucket already has a policy
548
+ attached, let alone to re-use that policy to add more statements to it.
549
+ So it's safest to do nothing in these cases.
550
+
551
+ :param statement: the policy statement to be added to the bucket's policy.
552
+
553
+ :return:
554
+
555
+ metadata about the execution of this method. If the policy
556
+ was not added, the value of ``statementAdded`` will be ``false``. You
557
+ should always check this value to make sure that the operation was
558
+ actually carried out. Otherwise, synthesis and deploy will terminate
559
+ silently, which may be confusing.
560
+
561
+ :stability: experimental
562
+ '''
563
+ if __debug__:
564
+ type_hints = typing.get_type_hints(_typecheckingstub__51cd52e5dbcb37ec9f9fd146daf9705f341ba8056f0f9d812355dc6e0ec273cd)
565
+ check_type(argname="argument statement", value=statement, expected_type=type_hints["statement"])
566
+ return typing.cast(_aws_cdk_aws_iam_ceddda9d.AddToResourcePolicyResult, jsii.invoke(self, "addToResourcePolicy", [statement]))
567
+
568
+ @jsii.member(jsii_name="grantRead")
569
+ def grant_read(
570
+ self,
571
+ identity: _aws_cdk_aws_iam_ceddda9d.IGrantable,
572
+ table_id: builtins.str,
573
+ ) -> _aws_cdk_aws_iam_ceddda9d.Grant:
574
+ '''(experimental) Grant read permissions for this table bucket and its tables to an IAM principal (Role/Group/User).
575
+
576
+ :param identity: -
577
+ :param table_id: -
578
+
579
+ :stability: experimental
580
+ '''
581
+ if __debug__:
582
+ type_hints = typing.get_type_hints(_typecheckingstub__fecb8141f36793842f11c48ee39490301f24e6f1f0de09abbbf16bf1f96f0cb3)
583
+ check_type(argname="argument identity", value=identity, expected_type=type_hints["identity"])
584
+ check_type(argname="argument table_id", value=table_id, expected_type=type_hints["table_id"])
585
+ return typing.cast(_aws_cdk_aws_iam_ceddda9d.Grant, jsii.invoke(self, "grantRead", [identity, table_id]))
586
+
587
+ @jsii.member(jsii_name="grantReadWrite")
588
+ def grant_read_write(
589
+ self,
590
+ identity: _aws_cdk_aws_iam_ceddda9d.IGrantable,
591
+ table_id: builtins.str,
592
+ ) -> _aws_cdk_aws_iam_ceddda9d.Grant:
593
+ '''(experimental) Grant read and write permissions for this table bucket and its tables to an IAM principal (Role/Group/User).
594
+
595
+ :param identity: -
596
+ :param table_id: -
597
+
598
+ :stability: experimental
599
+ '''
600
+ if __debug__:
601
+ type_hints = typing.get_type_hints(_typecheckingstub__cd8d4708cc079743c68f1ed7c239ba7a268460ad7ce4e417684326708cd34a54)
602
+ check_type(argname="argument identity", value=identity, expected_type=type_hints["identity"])
603
+ check_type(argname="argument table_id", value=table_id, expected_type=type_hints["table_id"])
604
+ return typing.cast(_aws_cdk_aws_iam_ceddda9d.Grant, jsii.invoke(self, "grantReadWrite", [identity, table_id]))
605
+
606
+ @jsii.member(jsii_name="grantWrite")
607
+ def grant_write(
608
+ self,
609
+ identity: _aws_cdk_aws_iam_ceddda9d.IGrantable,
610
+ table_id: builtins.str,
611
+ ) -> _aws_cdk_aws_iam_ceddda9d.Grant:
612
+ '''(experimental) Grant write permissions for this table bucket and its tables to an IAM principal (Role/Group/User).
613
+
614
+ :param identity: -
615
+ :param table_id: -
616
+
617
+ :stability: experimental
618
+ '''
619
+ if __debug__:
620
+ type_hints = typing.get_type_hints(_typecheckingstub__6f9476ce4489c94b0b073d56ebee26cf1a8f5db20184e82de18e7238c0381b9a)
621
+ check_type(argname="argument identity", value=identity, expected_type=type_hints["identity"])
622
+ check_type(argname="argument table_id", value=table_id, expected_type=type_hints["table_id"])
623
+ return typing.cast(_aws_cdk_aws_iam_ceddda9d.Grant, jsii.invoke(self, "grantWrite", [identity, table_id]))
624
+
625
+ @builtins.property
626
+ @jsii.member(jsii_name="tableBucketArn")
627
+ def table_bucket_arn(self) -> builtins.str:
628
+ '''(experimental) The unique Amazon Resource Name (arn) of this table bucket.
629
+
630
+ :stability: experimental
631
+ '''
632
+ return typing.cast(builtins.str, jsii.get(self, "tableBucketArn"))
633
+
634
+ @builtins.property
635
+ @jsii.member(jsii_name="tableBucketName")
636
+ def table_bucket_name(self) -> builtins.str:
637
+ '''(experimental) The name of this table bucket.
638
+
639
+ :stability: experimental
640
+ '''
641
+ return typing.cast(builtins.str, jsii.get(self, "tableBucketName"))
642
+
643
+ @builtins.property
644
+ @jsii.member(jsii_name="tableBucketPolicy")
645
+ def table_bucket_policy(self) -> typing.Optional["TableBucketPolicy"]:
646
+ '''(experimental) The resource policy for this tableBucket.
647
+
648
+ :stability: experimental
649
+ '''
650
+ return typing.cast(typing.Optional["TableBucketPolicy"], jsii.get(self, "tableBucketPolicy"))
651
+
652
+ @builtins.property
653
+ @jsii.member(jsii_name="autoCreatePolicy")
654
+ def _auto_create_policy(self) -> builtins.bool:
655
+ '''(experimental) Indicates if a table bucket resource policy should automatically created upon the first call to ``addToResourcePolicy``.
656
+
657
+ :stability: experimental
658
+ '''
659
+ return typing.cast(builtins.bool, jsii.get(self, "autoCreatePolicy"))
660
+
661
+ @_auto_create_policy.setter
662
+ def _auto_create_policy(self, value: builtins.bool) -> None:
663
+ if __debug__:
664
+ type_hints = typing.get_type_hints(_typecheckingstub__ddda0c30ebb465614a7378f709964b48c9f175013aa1ed12f0ea7c1218e8c630)
665
+ check_type(argname="argument value", value=value, expected_type=type_hints["value"])
666
+ jsii.set(self, "autoCreatePolicy", value) # pyright: ignore[reportArgumentType]
667
+
668
+
669
+ @jsii.data_type(
670
+ jsii_type="@aws-cdk/aws-s3tables-alpha.TableBucketAttributes",
671
+ jsii_struct_bases=[],
672
+ name_mapping={
673
+ "account": "account",
674
+ "region": "region",
675
+ "table_bucket_arn": "tableBucketArn",
676
+ "table_bucket_name": "tableBucketName",
677
+ },
678
+ )
679
+ class TableBucketAttributes:
680
+ def __init__(
681
+ self,
682
+ *,
683
+ account: typing.Optional[builtins.str] = None,
684
+ region: typing.Optional[builtins.str] = None,
685
+ table_bucket_arn: typing.Optional[builtins.str] = None,
686
+ table_bucket_name: typing.Optional[builtins.str] = None,
687
+ ) -> None:
688
+ '''(experimental) Everything needed to reference a specific table bucket.
689
+
690
+ The tableBucketName, region, and account can be provided explicitly
691
+ or will be inferred from the tableBucketArn
692
+
693
+ :param account: (experimental) The accountId containing this table bucket. Default: account inferred from scope
694
+ :param region: (experimental) AWS region this table bucket exists in. Default: region inferred from scope
695
+ :param table_bucket_arn: (experimental) The table bucket's ARN. Default: tableBucketArn constructed from region, account and tableBucketName are provided
696
+ :param table_bucket_name: (experimental) The table bucket name, unique per region. Default: tableBucketName inferred from arn
697
+
698
+ :stability: experimental
699
+ :exampleMetadata: fixture=_generated
700
+
701
+ Example::
702
+
703
+ # The code below shows an example of how to instantiate this type.
704
+ # The values are placeholders you should change.
705
+ import aws_cdk.aws_s3tables_alpha as s3tables_alpha
706
+
707
+ table_bucket_attributes = s3tables_alpha.TableBucketAttributes(
708
+ account="account",
709
+ region="region",
710
+ table_bucket_arn="tableBucketArn",
711
+ table_bucket_name="tableBucketName"
712
+ )
713
+ '''
714
+ if __debug__:
715
+ type_hints = typing.get_type_hints(_typecheckingstub__f628073bbee2e81e2162c5225d2230a24b470a8915e2ee4cef917951de644d61)
716
+ check_type(argname="argument account", value=account, expected_type=type_hints["account"])
717
+ check_type(argname="argument region", value=region, expected_type=type_hints["region"])
718
+ check_type(argname="argument table_bucket_arn", value=table_bucket_arn, expected_type=type_hints["table_bucket_arn"])
719
+ check_type(argname="argument table_bucket_name", value=table_bucket_name, expected_type=type_hints["table_bucket_name"])
720
+ self._values: typing.Dict[builtins.str, typing.Any] = {}
721
+ if account is not None:
722
+ self._values["account"] = account
723
+ if region is not None:
724
+ self._values["region"] = region
725
+ if table_bucket_arn is not None:
726
+ self._values["table_bucket_arn"] = table_bucket_arn
727
+ if table_bucket_name is not None:
728
+ self._values["table_bucket_name"] = table_bucket_name
729
+
730
+ @builtins.property
731
+ def account(self) -> typing.Optional[builtins.str]:
732
+ '''(experimental) The accountId containing this table bucket.
733
+
734
+ :default: account inferred from scope
735
+
736
+ :stability: experimental
737
+ '''
738
+ result = self._values.get("account")
739
+ return typing.cast(typing.Optional[builtins.str], result)
740
+
741
+ @builtins.property
742
+ def region(self) -> typing.Optional[builtins.str]:
743
+ '''(experimental) AWS region this table bucket exists in.
744
+
745
+ :default: region inferred from scope
746
+
747
+ :stability: experimental
748
+ '''
749
+ result = self._values.get("region")
750
+ return typing.cast(typing.Optional[builtins.str], result)
751
+
752
+ @builtins.property
753
+ def table_bucket_arn(self) -> typing.Optional[builtins.str]:
754
+ '''(experimental) The table bucket's ARN.
755
+
756
+ :default: tableBucketArn constructed from region, account and tableBucketName are provided
757
+
758
+ :stability: experimental
759
+ '''
760
+ result = self._values.get("table_bucket_arn")
761
+ return typing.cast(typing.Optional[builtins.str], result)
762
+
763
+ @builtins.property
764
+ def table_bucket_name(self) -> typing.Optional[builtins.str]:
765
+ '''(experimental) The table bucket name, unique per region.
766
+
767
+ :default: tableBucketName inferred from arn
768
+
769
+ :stability: experimental
770
+ '''
771
+ result = self._values.get("table_bucket_name")
772
+ return typing.cast(typing.Optional[builtins.str], result)
773
+
774
+ def __eq__(self, rhs: typing.Any) -> builtins.bool:
775
+ return isinstance(rhs, self.__class__) and rhs._values == self._values
776
+
777
+ def __ne__(self, rhs: typing.Any) -> builtins.bool:
778
+ return not (rhs == self)
779
+
780
+ def __repr__(self) -> str:
781
+ return "TableBucketAttributes(%s)" % ", ".join(
782
+ k + "=" + repr(v) for k, v in self._values.items()
783
+ )
784
+
785
+
786
+ class TableBucketPolicy(
787
+ _aws_cdk_ceddda9d.Resource,
788
+ metaclass=jsii.JSIIMeta,
789
+ jsii_type="@aws-cdk/aws-s3tables-alpha.TableBucketPolicy",
790
+ ):
791
+ '''(experimental) A Bucket Policy for S3 TableBuckets.
792
+
793
+ You will almost never need to use this construct directly.
794
+ Instead, TableBucket.addToResourcePolicy can be used to add more policies to your bucket directly
795
+
796
+ :stability: experimental
797
+ :exampleMetadata: fixture=_generated
798
+
799
+ Example::
800
+
801
+ # The code below shows an example of how to instantiate this type.
802
+ # The values are placeholders you should change.
803
+ import aws_cdk.aws_s3tables_alpha as s3tables_alpha
804
+ import aws_cdk as cdk
805
+ from aws_cdk import aws_iam as iam
806
+
807
+ # policy_document: iam.PolicyDocument
808
+ # table_bucket: s3tables_alpha.TableBucket
809
+
810
+ table_bucket_policy = s3tables_alpha.TableBucketPolicy(self, "MyTableBucketPolicy",
811
+ table_bucket=table_bucket,
812
+
813
+ # the properties below are optional
814
+ removal_policy=cdk.RemovalPolicy.DESTROY,
815
+ resource_policy=policy_document
816
+ )
817
+ '''
818
+
819
+ def __init__(
820
+ self,
821
+ scope: _constructs_77d1e7e8.Construct,
822
+ id: builtins.str,
823
+ *,
824
+ table_bucket: ITableBucket,
825
+ removal_policy: typing.Optional[_aws_cdk_ceddda9d.RemovalPolicy] = None,
826
+ resource_policy: typing.Optional[_aws_cdk_aws_iam_ceddda9d.PolicyDocument] = None,
827
+ ) -> None:
828
+ '''
829
+ :param scope: -
830
+ :param id: -
831
+ :param table_bucket: (experimental) The associated table bucket.
832
+ :param removal_policy: (experimental) Policy to apply when the policy is removed from this stack. Default: - RemovalPolicy.DESTROY.
833
+ :param resource_policy: (experimental) The policy document for the bucket's resource policy. Default: undefined An empty iam.PolicyDocument will be initialized
834
+
835
+ :stability: experimental
836
+ '''
837
+ if __debug__:
838
+ type_hints = typing.get_type_hints(_typecheckingstub__26a65a7f8b5344e57811d88192dc3cf822bfa45031afe03f34576593e271e7b1)
839
+ check_type(argname="argument scope", value=scope, expected_type=type_hints["scope"])
840
+ check_type(argname="argument id", value=id, expected_type=type_hints["id"])
841
+ props = TableBucketPolicyProps(
842
+ table_bucket=table_bucket,
843
+ removal_policy=removal_policy,
844
+ resource_policy=resource_policy,
845
+ )
846
+
847
+ jsii.create(self.__class__, self, [scope, id, props])
848
+
849
+ @builtins.property
850
+ @jsii.member(jsii_name="document")
851
+ def document(self) -> _aws_cdk_aws_iam_ceddda9d.PolicyDocument:
852
+ '''(experimental) The IAM PolicyDocument containing permissions represented by this policy.
853
+
854
+ :stability: experimental
855
+ '''
856
+ return typing.cast(_aws_cdk_aws_iam_ceddda9d.PolicyDocument, jsii.get(self, "document"))
857
+
858
+
859
+ @jsii.data_type(
860
+ jsii_type="@aws-cdk/aws-s3tables-alpha.TableBucketPolicyProps",
861
+ jsii_struct_bases=[],
862
+ name_mapping={
863
+ "table_bucket": "tableBucket",
864
+ "removal_policy": "removalPolicy",
865
+ "resource_policy": "resourcePolicy",
866
+ },
867
+ )
868
+ class TableBucketPolicyProps:
869
+ def __init__(
870
+ self,
871
+ *,
872
+ table_bucket: ITableBucket,
873
+ removal_policy: typing.Optional[_aws_cdk_ceddda9d.RemovalPolicy] = None,
874
+ resource_policy: typing.Optional[_aws_cdk_aws_iam_ceddda9d.PolicyDocument] = None,
875
+ ) -> None:
876
+ '''(experimental) Parameters for constructing a TableBucketPolicy.
877
+
878
+ :param table_bucket: (experimental) The associated table bucket.
879
+ :param removal_policy: (experimental) Policy to apply when the policy is removed from this stack. Default: - RemovalPolicy.DESTROY.
880
+ :param resource_policy: (experimental) The policy document for the bucket's resource policy. Default: undefined An empty iam.PolicyDocument will be initialized
881
+
882
+ :stability: experimental
883
+ :exampleMetadata: fixture=_generated
884
+
885
+ Example::
886
+
887
+ # The code below shows an example of how to instantiate this type.
888
+ # The values are placeholders you should change.
889
+ import aws_cdk.aws_s3tables_alpha as s3tables_alpha
890
+ import aws_cdk as cdk
891
+ from aws_cdk import aws_iam as iam
892
+
893
+ # policy_document: iam.PolicyDocument
894
+ # table_bucket: s3tables_alpha.TableBucket
895
+
896
+ table_bucket_policy_props = s3tables_alpha.TableBucketPolicyProps(
897
+ table_bucket=table_bucket,
898
+
899
+ # the properties below are optional
900
+ removal_policy=cdk.RemovalPolicy.DESTROY,
901
+ resource_policy=policy_document
902
+ )
903
+ '''
904
+ if __debug__:
905
+ type_hints = typing.get_type_hints(_typecheckingstub__a8afedf0f9c96ed3f2bfa2918ddf62a334b286bd16c0997d1db2f20acd045d28)
906
+ check_type(argname="argument table_bucket", value=table_bucket, expected_type=type_hints["table_bucket"])
907
+ check_type(argname="argument removal_policy", value=removal_policy, expected_type=type_hints["removal_policy"])
908
+ check_type(argname="argument resource_policy", value=resource_policy, expected_type=type_hints["resource_policy"])
909
+ self._values: typing.Dict[builtins.str, typing.Any] = {
910
+ "table_bucket": table_bucket,
911
+ }
912
+ if removal_policy is not None:
913
+ self._values["removal_policy"] = removal_policy
914
+ if resource_policy is not None:
915
+ self._values["resource_policy"] = resource_policy
916
+
917
+ @builtins.property
918
+ def table_bucket(self) -> ITableBucket:
919
+ '''(experimental) The associated table bucket.
920
+
921
+ :stability: experimental
922
+ '''
923
+ result = self._values.get("table_bucket")
924
+ assert result is not None, "Required property 'table_bucket' is missing"
925
+ return typing.cast(ITableBucket, result)
926
+
927
+ @builtins.property
928
+ def removal_policy(self) -> typing.Optional[_aws_cdk_ceddda9d.RemovalPolicy]:
929
+ '''(experimental) Policy to apply when the policy is removed from this stack.
930
+
931
+ :default: - RemovalPolicy.DESTROY.
932
+
933
+ :stability: experimental
934
+ '''
935
+ result = self._values.get("removal_policy")
936
+ return typing.cast(typing.Optional[_aws_cdk_ceddda9d.RemovalPolicy], result)
937
+
938
+ @builtins.property
939
+ def resource_policy(
940
+ self,
941
+ ) -> typing.Optional[_aws_cdk_aws_iam_ceddda9d.PolicyDocument]:
942
+ '''(experimental) The policy document for the bucket's resource policy.
943
+
944
+ :default: undefined An empty iam.PolicyDocument will be initialized
945
+
946
+ :stability: experimental
947
+ '''
948
+ result = self._values.get("resource_policy")
949
+ return typing.cast(typing.Optional[_aws_cdk_aws_iam_ceddda9d.PolicyDocument], result)
950
+
951
+ def __eq__(self, rhs: typing.Any) -> builtins.bool:
952
+ return isinstance(rhs, self.__class__) and rhs._values == self._values
953
+
954
+ def __ne__(self, rhs: typing.Any) -> builtins.bool:
955
+ return not (rhs == self)
956
+
957
+ def __repr__(self) -> str:
958
+ return "TableBucketPolicyProps(%s)" % ", ".join(
959
+ k + "=" + repr(v) for k, v in self._values.items()
960
+ )
961
+
962
+
963
+ @jsii.data_type(
964
+ jsii_type="@aws-cdk/aws-s3tables-alpha.TableBucketProps",
965
+ jsii_struct_bases=[],
966
+ name_mapping={
967
+ "table_bucket_name": "tableBucketName",
968
+ "account": "account",
969
+ "region": "region",
970
+ "removal_policy": "removalPolicy",
971
+ "unreferenced_file_removal": "unreferencedFileRemoval",
972
+ },
973
+ )
974
+ class TableBucketProps:
975
+ def __init__(
976
+ self,
977
+ *,
978
+ table_bucket_name: builtins.str,
979
+ account: typing.Optional[builtins.str] = None,
980
+ region: typing.Optional[builtins.str] = None,
981
+ removal_policy: typing.Optional[_aws_cdk_ceddda9d.RemovalPolicy] = None,
982
+ unreferenced_file_removal: typing.Optional[typing.Union["UnreferencedFileRemoval", typing.Dict[builtins.str, typing.Any]]] = None,
983
+ ) -> None:
984
+ '''(experimental) Parameters for constructing a TableBucket.
985
+
986
+ :param table_bucket_name: (experimental) Name of the S3 TableBucket.
987
+ :param account: (experimental) AWS Account ID of the table bucket owner. Default: - it's assumed the bucket belongs to the same account as the scope it's being imported into
988
+ :param region: (experimental) AWS region that the table bucket exists in. Default: - it's assumed the bucket is in the same region as the scope it's being imported into
989
+ :param removal_policy: (experimental) Controls what happens to this table bucket it it stoped being managed by cloudformation. Default: RETAIN
990
+ :param unreferenced_file_removal: (experimental) Unreferenced file removal settings for the S3 TableBucket. Default: Enabled with default values
991
+
992
+ :stability: experimental
993
+ :exampleMetadata: infused
994
+
995
+ Example::
996
+
997
+ # Build a Table bucket
998
+ sample_table_bucket = TableBucket(scope, "ExampleTableBucket",
999
+ table_bucket_name="example-bucket-1",
1000
+ # optional fields:
1001
+ unreferenced_file_removal=UnreferencedFileRemoval(
1002
+ status=UnreferencedFileRemovalStatus.ENABLED,
1003
+ noncurrent_days=20,
1004
+ unreferenced_days=20
1005
+ )
1006
+ )
1007
+ '''
1008
+ if isinstance(unreferenced_file_removal, dict):
1009
+ unreferenced_file_removal = UnreferencedFileRemoval(**unreferenced_file_removal)
1010
+ if __debug__:
1011
+ type_hints = typing.get_type_hints(_typecheckingstub__aa14ccf904c2576c446af7122d6335d3a92b012274a231120ab28c942832368b)
1012
+ check_type(argname="argument table_bucket_name", value=table_bucket_name, expected_type=type_hints["table_bucket_name"])
1013
+ check_type(argname="argument account", value=account, expected_type=type_hints["account"])
1014
+ check_type(argname="argument region", value=region, expected_type=type_hints["region"])
1015
+ check_type(argname="argument removal_policy", value=removal_policy, expected_type=type_hints["removal_policy"])
1016
+ check_type(argname="argument unreferenced_file_removal", value=unreferenced_file_removal, expected_type=type_hints["unreferenced_file_removal"])
1017
+ self._values: typing.Dict[builtins.str, typing.Any] = {
1018
+ "table_bucket_name": table_bucket_name,
1019
+ }
1020
+ if account is not None:
1021
+ self._values["account"] = account
1022
+ if region is not None:
1023
+ self._values["region"] = region
1024
+ if removal_policy is not None:
1025
+ self._values["removal_policy"] = removal_policy
1026
+ if unreferenced_file_removal is not None:
1027
+ self._values["unreferenced_file_removal"] = unreferenced_file_removal
1028
+
1029
+ @builtins.property
1030
+ def table_bucket_name(self) -> builtins.str:
1031
+ '''(experimental) Name of the S3 TableBucket.
1032
+
1033
+ :stability: experimental
1034
+ :link: https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-tables-buckets-naming.html#table-buckets-naming-rules
1035
+ '''
1036
+ result = self._values.get("table_bucket_name")
1037
+ assert result is not None, "Required property 'table_bucket_name' is missing"
1038
+ return typing.cast(builtins.str, result)
1039
+
1040
+ @builtins.property
1041
+ def account(self) -> typing.Optional[builtins.str]:
1042
+ '''(experimental) AWS Account ID of the table bucket owner.
1043
+
1044
+ :default: - it's assumed the bucket belongs to the same account as the scope it's being imported into
1045
+
1046
+ :stability: experimental
1047
+ '''
1048
+ result = self._values.get("account")
1049
+ return typing.cast(typing.Optional[builtins.str], result)
1050
+
1051
+ @builtins.property
1052
+ def region(self) -> typing.Optional[builtins.str]:
1053
+ '''(experimental) AWS region that the table bucket exists in.
1054
+
1055
+ :default: - it's assumed the bucket is in the same region as the scope it's being imported into
1056
+
1057
+ :stability: experimental
1058
+ '''
1059
+ result = self._values.get("region")
1060
+ return typing.cast(typing.Optional[builtins.str], result)
1061
+
1062
+ @builtins.property
1063
+ def removal_policy(self) -> typing.Optional[_aws_cdk_ceddda9d.RemovalPolicy]:
1064
+ '''(experimental) Controls what happens to this table bucket it it stoped being managed by cloudformation.
1065
+
1066
+ :default: RETAIN
1067
+
1068
+ :stability: experimental
1069
+ '''
1070
+ result = self._values.get("removal_policy")
1071
+ return typing.cast(typing.Optional[_aws_cdk_ceddda9d.RemovalPolicy], result)
1072
+
1073
+ @builtins.property
1074
+ def unreferenced_file_removal(self) -> typing.Optional["UnreferencedFileRemoval"]:
1075
+ '''(experimental) Unreferenced file removal settings for the S3 TableBucket.
1076
+
1077
+ :default: Enabled with default values
1078
+
1079
+ :see: https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-table-buckets-maintenance.html
1080
+ :stability: experimental
1081
+ :link: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3tables-tablebucket-unreferencedfileremoval.html
1082
+ '''
1083
+ result = self._values.get("unreferenced_file_removal")
1084
+ return typing.cast(typing.Optional["UnreferencedFileRemoval"], result)
1085
+
1086
+ def __eq__(self, rhs: typing.Any) -> builtins.bool:
1087
+ return isinstance(rhs, self.__class__) and rhs._values == self._values
1088
+
1089
+ def __ne__(self, rhs: typing.Any) -> builtins.bool:
1090
+ return not (rhs == self)
1091
+
1092
+ def __repr__(self) -> str:
1093
+ return "TableBucketProps(%s)" % ", ".join(
1094
+ k + "=" + repr(v) for k, v in self._values.items()
1095
+ )
1096
+
1097
+
1098
+ @jsii.data_type(
1099
+ jsii_type="@aws-cdk/aws-s3tables-alpha.UnreferencedFileRemoval",
1100
+ jsii_struct_bases=[],
1101
+ name_mapping={
1102
+ "noncurrent_days": "noncurrentDays",
1103
+ "status": "status",
1104
+ "unreferenced_days": "unreferencedDays",
1105
+ },
1106
+ )
1107
+ class UnreferencedFileRemoval:
1108
+ def __init__(
1109
+ self,
1110
+ *,
1111
+ noncurrent_days: typing.Optional[jsii.Number] = None,
1112
+ status: typing.Optional["UnreferencedFileRemovalStatus"] = None,
1113
+ unreferenced_days: typing.Optional[jsii.Number] = None,
1114
+ ) -> None:
1115
+ '''(experimental) Unreferenced file removal settings for the this table bucket.
1116
+
1117
+ :param noncurrent_days: (experimental) Duration after which noncurrent files should be removed. Should be at least one day. Default: - See S3 Tables User Guide
1118
+ :param status: (experimental) Status of unreferenced file removal. Can be Enabled or Disabled. Default: - See S3 Tables User Guide
1119
+ :param unreferenced_days: (experimental) Duration after which unreferenced files should be removed. Should be at least one day. Default: - See S3 Tables User Guide
1120
+
1121
+ :stability: experimental
1122
+ :exampleMetadata: infused
1123
+
1124
+ Example::
1125
+
1126
+ # Build a Table bucket
1127
+ sample_table_bucket = TableBucket(scope, "ExampleTableBucket",
1128
+ table_bucket_name="example-bucket-1",
1129
+ # optional fields:
1130
+ unreferenced_file_removal=UnreferencedFileRemoval(
1131
+ status=UnreferencedFileRemovalStatus.ENABLED,
1132
+ noncurrent_days=20,
1133
+ unreferenced_days=20
1134
+ )
1135
+ )
1136
+ '''
1137
+ if __debug__:
1138
+ type_hints = typing.get_type_hints(_typecheckingstub__b3c9fa2e0832ae26e721328d6c201e9e86774721d68903a6414d69d8a77a5675)
1139
+ check_type(argname="argument noncurrent_days", value=noncurrent_days, expected_type=type_hints["noncurrent_days"])
1140
+ check_type(argname="argument status", value=status, expected_type=type_hints["status"])
1141
+ check_type(argname="argument unreferenced_days", value=unreferenced_days, expected_type=type_hints["unreferenced_days"])
1142
+ self._values: typing.Dict[builtins.str, typing.Any] = {}
1143
+ if noncurrent_days is not None:
1144
+ self._values["noncurrent_days"] = noncurrent_days
1145
+ if status is not None:
1146
+ self._values["status"] = status
1147
+ if unreferenced_days is not None:
1148
+ self._values["unreferenced_days"] = unreferenced_days
1149
+
1150
+ @builtins.property
1151
+ def noncurrent_days(self) -> typing.Optional[jsii.Number]:
1152
+ '''(experimental) Duration after which noncurrent files should be removed.
1153
+
1154
+ Should be at least one day.
1155
+
1156
+ :default: - See S3 Tables User Guide
1157
+
1158
+ :see: https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-table-buckets-maintenance.html
1159
+ :stability: experimental
1160
+ '''
1161
+ result = self._values.get("noncurrent_days")
1162
+ return typing.cast(typing.Optional[jsii.Number], result)
1163
+
1164
+ @builtins.property
1165
+ def status(self) -> typing.Optional["UnreferencedFileRemovalStatus"]:
1166
+ '''(experimental) Status of unreferenced file removal.
1167
+
1168
+ Can be Enabled or Disabled.
1169
+
1170
+ :default: - See S3 Tables User Guide
1171
+
1172
+ :see: https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-table-buckets-maintenance.html
1173
+ :stability: experimental
1174
+ '''
1175
+ result = self._values.get("status")
1176
+ return typing.cast(typing.Optional["UnreferencedFileRemovalStatus"], result)
1177
+
1178
+ @builtins.property
1179
+ def unreferenced_days(self) -> typing.Optional[jsii.Number]:
1180
+ '''(experimental) Duration after which unreferenced files should be removed.
1181
+
1182
+ Should be at least one day.
1183
+
1184
+ :default: - See S3 Tables User Guide
1185
+
1186
+ :see: https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-table-buckets-maintenance.html
1187
+ :stability: experimental
1188
+ '''
1189
+ result = self._values.get("unreferenced_days")
1190
+ return typing.cast(typing.Optional[jsii.Number], result)
1191
+
1192
+ def __eq__(self, rhs: typing.Any) -> builtins.bool:
1193
+ return isinstance(rhs, self.__class__) and rhs._values == self._values
1194
+
1195
+ def __ne__(self, rhs: typing.Any) -> builtins.bool:
1196
+ return not (rhs == self)
1197
+
1198
+ def __repr__(self) -> str:
1199
+ return "UnreferencedFileRemoval(%s)" % ", ".join(
1200
+ k + "=" + repr(v) for k, v in self._values.items()
1201
+ )
1202
+
1203
+
1204
+ @jsii.enum(jsii_type="@aws-cdk/aws-s3tables-alpha.UnreferencedFileRemovalStatus")
1205
+ class UnreferencedFileRemovalStatus(enum.Enum):
1206
+ '''(experimental) Controls whether unreferenced file removal is enabled or disabled.
1207
+
1208
+ :stability: experimental
1209
+ :exampleMetadata: infused
1210
+
1211
+ Example::
1212
+
1213
+ # Build a Table bucket
1214
+ sample_table_bucket = TableBucket(scope, "ExampleTableBucket",
1215
+ table_bucket_name="example-bucket-1",
1216
+ # optional fields:
1217
+ unreferenced_file_removal=UnreferencedFileRemoval(
1218
+ status=UnreferencedFileRemovalStatus.ENABLED,
1219
+ noncurrent_days=20,
1220
+ unreferenced_days=20
1221
+ )
1222
+ )
1223
+ '''
1224
+
1225
+ ENABLED = "ENABLED"
1226
+ '''(experimental) Enable unreferenced file removal.
1227
+
1228
+ :stability: experimental
1229
+ '''
1230
+ DISABLED = "DISABLED"
1231
+ '''(experimental) Disable unreferenced file removal.
1232
+
1233
+ :stability: experimental
1234
+ '''
1235
+
1236
+
1237
+ __all__ = [
1238
+ "ITableBucket",
1239
+ "TableBucket",
1240
+ "TableBucketAttributes",
1241
+ "TableBucketPolicy",
1242
+ "TableBucketPolicyProps",
1243
+ "TableBucketProps",
1244
+ "UnreferencedFileRemoval",
1245
+ "UnreferencedFileRemovalStatus",
1246
+ ]
1247
+
1248
+ publication.publish()
1249
+
1250
+ def _typecheckingstub__a7c10542c60e15926bb4ef59925c4f6c0878400e041897780edddaa65054d627(
1251
+ statement: _aws_cdk_aws_iam_ceddda9d.PolicyStatement,
1252
+ ) -> None:
1253
+ """Type checking stubs"""
1254
+ pass
1255
+
1256
+ def _typecheckingstub__853d3e698d103ae1fe304d2239745ee798278fcd22f673c7ae8e9b33884c90a9(
1257
+ identity: _aws_cdk_aws_iam_ceddda9d.IGrantable,
1258
+ table_id: builtins.str,
1259
+ ) -> None:
1260
+ """Type checking stubs"""
1261
+ pass
1262
+
1263
+ def _typecheckingstub__1c9eb5186509f26b2c015223d6e2614c16cc34d5c2608ca3903b133360e23990(
1264
+ identity: _aws_cdk_aws_iam_ceddda9d.IGrantable,
1265
+ table_id: builtins.str,
1266
+ ) -> None:
1267
+ """Type checking stubs"""
1268
+ pass
1269
+
1270
+ def _typecheckingstub__65fa831e505e76e1fe23a8a8d8ce97bb97ebff683edbf67f37020df64c040fdb(
1271
+ identity: _aws_cdk_aws_iam_ceddda9d.IGrantable,
1272
+ table_id: builtins.str,
1273
+ ) -> None:
1274
+ """Type checking stubs"""
1275
+ pass
1276
+
1277
+ def _typecheckingstub__c8d9c0bf5c954c2a6797301b7dc6cb8abd812336f3507addc92f72b805ec0a1e(
1278
+ scope: _constructs_77d1e7e8.Construct,
1279
+ id: builtins.str,
1280
+ *,
1281
+ table_bucket_name: builtins.str,
1282
+ account: typing.Optional[builtins.str] = None,
1283
+ region: typing.Optional[builtins.str] = None,
1284
+ removal_policy: typing.Optional[_aws_cdk_ceddda9d.RemovalPolicy] = None,
1285
+ unreferenced_file_removal: typing.Optional[typing.Union[UnreferencedFileRemoval, typing.Dict[builtins.str, typing.Any]]] = None,
1286
+ ) -> None:
1287
+ """Type checking stubs"""
1288
+ pass
1289
+
1290
+ def _typecheckingstub__03d844a802df53acfc8906e32d1d2bbab0d86fedd5fc2ef65296a8c7a0c368d5(
1291
+ scope: _constructs_77d1e7e8.Construct,
1292
+ id: builtins.str,
1293
+ table_bucket_arn: builtins.str,
1294
+ ) -> None:
1295
+ """Type checking stubs"""
1296
+ pass
1297
+
1298
+ def _typecheckingstub__6fd93d11fc9c336a7e785b6aaa945ba1d55d75eb3748b03a2030b08e3d152961(
1299
+ scope: _constructs_77d1e7e8.Construct,
1300
+ id: builtins.str,
1301
+ *,
1302
+ account: typing.Optional[builtins.str] = None,
1303
+ region: typing.Optional[builtins.str] = None,
1304
+ table_bucket_arn: typing.Optional[builtins.str] = None,
1305
+ table_bucket_name: typing.Optional[builtins.str] = None,
1306
+ ) -> None:
1307
+ """Type checking stubs"""
1308
+ pass
1309
+
1310
+ def _typecheckingstub__054bf3ff46c98611841750ec27c0d492c7ee0aa6480b03f4a250c1d73bf049f7(
1311
+ bucket_name: typing.Optional[builtins.str] = None,
1312
+ ) -> None:
1313
+ """Type checking stubs"""
1314
+ pass
1315
+
1316
+ def _typecheckingstub__51cd52e5dbcb37ec9f9fd146daf9705f341ba8056f0f9d812355dc6e0ec273cd(
1317
+ statement: _aws_cdk_aws_iam_ceddda9d.PolicyStatement,
1318
+ ) -> None:
1319
+ """Type checking stubs"""
1320
+ pass
1321
+
1322
+ def _typecheckingstub__fecb8141f36793842f11c48ee39490301f24e6f1f0de09abbbf16bf1f96f0cb3(
1323
+ identity: _aws_cdk_aws_iam_ceddda9d.IGrantable,
1324
+ table_id: builtins.str,
1325
+ ) -> None:
1326
+ """Type checking stubs"""
1327
+ pass
1328
+
1329
+ def _typecheckingstub__cd8d4708cc079743c68f1ed7c239ba7a268460ad7ce4e417684326708cd34a54(
1330
+ identity: _aws_cdk_aws_iam_ceddda9d.IGrantable,
1331
+ table_id: builtins.str,
1332
+ ) -> None:
1333
+ """Type checking stubs"""
1334
+ pass
1335
+
1336
+ def _typecheckingstub__6f9476ce4489c94b0b073d56ebee26cf1a8f5db20184e82de18e7238c0381b9a(
1337
+ identity: _aws_cdk_aws_iam_ceddda9d.IGrantable,
1338
+ table_id: builtins.str,
1339
+ ) -> None:
1340
+ """Type checking stubs"""
1341
+ pass
1342
+
1343
+ def _typecheckingstub__ddda0c30ebb465614a7378f709964b48c9f175013aa1ed12f0ea7c1218e8c630(
1344
+ value: builtins.bool,
1345
+ ) -> None:
1346
+ """Type checking stubs"""
1347
+ pass
1348
+
1349
+ def _typecheckingstub__f628073bbee2e81e2162c5225d2230a24b470a8915e2ee4cef917951de644d61(
1350
+ *,
1351
+ account: typing.Optional[builtins.str] = None,
1352
+ region: typing.Optional[builtins.str] = None,
1353
+ table_bucket_arn: typing.Optional[builtins.str] = None,
1354
+ table_bucket_name: typing.Optional[builtins.str] = None,
1355
+ ) -> None:
1356
+ """Type checking stubs"""
1357
+ pass
1358
+
1359
+ def _typecheckingstub__26a65a7f8b5344e57811d88192dc3cf822bfa45031afe03f34576593e271e7b1(
1360
+ scope: _constructs_77d1e7e8.Construct,
1361
+ id: builtins.str,
1362
+ *,
1363
+ table_bucket: ITableBucket,
1364
+ removal_policy: typing.Optional[_aws_cdk_ceddda9d.RemovalPolicy] = None,
1365
+ resource_policy: typing.Optional[_aws_cdk_aws_iam_ceddda9d.PolicyDocument] = None,
1366
+ ) -> None:
1367
+ """Type checking stubs"""
1368
+ pass
1369
+
1370
+ def _typecheckingstub__a8afedf0f9c96ed3f2bfa2918ddf62a334b286bd16c0997d1db2f20acd045d28(
1371
+ *,
1372
+ table_bucket: ITableBucket,
1373
+ removal_policy: typing.Optional[_aws_cdk_ceddda9d.RemovalPolicy] = None,
1374
+ resource_policy: typing.Optional[_aws_cdk_aws_iam_ceddda9d.PolicyDocument] = None,
1375
+ ) -> None:
1376
+ """Type checking stubs"""
1377
+ pass
1378
+
1379
+ def _typecheckingstub__aa14ccf904c2576c446af7122d6335d3a92b012274a231120ab28c942832368b(
1380
+ *,
1381
+ table_bucket_name: builtins.str,
1382
+ account: typing.Optional[builtins.str] = None,
1383
+ region: typing.Optional[builtins.str] = None,
1384
+ removal_policy: typing.Optional[_aws_cdk_ceddda9d.RemovalPolicy] = None,
1385
+ unreferenced_file_removal: typing.Optional[typing.Union[UnreferencedFileRemoval, typing.Dict[builtins.str, typing.Any]]] = None,
1386
+ ) -> None:
1387
+ """Type checking stubs"""
1388
+ pass
1389
+
1390
+ def _typecheckingstub__b3c9fa2e0832ae26e721328d6c201e9e86774721d68903a6414d69d8a77a5675(
1391
+ *,
1392
+ noncurrent_days: typing.Optional[jsii.Number] = None,
1393
+ status: typing.Optional[UnreferencedFileRemovalStatus] = None,
1394
+ unreferenced_days: typing.Optional[jsii.Number] = None,
1395
+ ) -> None:
1396
+ """Type checking stubs"""
1397
+ pass