Loading...
Loading...
Create managed Iceberg tables using Amazon S3 Tables (s3tables API namespace) with automatic compaction and snapshot management. Sets up table bucket, namespace, table, schema, Glue catalog registration, partitioning, IAM access control. Triggers on: create table, data lake table, analytics table, structured data storage, S3 Tables, Iceberg, Athena table, partitioning strategy, access permissions. Do NOT use for: importing files (use ingesting-into-data-lake), vector storage (use storing-and-querying-vectors), querying existing tables (use querying-data-lake), or locating existing table (use finding-data-lake-assets).
npx skill4agent add aws/agent-toolkit-for-aws creating-data-lake-tableaws glue get-tables --database-name <NAME>| What you find | Action |
|---|---|
| Fuzzy database name ("our analytics db") | You MUST STOP. Delegate to |
| Non-S3-Tables table with matching name | You MUST STOP. Delegate to |
| Existing S3 Tables table with matching name | You MUST check schema match. Reuse if compatible, recreate only if user confirms. |
| No matching tables | Proceed with creation (Steps 1-8). |
| User explicitly requests new S3 Tables table | Skip checks, proceed with creation. |
ingesting-into-data-lakereferences/table-creation-glue-etl.md"S3 Tables integration with Lake Formation"aws sts get-caller-identityingesting-into-data-lakereferences/best-practices.mdreferences/athena-ddl-path.mdGENERIC_INTERNAL_ERRORaws s3tables create-table-bucket --name <BUCKET_NAME> --region <REGION>table-bucket-arnreferences/best-practices.mdaws s3tables list-table-buckets"S3 Tables KMS key policy"references/best-practices.mdaws s3tables create-namespace --table-bucket-arn <ARN> --namespace <NAMESPACE>s3tablescatalogaws glue get-catalog --catalog-id s3tablescatalogglue:CreateCatalogglue:passConnectionaws glue create-catalog --name "s3tablescatalog" --catalog-input '{
"FederatedCatalog": {
"Identifier": "arn:aws:s3tables:<REGION>:<ACCOUNT_ID>:bucket/*",
"ConnectionName": "aws:s3tables"
},
"CreateDatabaseDefaultPermissions": [{"Principal": {"DataLakePrincipalIdentifier": "IAM_ALLOWED_PRINCIPALS"}, "Permissions": ["ALL"]}],
"CreateTableDefaultPermissions": [{"Principal": {"DataLakePrincipalIdentifier": "IAM_ALLOWED_PRINCIPALS"}, "Permissions": ["ALL"]}],
"AllowFullTableExternalDataAccess": "True"
}'aws glue get-catalogs --parent-catalog-id s3tablescatalogs3tables:*s3:*s3tables:GetTableBuckets3tables:GetNamespaces3tables:GetTables3tables:GetTableMetadataLocations3tables:GetTableDataglue:GetCatalogglue:GetDatabaseglue:GetTablereferences/access-control.md| Context | Path |
|---|---|
| Default (any user) | S3 Tables API (below) |
| User specifically wants SQL DDL | Athena DDL (see |
| Glue ETL pipeline | Spark DDL via |
aws s3tables create-table \
--table-bucket-arn <ARN> \
--namespace <NAMESPACE> \
--name <TABLE_NAME> \
--format ICEBERG \
--metadata '<METADATA_JSON>'"iceberg"{"iceberg":{"schema":{"fields":[
{"name":"order_date","type":"date","required":true},
{"name":"customer_id","type":"string","required":true},
{"name":"amount","type":"double","required":false}
]},
"partitionSpec":{"fields":[
{"sourceId":1,"fieldId":1000,"transform":"month","name":"order_date_month"}
]}}}partitionSpec.sourceIdreferences/athena-ddl-path.mdschemaV2references/best-practices.md"IcebergPartitionField S3 Tables"aws s3tables get-tableDESCRIBE <table_name>--query-execution-context '{"Catalog":"s3tablescatalog/<BUCKET_NAME>","Database":"<NAMESPACE>"}'| Error | Cause | Fix |
|---|---|---|
| "Table location can not be specified" | LOCATION in CREATE TABLE | Remove LOCATION clause. S3 Tables manages storage automatically. |
| Using | S3 Tables uses |
ingesting-into-data-lake