java.lang.Object
software.amazon.jsii.JsiiObject
software.constructs.Construct
software.amazon.awscdk.Resource
software.amazon.awscdk.services.s3tables.alpha.Table
All Implemented Interfaces:
IResource, ITable, software.amazon.jsii.JsiiSerializable, software.constructs.IConstruct, software.constructs.IDependable

@Generated(value="jsii-pacmak/1.113.0 (build fc68b25)", date="2025-09-29T12:38:21.629Z") @Stability(Experimental) public class Table extends Resource implements ITable
(experimental) An S3 Table with helpers.

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();
 
  • Field Details

    • PROPERTY_INJECTION_ID

      @Stability(Experimental) public static final String 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 (usually this). This parameter is required.
      id - The construct's name. This parameter is required.
      attrs - A TableAttributes object containing the table name and ARN. This parameter is required.
    • validateTableName

      @Stability(Experimental) public static void validateTableName(@NotNull String tableName)
      (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 interface ITable
      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 be false. 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

      @Stability(Experimental) @NotNull public Grant grantRead(@NotNull IGrantable identity)
      (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.

      Specified by:
      grantRead in interface ITable
      Parameters:
      identity - This parameter is required.
    • grantReadWrite

      @Stability(Experimental) @NotNull public Grant grantReadWrite(@NotNull IGrantable identity)
      (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 interface ITable
      Parameters:
      identity - This parameter is required.
    • grantWrite

      @Stability(Experimental) @NotNull public Grant grantWrite(@NotNull IGrantable identity)
      (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 interface ITable
      Parameters:
      identity - This parameter is required.
    • getNamespace

      @Stability(Experimental) @NotNull public INamespace getNamespace()
      (experimental) The namespace containing this table.
    • getTableArn

      @Stability(Experimental) @NotNull public String getTableArn()
      (experimental) The unique Amazon Resource Name (arn) of this table.
      Specified by:
      getTableArn in interface ITable
    • getTableName

      @Stability(Experimental) @NotNull public String getTableName()
      (experimental) The name of this table.
      Specified by:
      getTableName in interface ITable
    • getTablePolicy

      @Stability(Experimental) @Nullable public CfnTablePolicy getTablePolicy()
      (experimental) The resource policy for this table.
    • getAutoCreatePolicy

      @Stability(Experimental) @NotNull protected Boolean getAutoCreatePolicy()
      (experimental) Indicates if a table resource policy should automatically created upon the first call to addToResourcePolicy.
    • setAutoCreatePolicy

      @Stability(Experimental) protected void setAutoCreatePolicy(@NotNull Boolean value)
      (experimental) Indicates if a table resource policy should automatically created upon the first call to addToResourcePolicy.