tables
Creates, updates, deletes, gets or lists a tables resource.
Overview
| Name | tables |
| Type | Resource |
| Id | aws.s3tables.tables |
Fields
The following fields are returned by SELECT queries:
- list_tables
- get_table
| Name | Datatype | Description |
|---|---|---|
name | string | The name of the table. (pattern: <code>[0-9a-z_]*</code>) |
created_at | string (date-time) | The date and time the table was created at. |
managed_by_service | string | The Amazon Web Services service managing this table, if applicable. For example, a replicated table is managed by the S3 Tables replication service. |
modified_at | string (date-time) | The date and time the table was last modified at. |
namespace | array | The name of the namespace. |
namespace_id | string | The unique identifier for the namespace that contains this table. |
table_arn | string | The Amazon Resource Name (ARN) of the table. (pattern: <code>(arn:aws[-a-z0-9]:[a-z0-9]+:[-a-z0-9]:[0-9]{12}:bucket/[a-z0-9_-]{3,63}/table/[a-zA-Z0-9-_]{1,255})</code>) |
table_bucket_id | string | The unique identifier for the table bucket that contains this table. |
type_ | string | The type of the table. (customer, aws) |
| Name | Datatype | Description |
|---|---|---|
name | string | The name of the table. (pattern: <code>[0-9a-z_]*</code>) |
created_at | string (date-time) | The date and time the table bucket was created at. |
created_by | string | The ID of the account that created the table. (pattern: <code>[0-9].*</code>) |
format_ | string | The format of the table. (ICEBERG) |
managed_by_service | string | The service that manages the table. |
managed_table_information | object | If this table is managed by S3 Tables, contains additional information such as replication details. |
metadata_location | string | The metadata location of the table. |
modified_at | string (date-time) | The date and time the table was last modified on. |
modified_by | string | The ID of the account that last modified the table. (pattern: <code>[0-9].*</code>) |
namespace | array | The namespace associated with the table. |
namespace_id | string | The unique identifier of the namespace containing this table. |
owner_account_id | string | The ID of the account that owns the table. (pattern: <code>[0-9].*</code>) |
table_arn | string | The Amazon Resource Name (ARN) of the table. (pattern: <code>(arn:aws[-a-z0-9]:[a-z0-9]+:[-a-z0-9]:[0-9]{12}:bucket/[a-z0-9_-]{3,63}/table/[a-zA-Z0-9-_]{1,255})</code>) |
table_bucket_id | string | The unique identifier of the table bucket containing this table. |
type_ | string | The type of the table. (customer, aws) |
version_token | string | The version token of the table. |
warehouse_location | string | The warehouse location of the table. |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
list_tables | select | table_bucket_arn, region | namespace, prefix, continuationToken, maxTables | List tables in the given table bucket. For more information, see S3 Tables in the Amazon Simple Storage Service User Guide. Permissions You must have the s3tables:ListTables permission to use this operation. |
get_table | select | region | tableBucketARN, namespace, name, tableArn | Gets details about a table. For more information, see S3 Tables in the Amazon Simple Storage Service User Guide. Permissions You must have the s3tables:GetTable permission to use this operation. |
create_table | insert | table_bucket_arn, namespace, region, name, format | 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. If you use this operation with the storageClassConfiguration request parameter, you must have the s3tables:PutTableStorageClass permission. To create a table with tags, you must have the s3tables:TagResource permission in addition to s3tables:CreateTable permission. Additionally, 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. | |
delete_table | delete | table_bucket_arn, namespace, name, region | versionToken | Deletes a table. For more information, see Deleting an Amazon S3 table in the Amazon Simple Storage Service User Guide. Permissions You must have the s3tables:DeleteTable permission to use this operation. |
Parameters
Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.
| Name | Datatype | Description |
|---|---|---|
name | string | The name of the table. |
namespace | string | The namespace associated with the table. |
region | string | AWS region (default: us-east-1) |
table_bucket_arn | string | The Amazon Resource Name (ARN) of the table bucket that contains the table. |
continuationToken | string | ContinuationToken indicates to Amazon S3 that the list is being continued on this bucket with a token. ContinuationToken is obfuscated and is not a real key. You can use this ContinuationToken for pagination of the list results. |
maxTables | integer | The maximum number of tables to return. |
name | string | The name of the table. |
namespace | string | The name of the namespace the table is associated with. |
prefix | string | The prefix of the tables. |
tableArn | string | The Amazon Resource Name (ARN) of the table. |
tableBucketARN | string | The Amazon Resource Name (ARN) of the table bucket associated with the table. |
versionToken | string | The version token of the table. |
SELECT examples
- list_tables
- get_table
List tables in the given table bucket. For more information, see S3 Tables in the Amazon Simple Storage Service User Guide. Permissions You must have the s3tables:ListTables permission to use this operation.
SELECT
name,
created_at,
managed_by_service,
modified_at,
namespace,
namespace_id,
table_arn,
table_bucket_id,
type_
FROM aws.s3tables.tables
WHERE table_bucket_arn = '{{ table_bucket_arn }}' -- required
AND region = '{{ region }}' -- required
AND namespace = '{{ namespace }}'
AND prefix = '{{ prefix }}'
AND continuationToken = '{{ continuationToken }}'
AND maxTables = '{{ maxTables }}'
;
Gets details about a table. For more information, see S3 Tables in the Amazon Simple Storage Service User Guide. Permissions You must have the s3tables:GetTable permission to use this operation.
SELECT
name,
created_at,
created_by,
format_,
managed_by_service,
managed_table_information,
metadata_location,
modified_at,
modified_by,
namespace,
namespace_id,
owner_account_id,
table_arn,
table_bucket_id,
type_,
version_token,
warehouse_location
FROM aws.s3tables.tables
WHERE region = '{{ region }}' -- required
AND tableBucketARN = '{{ tableBucketARN }}'
AND namespace = '{{ namespace }}'
AND name = '{{ name }}'
AND tableArn = '{{ tableArn }}'
;
INSERT examples
- create_table
- Manifest
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. If you use this operation with the storageClassConfiguration request parameter, you must have the s3tables:PutTableStorageClass permission. To create a table with tags, you must have the s3tables:TagResource permission in addition to s3tables:CreateTable permission. Additionally, 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.
INSERT INTO aws.s3tables.tables (
name,
format,
metadata,
encryptionConfiguration,
storageClassConfiguration,
tags,
table_bucket_arn,
namespace,
region
)
SELECT
'{{ name }}' /* required */,
'{{ format }}' /* required */,
'{{ metadata }}',
'{{ encryptionConfiguration }}',
'{{ storageClassConfiguration }}',
'{{ tags }}',
'{{ table_bucket_arn }}',
'{{ namespace }}',
'{{ region }}'
RETURNING
table_arn,
version_token
;
# Description fields are for documentation purposes
- name: tables
props:
- name: table_bucket_arn
value: "{{ table_bucket_arn }}"
description: Required parameter for the tables resource.
- name: namespace
value: "{{ namespace }}"
description: Required parameter for the tables resource.
- name: region
value: "{{ region }}"
description: Required parameter for the tables resource.
- name: name
value: "{{ name }}"
- name: format
value: "{{ format }}"
valid_values: ['ICEBERG']
- name: metadata
description: |
Contains details about the table metadata.
value:
iceberg:
schema:
fields:
- id: {{ id }}
name: "{{ name }}"
type_: "{{ type_ }}"
required_: {{ required_ }}
schemaV2:
type_: "{{ type_ }}"
fields:
- id: {{ id }}
name: "{{ name }}"
type_: "{{ type_ }}"
required_: {{ required_ }}
doc: "{{ doc }}"
schemaId: {{ schemaId }}
identifierFieldIds:
- {{ identifierFieldIds }}
partitionSpec:
fields:
- sourceId: {{ sourceId }}
transform: "{{ transform }}"
name: "{{ name }}"
fieldId: {{ fieldId }}
specId: {{ specId }}
writeOrder:
orderId: {{ orderId }}
fields:
- sourceId: {{ sourceId }}
transform: "{{ transform }}"
direction: "{{ direction }}"
nullOrder: "{{ nullOrder }}"
properties_: "{{ properties_ }}"
- name: encryptionConfiguration
description: |
Configuration specifying how data should be encrypted. This structure defines the encryption algorithm and optional KMS key to be used for server-side encryption.
value:
sseAlgorithm: "{{ sseAlgorithm }}"
kmsKeyArn: "{{ kmsKeyArn }}"
- name: storageClassConfiguration
description: |
The configuration details for the storage class of tables or table buckets. This allows you to optimize storage costs by selecting the appropriate storage class based on your access patterns and performance requirements.
value:
storageClass: "{{ storageClass }}"
- name: tags
value: "{{ tags }}"
DELETE examples
- delete_table
Deletes a table. For more information, see Deleting an Amazon S3 table in the Amazon Simple Storage Service User Guide. Permissions You must have the s3tables:DeleteTable permission to use this operation.
DELETE FROM aws.s3tables.tables
WHERE table_bucket_arn = '{{ table_bucket_arn }}' --required
AND namespace = '{{ namespace }}' --required
AND name = '{{ name }}' --required
AND region = '{{ region }}' --required
AND versionToken = '{{ versionToken }}'
;