S3Tables / Client / create_table

create_table

S3Tables.Client.create_table(**kwargs)

Creates a new table associated with the given namespace in a table bucket. For more information, see Creating an Amazon S3 table in the Amazon Simple Storage Service User Guide.

Permissions

  • You must have the s3tables:CreateTable permission to use this operation.

  • If you use this operation with the optional metadata request parameter you must have the s3tables:PutTableData permission.

  • If you use this operation with the optional encryptionConfiguration request parameter you must have the s3tables:PutTableEncryption permission.

Note

Additionally,

See also: AWS API Documentation

Request Syntax

response = client.create_table(
    tableBucketARN='string',
    namespace='string',
    name='string',
    format='ICEBERG',
    metadata={
        'iceberg': {
            'schema': {
                'fields': [
                    {
                        'name': 'string',
                        'type': 'string',
                        'required': True|False
                    },
                ]
            }
        }
    },
    encryptionConfiguration={
        'sseAlgorithm': 'AES256'|'aws:kms',
        'kmsKeyArn': 'string'
    }
)
Parameters:
  • tableBucketARN (string) –

    [REQUIRED]

    The Amazon Resource Name (ARN) of the table bucket to create the table in.

  • namespace (string) –

    [REQUIRED]

    The namespace to associated with the table.

  • name (string) –

    [REQUIRED]

    The name for the table.

  • format (string) –

    [REQUIRED]

    The format for the table.

  • metadata (dict) –

    The metadata for the table.

    Note

    This is a Tagged Union structure. Only one of the following top level keys can be set: iceberg.

    • iceberg (dict) –

      Contains details about the metadata of an Iceberg table.

      • schema (dict) – [REQUIRED]

        The schema for an Iceberg table.

        • fields (list) – [REQUIRED]

          The schema fields for the table

          • (dict) –

            Contains details about a schema field.

            • name (string) – [REQUIRED]

              The name of the field.

            • type (string) – [REQUIRED]

              The field type. S3 Tables supports all Apache Iceberg primitive types. For more information, see the Apache Iceberg documentation.

            • required (boolean) –

              A Boolean value that specifies whether values are required for each row in this field. By default, this is false and null values are allowed in the field. If this is true the field does not allow null values.

  • encryptionConfiguration (dict) –

    The encryption configuration to use for the table. This configuration specifies the encryption algorithm and, if using SSE-KMS, the KMS key to use for encrypting the table.

    Note

    If you choose SSE-KMS encryption you must grant the S3 Tables maintenance principal access to your KMS key. For more information, see Permissions requirements for S3 Tables SSE-KMS encryption.

    • sseAlgorithm (string) – [REQUIRED]

      The server-side encryption algorithm to use. Valid values are AES256 for S3-managed encryption keys, or aws:kms for Amazon Web Services KMS-managed encryption keys. If you choose SSE-KMS encryption you must grant the S3 Tables maintenance principal access to your KMS key. For more information, see Permissions requirements for S3 Tables SSE-KMS encryption.

    • kmsKeyArn (string) –

      The Amazon Resource Name (ARN) of the KMS key to use for encryption. This field is required only when sseAlgorithm is set to aws:kms.

Return type:

dict

Returns:

Response Syntax

{
    'tableARN': 'string',
    'versionToken': 'string'
}

Response Structure

  • (dict) –

    • tableARN (string) –

      The Amazon Resource Name (ARN) of the table.

    • versionToken (string) –

      The version token of the table.

Exceptions