Class Table
- All Implemented Interfaces:
IResource
,ITable
,software.amazon.jsii.JsiiSerializable
,software.constructs.IConstruct
,software.constructs.IDependable
Example:
// Build a table Table sampleTable = Table.Builder.create(scope, "ExampleTable") .tableName("example_table") .namespace(namespace) .openTableFormat(OpenTableFormat.ICEBERG) .withoutMetadata(true) .build(); // Build a table with an Iceberg Schema Table sampleTableWithSchema = Table.Builder.create(scope, "ExampleSchemaTable") .tableName("example_table_with_schema") .namespace(namespace) .openTableFormat(OpenTableFormat.ICEBERG) .icebergMetadata(IcebergMetadataProperty.builder() .icebergSchema(IcebergSchemaProperty.builder() .schemaFieldList(List.of(SchemaFieldProperty.builder() .name("id") .type("int") .required(true) .build(), SchemaFieldProperty.builder() .name("name") .type("string") .build())) .build()) .build()) .compaction(CompactionProperty.builder() .status(Status.ENABLED) .targetFileSizeMb(128) .build()) .snapshotManagement(SnapshotManagementProperty.builder() .status(Status.ENABLED) .maxSnapshotAgeHours(48) .minSnapshotsToKeep(5) .build()) .build();
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from class software.amazon.jsii.JsiiObject
software.amazon.jsii.JsiiObject.InitializationMode
Nested classes/interfaces inherited from interface software.constructs.IConstruct
software.constructs.IConstruct.Jsii$Default
Nested classes/interfaces inherited from interface software.amazon.awscdk.IResource
IResource.Jsii$Default
Nested classes/interfaces inherited from interface software.amazon.awscdk.services.s3tables.alpha.ITable
ITable.Jsii$Default, ITable.Jsii$Proxy
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final String
(experimental) Uniquely identifies this class. -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
Table
(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) protected
Table
(software.amazon.jsii.JsiiObjectRef objRef) Table
(software.constructs.Construct scope, String id, TableProps props) -
Method Summary
Modifier and TypeMethodDescriptionaddToResourcePolicy
(PolicyStatement statement) (experimental) Adds a statement to the resource policy for a principal (i.e.static ITable
fromTableAttributes
(software.constructs.Construct scope, String id, TableAttributes attrs) (experimental) Defines a Table construct that represents an external table.protected Boolean
(experimental) Indicates if a table resource policy should automatically created upon the first call toaddToResourcePolicy
.(experimental) The namespace containing this table.(experimental) The unique Amazon Resource Name (arn) of this table.(experimental) The name of this table.(experimental) The resource policy for this table.grantRead
(IGrantable identity) (experimental) Grant read permissions for this table to an IAM principal (Role/Group/User).grantReadWrite
(IGrantable identity) (experimental) Grant read and write permissions for this table to an IAM principal (Role/Group/User).grantWrite
(IGrantable identity) (experimental) Grant write permissions for this table to an IAM principal (Role/Group/User).protected void
setAutoCreatePolicy
(Boolean value) (experimental) Indicates if a table resource policy should automatically created upon the first call toaddToResourcePolicy
.static void
validateTableName
(String tableName) (experimental) See https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-tables-buckets-naming.html.Methods inherited from class software.amazon.awscdk.Resource
applyRemovalPolicy, generatePhysicalName, getEnv, getPhysicalName, getResourceArnAttribute, getResourceNameAttribute, getStack, isOwnedResource, isResource
Methods inherited from class software.constructs.Construct
getNode, isConstruct, toString
Methods inherited from class software.amazon.jsii.JsiiObject
jsiiAsyncCall, jsiiAsyncCall, jsiiCall, jsiiCall, jsiiGet, jsiiGet, jsiiSet, jsiiStaticCall, jsiiStaticCall, jsiiStaticGet, jsiiStaticGet, jsiiStaticSet, jsiiStaticSet
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface software.constructs.IConstruct
getNode
Methods inherited from interface software.amazon.awscdk.IResource
applyRemovalPolicy, getEnv, getStack
Methods inherited from interface software.amazon.awscdk.services.s3tables.alpha.ITable
getAccount, getRegion
Methods inherited from interface software.amazon.jsii.JsiiSerializable
$jsii$toJson
-
Field Details
-
PROPERTY_INJECTION_ID
(experimental) Uniquely identifies this class.
-
-
Constructor Details
-
Table
protected Table(software.amazon.jsii.JsiiObjectRef objRef) -
Table
protected Table(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) -
Table
@Stability(Experimental) public Table(@NotNull software.constructs.Construct scope, @NotNull String id, @NotNull TableProps props) - Parameters:
scope
- This parameter is required.id
- This parameter is required.props
- This parameter is required.
-
-
Method Details
-
fromTableAttributes
@Stability(Experimental) @NotNull public static ITable fromTableAttributes(@NotNull software.constructs.Construct scope, @NotNull String id, @NotNull TableAttributes attrs) (experimental) Defines a Table construct that represents an external table.- Parameters:
scope
- The parent creating construct (usuallythis
). This parameter is required.id
- The construct's name. This parameter is required.attrs
- ATableAttributes
object containing the table name and ARN. This parameter is required.
-
validateTableName
(experimental) See https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-tables-buckets-naming.html.- Parameters:
tableName
- Name of the table. This parameter is required.
-
addToResourcePolicy
@Stability(Experimental) @NotNull public AddToResourcePolicyResult addToResourcePolicy(@NotNull PolicyStatement statement) (experimental) Adds a statement to the resource policy for a principal (i.e. account/role/service) to perform actions on this table.Note that the policy statement may or may not be added to the policy. For example, when an
ITable
is created from an existing table, it's not possible to tell whether the table already has a policy attached, let alone to re-use that policy to add more statements to it. So it's safest to do nothing in these cases.- Specified by:
addToResourcePolicy
in interfaceITable
- Parameters:
statement
- This parameter is required.- Returns:
- metadata about the execution of this method. If the policy
was not added, the value of
statementAdded
will befalse
. You should always check this value to make sure that the operation was actually carried out. Otherwise, synthesis and deploy will terminate silently, which may be confusing.
-
grantRead
(experimental) Grant read permissions for this table to an IAM principal (Role/Group/User).If the parent TableBucket of this table has encryption, you should grant kms:Decrypt permission to use this key to the same principal.
-
grantReadWrite
(experimental) Grant read and write permissions for this table to an IAM principal (Role/Group/User).If the parent TableBucket of this table has encryption, you should grant kms:GenerateDataKey and kms:Decrypt permission to use this key to the same principal.
- Specified by:
grantReadWrite
in interfaceITable
- Parameters:
identity
- This parameter is required.
-
grantWrite
(experimental) Grant write permissions for this table to an IAM principal (Role/Group/User).If the parent TableBucket of this table has encryption, you should grant kms:GenerateDataKey and kms:Decrypt permission to use this key to the same principal.
- Specified by:
grantWrite
in interfaceITable
- Parameters:
identity
- This parameter is required.
-
getNamespace
(experimental) The namespace containing this table. -
getTableArn
(experimental) The unique Amazon Resource Name (arn) of this table.- Specified by:
getTableArn
in interfaceITable
-
getTableName
(experimental) The name of this table.- Specified by:
getTableName
in interfaceITable
-
getTablePolicy
(experimental) The resource policy for this table. -
getAutoCreatePolicy
(experimental) Indicates if a table resource policy should automatically created upon the first call toaddToResourcePolicy
. -
setAutoCreatePolicy
(experimental) Indicates if a table resource policy should automatically created upon the first call toaddToResourcePolicy
.
-