tables
Creates, updates, deletes or gets a table resource or lists tables in a region
Overview
| Name | tables |
| Type | Resource |
| Description | Resource Type definition for AWS::S3Tables::Table |
| Id | awscc.s3tables.tables |
Fields
- get (all properties)
- list (identifiers only)
| Name | Datatype | Description |
|---|---|---|
without_metadata | string | Indicates that you don't want to specify a schema for the table. This property is mutually exclusive to 'IcebergMetadata', and its only possible value is 'Yes'. |
compaction | object | Settings governing the Compaction maintenance action. Contains details about the compaction settings for an Iceberg table. |
namespace | string | The namespace that the table belongs to. |
table_name | string | The name for the table. |
table_bucket_arn | string | The Amazon Resource Name (ARN) of the specified table bucket. |
version_token | string | The version token of the table |
table_arn | string | The Amazon Resource Name (ARN) of the specified table. |
open_table_format | string | Format of the table. |
iceberg_metadata | object | Contains details about the metadata for an Iceberg table. |
warehouse_location | string | The warehouse location of the table. |
snapshot_management | object | Contains details about the snapshot management settings for an Iceberg table. A snapshot is expired when it exceeds MinSnapshotsToKeep and MaxSnapshotAgeHours. |
region | string | AWS region. |
| Name | Datatype | Description |
|---|---|---|
table_arn | string | The Amazon Resource Name (ARN) of the specified table. |
region | string | AWS region. |
For more information, see AWS::S3Tables::Table.
Methods
| Name | Resource | Accessible by | Required Params |
|---|---|---|---|
create_resource | tables | INSERT | TableBucketARN, Namespace, TableName, OpenTableFormat, region |
delete_resource | tables | DELETE | Identifier, region |
update_resource | tables | UPDATE | Identifier, PatchDocument, region |
list_resources | tables_list_only | SELECT | region |
get_resource | tables | SELECT | Identifier, region |
SELECT examples
- get (all properties)
- list (identifiers only)
Gets all properties from an individual table.
SELECT
region,
without_metadata,
compaction,
namespace,
table_name,
table_bucket_arn,
version_token,
table_arn,
open_table_format,
iceberg_metadata,
warehouse_location,
snapshot_management
FROM awscc.s3tables.tables
WHERE
region = 'us-east-1' AND
Identifier = '{{ table_arn }}';
Lists all tables in a region.
SELECT
region,
table_arn
FROM awscc.s3tables.tables_list_only
WHERE
region = 'us-east-1';
INSERT example
Use the following StackQL query and manifest file to create a new table resource, using stack-deploy.
- Required Properties
- All Properties
- Manifest
/*+ create */
INSERT INTO awscc.s3tables.tables (
Namespace,
TableName,
TableBucketARN,
OpenTableFormat,
region
)
SELECT
'{{ namespace }}',
'{{ table_name }}',
'{{ table_bucket_arn }}',
'{{ open_table_format }}',
'{{ region }}';
/*+ create */
INSERT INTO awscc.s3tables.tables (
WithoutMetadata,
Compaction,
Namespace,
TableName,
TableBucketARN,
OpenTableFormat,
IcebergMetadata,
SnapshotManagement,
region
)
SELECT
'{{ without_metadata }}',
'{{ compaction }}',
'{{ namespace }}',
'{{ table_name }}',
'{{ table_bucket_arn }}',
'{{ open_table_format }}',
'{{ iceberg_metadata }}',
'{{ snapshot_management }}',
'{{ region }}';
version: 1
name: stack name
description: stack description
providers:
- aws
globals:
- name: region
value: '{{ vars.AWS_REGION }}'
resources:
- name: table
props:
- name: without_metadata
value: '{{ without_metadata }}'
- name: compaction
value:
status: '{{ status }}'
target_file_size_mb: '{{ target_file_size_mb }}'
- name: namespace
value: '{{ namespace }}'
- name: table_name
value: '{{ table_name }}'
- name: table_bucket_arn
value: '{{ table_bucket_arn }}'
- name: open_table_format
value: '{{ open_table_format }}'
- name: iceberg_metadata
value:
iceberg_schema:
schema_field_list:
- type: '{{ type }}'
required: '{{ required }}'
name: '{{ name }}'
- name: snapshot_management
value:
status: '{{ status }}'
min_snapshots_to_keep: '{{ min_snapshots_to_keep }}'
max_snapshot_age_hours: '{{ max_snapshot_age_hours }}'
UPDATE example
Use the following StackQL query and manifest file to update a table resource, using stack-deploy.
/*+ update */
UPDATE awscc.s3tables.tables
SET PatchDocument = string('{{ {
"Compaction": compaction,
"Namespace": namespace,
"TableName": table_name,
"SnapshotManagement": snapshot_management
} | generate_patch_document }}')
WHERE
region = '{{ region }}' AND
Identifier = '{{ table_arn }}';
DELETE example
/*+ delete */
DELETE FROM awscc.s3tables.tables
WHERE
Identifier = '{{ table_arn }}' AND
region = 'us-east-1';
Permissions
To operate on the tables resource, the following permissions are required:
- Read
- Create
- Update
- List
- Delete
s3tables:GetTable,
s3tables:GetTableMaintenanceConfiguration
s3tables:CreateTable,
s3tables:PutTableData,
s3tables:GetTable,
s3tables:PutTableMaintenanceConfiguration
s3tables:GetTable,
s3tables:RenameTable,
s3tables:PutTableMaintenanceConfiguration
s3tables:ListTables,
s3tables:ListTableBuckets,
s3tables:ListNamespaces
s3tables:GetTable,
s3tables:DeleteTable