PluginBench
Skill
Pass
Audit score 90

creating-data-lake-table

aws/agent-toolkit-for-aws

Create managed Iceberg tables on Amazon S3 with automatic compaction and snapshot management.

What is creating-data-lake-table?

Sets up S3 Tables (Iceberg) with table bucket, namespace, schema, Glue catalog registration, partitioning, and IAM access control. Use this when you need to create a new analytics table in S3 that will be queried via Athena or Iceberg-compatible engines.

  • Create S3 table buckets with encryption and storage class options
  • Define Iceberg table schemas with typed columns and partition strategies
  • Register tables in AWS Glue Data Catalog via federated s3tablescatalog
  • Configure IAM access control using s3tables:* permissions
  • Set up automatic compaction and snapshot management
  • Verify table creation and queryability via Athena

How to install creating-data-lake-table

npx skills add https://github.com/aws/agent-toolkit-for-aws --skill creating-data-lake-table
Prerequisites
  • AWS CLI or AWS MCP server tools configured with appropriate credentials
  • AWS region and account ID confirmed via aws sts get-caller-identity
  • IAM permissions for s3tables:*, glue:*, and iam:* actions
  • Target database name or decision to create new namespace
Claude Code
Cursor
Windsurf
Cline

How to use creating-data-lake-table

  1. 1.Verify AWS credentials and region using aws sts get-caller-identity
  2. 2.Check for existing tables in target database with aws glue get-tables --database-name <NAME>
  3. 3.Define table schema: provide column names, Iceberg types, and partition strategy
  4. 4.Create table bucket with aws s3tables create-table-bucket --name <BUCKET_NAME> --region <REGION>
  5. 5.Create namespace with aws s3tables create-namespace --table-bucket-arn <ARN> --namespace <NAMESPACE>
  6. 6.Verify or create s3tablescatalog in Glue with aws glue get-catalog --catalog-id s3tablescatalog
  7. 7.Configure IAM bucket policy and role permissions for querying principals using s3tables:* actions
  8. 8.Create table with aws s3tables create-table using schema and partition spec in metadata JSON

Use cases

Good for
  • Create a new partitioned analytics table for time-series data (e.g., daily order events)
  • Set up a data lake table for ETL pipelines to write structured data
  • Establish a managed Iceberg table with schema versioning for evolving datasets
  • Create multiple namespaced tables within a single S3 table bucket for data organization
  • Configure access control so specific IAM principals can query tables via Athena
Who it's for
  • Data engineers setting up data lakes
  • Analytics teams building Iceberg-based warehouses
  • AWS administrators managing S3 Tables infrastructure
  • ETL pipeline developers needing managed table storage

creating-data-lake-table FAQ

When should I use this skill vs. ingesting-into-data-lake?

Use this skill to create the empty table structure first. Use ingesting-into-data-lake to load existing S3 data into the table afterward.

Can I use S3 Tables with existing data in S3?

Yes. Create the empty table with this skill, then use ingesting-into-data-lake to ingest your existing S3 data into it.

What IAM permissions do querying principals need?

Querying principals need s3tables:GetTableBucket, s3tables:GetNamespace, s3tables:GetTable, s3tables:GetTableMetadataLocation, s3tables:GetTableData (bucket policy) and glue:GetCatalog, glue:GetDatabase, glue:GetTable (IAM policy). See references/access-control.md for exact ARN patterns.

Can I modify the schema after table creation?

Yes. Use Athena DDL for schema evolution after creation. See references/athena-ddl-path.md for the SQL DDL path.

Why does table creation fail with GENERIC_INTERNAL_ERROR?

Glue rejects mixed-case names. Use all lowercase for namespace and table names, and avoid hyphens in names.

Full instructions (SKILL.md)

Source of truth, from aws/agent-toolkit-for-aws.


name: creating-data-lake-table description: >- 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). version: 1 argument-hint: '[table-description|schema-spec]'

Create Data Lake Tables with Amazon S3 Tables

Overview

