Amazon S3 Tables(Amazon S3 上のテーブルサービス)を使って、Iceberg テーブル(オープンソースの列指向データ形式)を自動的に最適化・管理される状態で作成します。テーブル用の保存領域、ネームスペース(階層的な名前空間)、テーブル、スキーマ(データ構造の定義)の設定、AWS Glue(データカタログサービス)への登録、データの分割方法、アクセス権限の設定を行います。 **次のような場合に使用:** - テーブルを新たに作成する - データレイク(大規模データ保管場所)用のテーブルを設定する - 分析用のテーブルが必要 - 構造化されたデータを保存したい - S3 Tables や Iceberg を活用したい - Athena(SQL クエリサービス)で使うテーブルを作成する - データの分割戦略を決めたい - アクセス権限を設定したい **このスキルを使わないケース:** - ファイルを既存のデータレイクに読み込む場合 → 「データレイクへの取り込み」スキルを使用 - ベクトル(多次元データ)を保存・検索する場合 → 「ベクトル保存・検索」スキルを使用 - すでに存在するテーブルにクエリを実行する場合 → 「データレイク検索」スキルを使用 - 既存のテーブルの位置を特定する場合 → 「データレイク資産の検索」スキルを使用
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).
Amazon S3 Tables は、自動コンパクションとスナップショット管理を備えたマネージド Iceberg テーブルを提供します。 Athena および Iceberg 互換エンジンからクエリ可能です。
MCP サーバーツールに接続されている場合は、必ず AWS MCP サーバーツールを使用してください。 これらはコマンドバリデーション、サンドボックス実行、および監査ログを提供します。 MCP が利用できない場合は AWS CLI にフォールバックしてください。
作成前に、必ず既存リソースを確認してください:
ユーザーがデータベースに言及した場合は、必ず aws glue get-tables --database-name <NAME> を実行してください。
| 確認結果 | アクション |
|---|---|
| あいまいなデータベース名(「うちの分析用 DB」など) | 必ず停止すること。 finding-data-lake-assets に委任して解決する。 |
| 同名の非 S3 Tables テーブルが存在する | 必ず停止すること。 finding-data-lake-assets に委任する。ユーザーが確認するまで作成してはならない。 |
| 同名の S3 Tables テーブルが既に存在する | 必ずスキーマの一致を確認すること。互換性があれば再利用し、再作成はユーザーが確認した場合のみ行う。 |
| 一致するテーブルが存在しない | 作成に進む(ステップ 1〜8)。 |
| ユーザーが新規 S3 Tables テーブルを明示的に要求している | 確認をスキップし、作成に進む。 |
作成パス:
ingesting-into-data-lake スキルを使用する。references/table-creation-glue-etl.md を参照し、その後ステップ 1〜6 を実行する。"S3 Tables integration with Lake Formation" を検索する。制約:
aws sts get-caller-identity でクレデンシャルを検証することingesting-into-data-lake スキルを使用する。制約:
references/best-practices.md を参照すること。references/athena-ddl-path.md を参照。GENERIC_INTERNAL_ERROR で拒否する。Namespace およびテーブル名にハイフンを含めてはならない。名前の制約: 3〜63 文字、小文字、数字、ハイフンのみ使用可能。
aws s3tables create-table-bucket --name <BUCKET_NAME> --region <REGION>
table-bucket-arn を取得して保存すること。
暗号化(デフォルトは SSE-S3、SSE-KMS も可)およびストレージクラス(STANDARD、INTELLIGENT_TIERING)は作成時に設定します。
references/best-practices.md を参照してください。
制約:
aws s3tables list-table-buckets で既存バケットを確認し、既存バケットの選択または新規作成についてユーザーに確認すること。"S3 Tables KMS key policy" を検索すること。references/best-practices.md で一般的なエラーを確認すること。aws s3tables create-namespace --table-bucket-arn <ARN> --namespace <NAMESPACE>
制約:
s3tablescatalog が存在するか確認します(アカウントおよびリージョンごとに 1 回のみ作成):
aws glue get-catalog --catalog-id s3tablescatalog
見つからない場合は作成します(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"
}'
aws glue get-catalogs --parent-catalog-id s3tablescatalog で確認してください。
S3 Tables は s3:* ではなく s3tables:* の IAM 名前空間を使用します。
クエリプリンシパルの権限(バケットポリシー):
s3tables:GetTableBucket、s3tables:GetNamespace、s3tables:GetTable、s3tables:GetTableMetadataLocation、s3tables:GetTableDataクエリプリンシパルの権限(IAM ポリシー):
glue:GetCatalog、glue:GetDatabase、glue:GetTable正しい ARN パターンにスコープを絞ること。正確なリソース ARN については必ず references/access-control.md を参照すること。
制約:
| 状況 | パス |
|---|---|
| デフォルト(一般ユーザー) | S3 Tables API(以下参照) |
| ユーザーが SQL DDL を明示的に希望する場合 | Athena DDL(references/athena-ddl-path.md 参照) |
| Glue ETL パイプラインの場合 | --conf ジョブ引数経由の Spark DDL(spark.conf.set() は使用不可)。--conf 文字列については必ず references/table-creation-glue-etl.md を参照すること。 |
デフォルト: S3 Tables API:
aws s3tables create-table \
--table-bucket-arn <ARN> \
--namespace <NAMESPACE> \
--name <TABLE_NAME> \
--format ICEBERG \
--metadata '<METADATA_JSON>'
メタデータ 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.sourceId は有効なスキーマフィールド ID を参照しなければならないreferences/athena-ddl-path.md を参照。schemaV2 を必ず使用すること。references/best-practices.md を参照。"IcebergPartitionField S3 Tables" を検索することが推奨されるaws s3tables get-table で必ず検証し、--query-execution-context '{"Catalog":"s3tablescatalog/<BUCKET_NAME>","Database":"<NAMESPACE>"}' を指定した Athena 経由で DESCRIBE <table_name> を実行してクエリ可能であることを確認すること。
カタログは SQL 文内に記述しないこと。
最後に以下の情報を要約として提示すること: バケット ARN、Namespace、テーブル、スキーマ、パーティション。
| エラー | 原因 | 対処法 |
|---|---|---|
| "Table location can not be specified" | CREATE TABLE に LOCATION 句が含まれている | LOCATION 句を削除すること。S3 Tables はストレージを自動管理する。 |
s3:* ポリシーによる AccessDeniedException |
s3tables:* ではなく s3:* を使用している |
S3 Tables は s3tables:* 名前空間を使用する。IAM ポリシーを更新すること。 |
ingesting-into-data-lake スキルAmazon S3 Tables provides managed Iceberg tables with automatic compaction and snapshot management. Queryable via Athena and Iceberg-compatible engines.
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.
Before creating, You MUST check what exists:
You MUST run aws glue get-tables --database-name <NAME> when user mentions a database.
| What you find | Action |
|---|---|
| Fuzzy database name ("our analytics db") | You MUST STOP. Delegate to finding-data-lake-assets to resolve. |
| Non-S3-Tables table with matching name | You MUST STOP. Delegate to finding-data-lake-assets. You MUST NOT create until user confirms. |
| 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. |
Creation paths:
ingesting-into-data-lake skill.references/table-creation-glue-etl.md first, then Steps 1-6."S3 Tables integration with Lake Formation".Constraints:
aws sts get-caller-identityingesting-into-data-lake skill.Constraints:
references/best-practices.md for Iceberg type mapping, partitions, and naming.references/athena-ddl-path.md.GENERIC_INTERNAL_ERROR. Namespace and table names MUST NOT contain hyphens.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:
aws s3tables list-table-buckets and ask user to select or create new."S3 Tables KMS key policy" for required policy.references/best-practices.md for common errors.aws s3tables create-namespace --table-bucket-arn <ARN> --namespace <NAMESPACE>
Constraints:
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.
S3 Tables uses s3tables:* IAM namespace (not s3:*).
Querying principal permissions (bucket policy):
s3tables:GetTableBucket, s3tables:GetNamespace, s3tables:GetTable, s3tables:GetTableMetadataLocation, s3tables:GetTableDataQuerying principal permissions (IAM policy):
glue:GetCatalog, glue:GetDatabase, glue:GetTableYou MUST scope to correct ARN patterns. You MUST read references/access-control.md for exact resource ARNs.
Constraints:
| Context | Path |
|---|---|
| Default (any user) | S3 Tables API (below) |
| User specifically wants SQL DDL | Athena DDL (see references/athena-ddl-path.md) |
| Glue ETL pipeline | Spark 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 IDreferences/athena-ddl-path.mdschemaV2 for complex types (list, map, struct) with explicit field IDs. See references/best-practices.md."IcebergPartitionField S3 Tables" for supported partition transformsYou 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.
| Error | Cause | Fix |
|---|---|---|
| "Table location can not be specified" | LOCATION in CREATE TABLE | Remove LOCATION clause. S3 Tables manages storage automatically. |
AccessDeniedException with s3:* policy |
Using s3:* not s3tables:* |
S3 Tables uses s3tables:* namespace. Update IAM policy. |
ingesting-into-data-lake skill原文・著作権は Anthropic および各プラグイン作者に帰属します。日本語訳は Claude API による自動翻訳です。