Amazon S3 Tables provides managed Iceberg tables with automatic compaction and snapshot management. Queryable via Athena and Iceberg-compatible engines.

Common Tasks

You MUST use AWS MCP server tools when connected, they provide command validation, sandboxed execution, and audit logging. Fall back to AWS CLI if MCP unavailable.

Decision Guide

Before creating, You MUST check what exists:

You MUST run aws glue get-tables --database-name <NAME> when user mentions a database.

What you findAction
Fuzzy database name ("our analytics db")You MUST STOP. Delegate to finding-data-lake-assets to resolve.
Non-S3-Tables table with matching nameYou MUST STOP. Delegate to finding-data-lake-assets. You MUST NOT create until user confirms.
Existing S3 Tables table with matching nameYou MUST check schema match. Reuse if compatible, recreate only if user confirms.
No matching tablesProceed with creation (Steps 1-8).
User explicitly requests new S3 Tables tableSkip checks, proceed with creation.

Creation paths:

  • Existing data in S3: Create empty table (Steps 1-8), then use ingesting-into-data-lake skill.
  • Glue ETL pipeline: Read references/table-creation-glue-etl.md first, then Steps 1-6.
  • Lake Formation access control: Search AWS docs for "S3 Tables integration with Lake Formation".

1. Verify Dependencies

Constraints:

  • You MUST check whether AWS MCP server tools or AWS CLI are available and inform user if missing
  • You MUST confirm target AWS region and verify credentials with aws sts get-caller-identity

2. Understand the Schema

  • Explicit schema: Validate Iceberg types.
  • Loose description: Ask columns, types, grain. Propose and confirm.
  • Existing S3 data: Infer schema from file headers only. Create empty table first, then use ingesting-into-data-lake skill.

Constraints:

  • You MUST read references/best-practices.md for Iceberg type mapping, partitions, and naming.
  • You MUST ask for all required parameters upfront: table name, columns, types, partition strategy. For schema evolution, see references/athena-ddl-path.md.
  • You MUST use all lowercase names -- Glue rejects mixed case with GENERIC_INTERNAL_ERROR. Namespace and table names MUST NOT contain hyphens.
  • You SHOULD suggest partition columns based on access patterns.

3. Create Table Bucket

Names: 3-63 chars, lowercase, numbers, hyphens.

aws s3tables create-table-bucket --name <BUCKET_NAME> --region <REGION>

Capture table-bucket-arn. Encryption (SSE-S3 default, SSE-KMS) and storage class (STANDARD, INTELLIGENT_TIERING) set at creation. See references/best-practices.md.

Constraints:

  • You MUST check existing buckets with aws s3tables list-table-buckets and ask user to select or create new.
  • If using SSE-KMS, KMS key policy MUST allow S3 Tables maintenance service principal to read data. Search AWS docs for "S3 Tables KMS key policy" for required policy.
  • If bucket creation fails, see references/best-practices.md for common errors.

4. Create Namespace

aws s3tables create-namespace --table-bucket-arn <ARN> --namespace <NAMESPACE>

Constraints:

  • You MUST list existing namespaces first and suggest reusing if relevant
  • You MUST use lowercase names with no hyphens

5. Create Glue Data Catalog Integration

Check if s3tablescatalog exists (create once per region per account):

aws glue get-catalog --catalog-id s3tablescatalog

If not found, create (requires glue:CreateCatalog, glue:passConnection):

aws 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"
}'

Verify with aws glue get-catalogs --parent-catalog-id s3tablescatalog.

6. Configure Access Control

S3 Tables uses s3tables:* IAM namespace (not s3:*).

Querying principal permissions (bucket policy):

  • s3tables:GetTableBucket, s3tables:GetNamespace, s3tables:GetTable, s3tables:GetTableMetadataLocation, s3tables:GetTableData

Querying principal permissions (IAM policy):

  • glue:GetCatalog, glue:GetDatabase, glue:GetTable

You MUST scope to correct ARN patterns. You MUST read references/access-control.md for exact resource ARNs.

Constraints:

  • You MUST ask user for querying principal ARN
  • You MUST NOT grant broader permissions than necessary
  • You MUST NOT create IAM roles automatically, verify existing and guide user

7. Create the Table

ContextPath
Default (any user)S3 Tables API (below)
User specifically wants SQL DDLAthena DDL (see references/athena-ddl-path.md)
Glue ETL pipelineSpark DDL via --conf job args (not spark.conf.set()). You MUST read references/table-creation-glue-etl.md for the --conf string.

Default: S3 Tables API:

aws s3tables create-table \
  --table-bucket-arn <ARN> \
  --namespace <NAMESPACE> \
  --name <TABLE_NAME> \
  --format ICEBERG \
  --metadata '<METADATA_JSON>'

Metadata JSON MUST nest under "iceberg" key:

{"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"}
]}}}

Constraints:

  • partitionSpec.sourceId MUST reference a valid schema field ID
  • For schema evolution after creation, use Athena DDL. See references/athena-ddl-path.md
  • You MUST use schemaV2 for complex types (list, map, struct) with explicit field IDs. See references/best-practices.md.
  • You SHOULD search AWS docs for "IcebergPartitionField S3 Tables" for supported partition transforms

8. Verify and Confirm

You MUST verify with aws s3tables get-table and confirm queryability with DESCRIBE <table_name> via Athena using --query-execution-context '{"Catalog":"s3tablescatalog/<BUCKET_NAME>","Database":"<NAMESPACE>"}'. Do NOT put catalog in SQL. Present summary: bucket ARN, namespace, table, schema, partitions.

Troubleshooting

ErrorCauseFix
"Table location can not be specified"LOCATION in CREATE TABLERemove LOCATION clause. S3 Tables manages storage automatically.
AccessDeniedException with s3:* policyUsing s3:* not s3tables:*S3 Tables uses s3tables:* namespace. Update IAM policy.

Additional Resources

Related skills

More from aws/agent-toolkit-for-aws and the wider catalog.

CRcreating-ec2-image-builder-pipeline logo

creating-ec2-image-builder-pipeline

aws/agent-toolkit-for-aws

Creates a complete EC2 Image Builder pipeline that builds a custom AMI with pre-installed software, distributes it to target regions, executes the pipeline, and creates a launch template. Use when setting up automated AMI creation with IAM roles, build components, image recipes, and infrastructure configuration.

1.2k installs
CRcreating-production-vpc-multi-az logo

creating-production-vpc-multi-az

aws/agent-toolkit-for-aws

Creates a production-ready VPC with public and private subnets across multiple Availability Zones, including internet gateway, NAT gateways, route tables, and security groups following AWS Well-Architected principles. Use when deploying multi-AZ VPC infrastructure with automatic CIDR planning and DNS resolution.

1.2k installsAudited
CRcreating-secrets-using-best-practices logo

creating-secrets-using-best-practices

aws/agent-toolkit-for-aws

Create and manage AWS Secrets Manager secrets with production-grade security controls and best practices.

1.4k installs
DEdebugging-lambda-timeouts logo

debugging-lambda-timeouts

aws/agent-toolkit-for-aws

Systematically debug AWS Lambda timeout failures by analyzing configuration, logs, metrics, and dependencies.

1.3k installsAudited
ENenabling-lambda-vpc-internet-access logo

enabling-lambda-vpc-internet-access

aws/agent-toolkit-for-aws

Enables internet access for AWS Lambda functions deployed in VPC subnets by creating NAT Gateway infrastructure, configuring public/private subnet routing, and updating security groups. Use when a VPC-attached Lambda function cannot reach the internet.

1.2k installsAudited
EXexploring-data-catalog logo

exploring-data-catalog

aws/agent-toolkit-for-aws

Full inventory and audit of AWS Glue Data Catalog, S3 Tables, Redshift-federated, and remote Iceberg catalogs.

1.5k installsAudited