Migrating Hive Tables To S3 Tables
AWSOfficialPublished by AWS
- Skill
- Workflow
- Cloud and DevOps
- Apache-2.0
- No issues found
AutoGineer summary
Written by AutoGineer from the skill’s own files, not by the author
This skill provides a structured workflow for migrating existing Glue Data Catalog Hive Parquet tables into Amazon S3 Tables as managed Iceberg tables. It utilizes the native S3 Tables migration API to handle planning, data copying, and synchronization. The process includes rigorous pre-migration guardrails, plan review, and post-migration validation to ensure data integrity and compatibility before final cutover.
What it does
- Performs pre-migration compatibility checks on source Glue Hive tables.
- Generates and reviews migration plans for schema and object compatibility.
- Executes the migration process using native S3 Tables API calls.
- Synchronizes the destination table with the source until final cutover.
- Validates row counts and sample data parity between source and destination.
- Promotes the destination table to a read-write state upon successful validation.
When to use it
- When migrating a Glue Data Catalog Hive Parquet table to S3 Tables.
- When you need to keep the destination table in sync with the source before cutover.
- When you want to use the native S3 Tables migration service rather than manual ETL jobs.
- When you need to verify compatibility and plan the migration before execution.
Advantages
- Uses native, managed service calls for reliable table migration.
- Includes built-in validation steps to ensure data parity.
- Supports incremental synchronization to minimize downtime.
- Provides clear guardrails to prevent common configuration errors.
Usage examples
- “Migrate my Glue Hive table sales_data into my table bucket sales-bucket.”
- The agent will initiate the pre-migration checks, generate a migration plan, and present it for your approval.
- “Keep my migrated table in sync with the source before cutover.”
- The agent will execute the SyncTableMigration API to apply any recent changes from the source to the destination.
- “Complete my migrated table.”
- The agent will perform final validation and promote the destination table to read-write status.
Install
Download the skill as a ZIP:
https://autogineer.com/agent-skills/aws/migrating-hive-tables-to-s3-tables/downloadUnzip it into the cross-client skills folder of your project:
mkdir -p .agents/skills && unzip migrating-hive-tables-to-s3-tables.zip -d .agents/skills
Documentation by AWS
Migrating Hive Tables to S3 Tables
Contents
Overview
Before you migrate
When to use
When NOT to use (use another skill)
Scope and constraints
The 6 migration APIs
Migration lifecycle
Pre-migration guardrails
Post-migration guardrails
Key API shapes
Security considerations
References
Overview
This skill guides an agent through migrating one Glue Hive Parquet table into an S3 table bucket with the native S3 Tables migration API. Amazon S3 Tables plans the migration, reports column and object compatibility, copies the data, and keeps the destination in sync with the source until you complete it. Your coding agent, following this skill, runs preflight checks, starts the migration, presents the plan for approval, monitors progress, completes the migration, and validates the result.
When the AWS MCP Server is available, use it to load this skill and its references
(aws___retrieve_skill, with file="references/<name>.md") and to run the AWS calls.
Before you migrate
Agent instruction: You MUST present the migration plan and obtain explicit user approval
before any step that changes tables, data, metadata, or catalog entries, and before any IAM, KMS,
or S3 bucket change (creating or editing a role or policy, editing a key policy, creating a report
bucket). Show the exact JSON or command first. For a key policy, read it with get-key-policy,
add one statement, and never replace the whole policy. The plan MUST list:
the source table and the destination table bucket, namespace, and table name;
the write paths that will change (ETL jobs, streaming or ingest,
INSERT/MERGE, CDC);the query engines and downstream consumers that read the table;
the datasets, saved queries, and permissions that reference the old Glue table or S3 prefix.
Up-front approval in the user's request (naming the source, destination, and intent to migrate)
covers only read-only checks and a Start with plan review. Approving the plan, accepting any
setNull or drop policy, Complete, and any delete always need explicit approval during the
conversation. If the actual state differs from what was approved (a different schema,
partition layout, row count, or resource), stop, explain the difference, and get approval again.
Confirm these constraints with the user as part of the plan:
Every writer to the destination writes through an Iceberg-aware engine (for example Athena, EMR or Glue with Iceberg). Writers that write Parquet files directly to S3 will not work.
Every reader supports Iceberg and the S3 Tables catalog.
Jobs and queries move from the Glue Hive table to the S3 Tables catalog reference.
The source is not changed. Keep writers on the source until the destination is validated.
Validate row counts and sample values (references/validation.md) before moving production traffic.
See Migrating tables to S3 Tables for the full list of supported sources and limits.
Runtime: works with or without the AWS MCP server; steps use AWS CLI syntax. The AWS MCP server is recommended for sandboxed execution and audit logging. The migration commands are part of
aws s3tables; if an older CLI lacks them, see references/api-setup.md.
When to use
Use this skill when the source is a Glue Data Catalog Hive table with Parquet data
(TableType=EXTERNAL_TABLE, Hive Parquet SerDe) and the destination is an S3 table bucket in the
same account and Region:
Migrating that table into S3 Tables as managed Iceberg with the native migration API.
Keeping the migrated table in sync with the active Hive source before cutover.
When NOT to use (use another skill)
The names below are other agent skills. For these requests, do not use this skill; load the named skill instead. When asked when not to use this skill, list every case:
A self-run CTAS, Glue ETL, or EMR/Spark migration into Iceberg: use the
ingesting-into-data-lakeskill (this skill covers only the managed migration API).Converting a self-managed or standard Iceberg table: use the
ingesting-into-data-lakeskill.Loading raw files (Parquet with no Glue table, CSV, JSON) or other sources (JDBC, Snowflake, BigQuery, DynamoDB): use the
ingesting-into-data-lakeskill.Creating a new empty Iceberg table: use the
creating-data-lake-tableskill.Running or managing Athena queries: use the
querying-data-lakeskill.Locating tables or assets: use the
finding-data-lake-assetsskill. Auditing the catalog: use theexploring-data-catalogskill.Setting up Glue connections: use the
connecting-to-data-sourceskill.Any destination other than S3 Tables.
Prompt patterns (trigger phrasings)
"Migrate my Glue Hive table
<db>.<tbl>into my table bucket<name>.""Import an existing Hive table into S3 Tables using the native migration API."
"Move my Parquet Hive table to Iceberg without running CTAS or a Glue/Spark job."
"Use StartTableMigration to convert
<tbl>.""Keep my migrated table in sync with the source before cutover" → Sync.
"Complete my migrated table" → Complete.
"Check the status or plan of migration
<id>" → Get."List my table migrations" → List.
Scope and constraints
Source: Glue Hive Parquet table in the same account and region as the destination table bucket.
Destination: an existing S3 table bucket and namespace; the migration creates the table.
Not supported (confirm the current list in the S3 Tables migration guide): Lake Formation registered tables, partitions outside the table location, non-Parquet formats, Iceberg sources, cross-account, SSE-C, and archived storage classes. Check these in preflight and stop if any apply. For a Lake Formation registered table, tell the user it is not supported and suggest contacting AWS Support or their account team with the migration ID to request support. Never change Lake Formation settings.
Compatibility problems are reported during planning. Always review the plan before approving.
All-or-nothing copy: if a single object fails, the whole migration fails. A
succeededrun has no failed objects.Three reports are written to a general-purpose bucket you supply: table compatibility, object compatibility, and object migration.
Cost and duration: the migration writes a second copy of the data; plan for roughly double storage until the source is decommissioned. Large tables can take hours.
Quotas: see S3 Tables quotas.
Migration policies: by default an incompatible column fails the run.
incompatibleValuesPolicy: setNullandunmatchedSourceFieldsPolicy: dropapply to the whole column and the run still reportssucceeded. Treat anysetNullordroppedcolumn as data loss that needs explicit approval.
The 6 migration APIs
| API | Purpose | Phase |
|---|---|---|
StartTableMigration | Plan and begin a migration. With --review-migration-plan, pauses at pendingReview. | Start |
GetTableMigration | Returns state, hasValidPlan, planningStats, migrationStats, migrationOutput, failureReason. | Track, review |
UpdateTableMigration | Approve (--requested-state queued) or cancel. | Approve |
SyncTableMigration | Apply source changes since the last plan; repeat until current. | Sync |
CompleteTableMigration | Promote the destination to read-write. Takes --table-arn. Returns an empty body; the migration state stays succeeded. Confirm with get-table (managedByService is null). | Complete |
ListTableMigrations | List migrations for one table bucket or table. | Discover |
Request and response shapes are in references/lifecycle.md.
Migration lifecycle (phases)
Preflight → references/preflight.md, references/iam-roles.md
Start and plan:
start-table-migration --review-migration-plan;planning→pendingReview.Review:
get-table-migration; read the compatibility reports and present the plan for approval.Approve and migrate:
update-table-migration --requested-state queued; pollmigrating→succeeded.Sync (optional):
sync-table-migration; repeat until current.Validate: on the
succeededtable, before Complete, query the destination in Athena and compare with the source → references/validation.md. Validation is part of every migration: run the row-count and sample checks without being asked, unless the user opts out. If counts are short, reconcile withsync-table-migration(not possible after Complete).Complete: once parity holds and the user approves,
complete-table-migration --table-arn ..., then confirmget-tableshowsmanagedByServicenull.
Phases 2 to 7 are in references/lifecycle.md.
Pre-migration guardrails (run every time, before Start)
Do not call start-table-migration until all of these pass. Commands are in
references/preflight.md and references/iam-roles.md.
Plan approved. The plan in Before you migrate has been presented and approved.
Credentials and region.
sts get-caller-identitysucceeds; the source and destination are in the same account and region.Source is Glue Hive Parquet.
TableType=EXTERNAL_TABLE, Hive Parquet format and SerDe; not Iceberg, not ACID/transactional, no storage handler. RecordcatalogId.Partition locations. Every partition location is under the table location; partitions outside it fail planning with
UNSUPPORTED_PARTITIONS. Check for partition projection andskip.header.line.count.Lake Formation. If the source table or its location is registered with Lake Formation, stop: not supported (confirm current support in the migration guide). Do not change Lake Formation settings.
Destination exists. The table bucket and namespace exist. A missing namespace fails Start with
NotFoundException.Migration role trust. One statement, principal
migration.s3tables.amazonaws.com, conditionsaws:SourceAccountandaws:SourceArn.Migration role permissions. Scoped source S3 and Glue read, destination write, report bucket write. The caller also needs
iam:PassRoleon the role, conditioned oniam:PassedToService=migration.s3tables.amazonaws.com.KMS. If data is encrypted with a customer managed key, grant
kms:Decryptandkms:GenerateDataKey. For an SSE-KMS destination, the key policy must also allowmaintenance.s3tables.amazonaws.com, or table creation fails and planning never completes (see preflight §7 and IAM roles).
Post-migration guardrails (verify success before Complete)
Full detail in references/validation.md.
Run checks 1 to 7 on the succeeded table before Complete, because Sync is refused after Complete. After Complete, only confirm that get-table shows managedByService null.
Terminal state:
state: succeeded,failureReasonnull.Object accounting:
objectsFailedMigrationis 0 andobjectsMigratedmatches the planned object count. If it differs, check the source object count (an extra file from an earlier sync is legitimate) and confirm with row-count parity before treating it as a failure.Row count parity: destination
count(*)equals source.Partition parity: per-partition row counts match (partitioned tables).
Spot-check rows: sample values match, including converted columns such as timestamps.
Schema review: every column's type label (
Lossless,Widened,Converted) was accepted in the plan; none isIncompatibleorUnsupported.Catalog naming: query as
"s3tablescatalog/<table-bucket>"."<namespace>"."<table>".
Key API shapes
sourceType=glueTable(top level) andsource={"glueTable":{"catalogId":"<acct>","databaseName":"<db>","tableName":"<tbl>"}}.catalogIdis required. The role member isroleARN.--destination-table={"tableBucketARN":"<arn>","namespace":"<ns>","name":"<tbl>"}.migrationOutputis required:{bucket, prefixes}, wherebucketis a general-purpose bucket ARN andprefixesoptionally setstableCompatibilityReport,objectCompatibilityReport,objectMigrationReport.Optional
dataMigration.migrationPolicies:unmatchedSourceFieldsPolicy(fail|drop),incompatibleValuesPolicy(fail|setNull). Both defaultfail.Do not add
sts:ExternalIdto the trust policy; Amazon S3 Tables does not send one.States:
new → planning → pendingReview → queued → migrating → succeeded, plusfailed,cancelling,cancelled.On cancel or failure the destination table is kept. If
hasValidPlanis true, resume withsync-table-migration; otherwise delete the table and start again. Rules in references/lifecycle.md.Complete only a
succeededmigration. Completing twice returns409 ConflictExceptionor400 BadRequestException; treat either as "already done."Athena reference:
"s3tablescatalog/<table-bucket>"."<namespace>"."<table>". Requires the table bucket to be integrated with the Glue Data Catalog.
Security considerations
Instructions only; no shipped code or dependencies.
Migration role: trusts
migration.s3tables.amazonaws.comwithaws:SourceAccountandaws:SourceArnconditions; permissions scoped to the exact source, destination, and report resources.Encryption: SSE-KMS on the destination table bucket and report bucket is recommended, with TLS-only bucket policies. A customer managed destination key must allow
maintenance.s3tables.amazonaws.comin its key policy.Logging: enable CloudTrail for the migration APIs and role assumptions, S3 data-event or server-access logging on the buckets involved, and CloudWatch alarms on failures. Encrypt log destinations.
No secrets in generated commands, reports, or state files.
References
| File | Topic |
|---|---|
| references/api-setup.md | Confirming the migration commands are in the aws s3tables CLI |
| references/preflight.md | Credentials, source checks, partition locations, Lake Formation, destination |
| references/iam-roles.md | Caller policy and migration role trust and permissions |
| references/lifecycle.md | State machine and per-phase calls: start, review, approve, sync, complete |
| references/validation.md | Athena row-count, aggregate, and sample checks; catalog naming |
| references/troubleshooting.md | failureReason codes and fixes |
Files
- ATTRIBUTION.mdAdded by AutoGineer957 B
- LICENSELicence file added by AutoGineer9.9 KiB
- NOTICELicence file added by AutoGineer67 B
- SKILL.md16.1 KiB
- references/api-setup.md1.0 KiB
- references/iam-roles.md18.9 KiB
- references/lifecycle.md20.4 KiB
- references/preflight.md12.6 KiB
- references/troubleshooting.md7.8 KiB
- references/validation.md4.9 KiB
references/iam-roles.md
IAM roles
Two roles are involved: the caller (the identity that runs the CLI) and the migration service role (the customer-provided role S3 Tables assumes to read the source and write the destination). Sections 1, 3, and 4 are the migration service role's trust and permission policies. Section 2 notes that Lake Formation registered sources are not supported (confirm current support in the migration guide).
Placeholders (shared by the policies below): ${Partition} (e.g. aws), ${Region},
${AccountId}, ${GlueDatabaseName}, ${GlueTableName}, ${SourceBucketName},
${NormalizedSourcePrefix}, ${TableBucketName}, ${NamespaceName}, ${TableName},
${DestinationTableArn}, ${ReportBucketName}, ${NormalizedReportPrefix}, ${SourceKmsKeyArn},
${DestinationKmsKeyArn}, ${ReportKmsKeyArn}. The three KMS placeholders apply only when that
resource uses a customer managed key; with SSE-S3 end to end, omit the KMS statements.
Discover before asking
Do not interrogate the customer about IAM plumbing. Take the account id and caller identity from
sts get-caller-identity, and search for an existing migration service role before proposing to
create one. A name substring like igration/S3Tables is only a coarse first pass, it also
matches DMS, MigrationHub, and partner roles, so confirm a candidate by its trust policy
(which must name migration.s3tables.amazonaws.com with the aws:SourceAccount/aws:SourceArn
conditions), not by its name. If you find a role that appears suitable, do NOT use it silently: present it to the user (its ARN, trust principal, and how
it matches the requirements below) and ask them to confirm before using it, because that role
lets S3 Tables read the source and write the destination on their behalf. If discovery finds no
suitable role, offer to create one. If a role exists but is missing a required principal or permission, report exactly what is missing and let the user fix it, rather than modifying their role. For non-role resources (report bucket, namespace),
resolve and state what you resolved so the user can correct you. See references/preflight.md §0.5.
Caller policy (the identity running the CLI)
Scope Resource to the specific destination table-bucket ARN(s) the caller migrates into rather
than * (least privilege). Broaden only if the caller genuinely drives migrations across many
buckets.
{
"Version": "2012-10-17",
"Statement": [{
"Effect": "Allow",
"Action": [
"s3tables:StartTableMigration",
"s3tables:SyncTableMigration",
"s3tables:UpdateTableMigration",
"s3tables:CompleteTableMigration",
"s3tables:GetTableMigration",
"s3tables:ListTableMigrations"
],
"Resource": [
"arn:${Partition}:s3tables:${Region}:${AccountId}:bucket/${TableBucketName}",
"arn:${Partition}:s3tables:${Region}:${AccountId}:bucket/${TableBucketName}/*"
]
}]
}The preflight and plan-review steps also run regular s3tables reads the six migration actions do
not cover: list-table-buckets / list-namespaces / create-namespace (preflight §4) and
get-table (the Complete confirmation reads managedByService). Grant the caller these too, or
state that the caller is assumed to already hold them:
{
"Effect": "Allow",
"Action": [
"s3tables:ListNamespaces",
"s3tables:GetNamespace",
"s3tables:CreateNamespace",
"s3tables:GetTable"
],
"Resource": [
"arn:${Partition}:s3tables:${Region}:${AccountId}:bucket/${TableBucketName}",
"arn:${Partition}:s3tables:${Region}:${AccountId}:bucket/${TableBucketName}/*"
]
}s3tables:ListTableBuckets is account-scoped (it takes Resource: "*"); grant it separately only
if the caller must discover table buckets rather than being handed the destination ARN.
Also add a second statement for iam:PassRole on the migration service role's ARN, conditioned on iam:PassedToService so the caller can only hand that role to the migration service:
{
"Effect": "Allow",
"Action": "iam:PassRole",
"Resource": "arn:${Partition}:iam::${AccountId}:role/<MIGRATION_ROLE>",
"Condition": {
"StringEquals": {
"iam:PassedToService": "migration.s3tables.amazonaws.com"
}
}
}During plan review your coding agent reads the compatibility report from the report bucket (lifecycle.md:
aws s3 cp the report object), so the caller also needs read access to it:
{
"Effect": "Allow",
"Action": "s3:GetObject",
"Resource": "arn:${Partition}:s3:::${ReportBucketName}/${NormalizedReportPrefix}*",
"Condition": {
"StringEquals": {
"aws:ResourceAccount": "${AccountId}"
}
}
}If the report bucket is SSE-KMS, the caller also needs kms:Decrypt on that bucket's key.
Caller KMS for an SSE-KMS destination
When the destination table bucket uses SSE-KMS, the caller needs kms:DescribeKey and
kms:GenerateDataKey on the destination key, in addition to the role's KMS permissions in section 3. Pin the caller's grant
to the destination key ARN (Resource = the key ARN) with no Condition block; the key ARN is the
scoping. With SSE-S3 end to end, neither the caller nor the role needs any KMS permissions.
Destination key policy (SSE-KMS). Identity policies are not enough. When the destination table
bucket uses SSE-KMS, the customer-managed key's key policy (the resource policy on the key
itself) must also grant the S3 Tables maintenance service principal access, or every encrypted
CreateTable fails and planning never completes (the migration is what creates the destination
table). Add to the key policy:
{
"Sid": "AllowS3TablesMaintenance",
"Effect": "Allow",
"Principal": { "Service": "maintenance.s3tables.amazonaws.com" },
"Action": ["kms:GenerateDataKey", "kms:Decrypt"],
"Resource": "*",
"Condition": {
"StringLike": {
"kms:EncryptionContext:aws:s3:arn": "arn:${Partition}:s3tables:${Region}:${AccountId}:bucket/${TableBucketName}/*"
}
}
}No kms:* grant on the role or caller substitutes for this; it is a resource-policy requirement on
the key. Read the current policy with aws kms get-key-policy, add this one statement, and show the
result to the user for approval. Never replace the whole key policy.
1. Trust policy
The trust policy is a single statement: the migration.s3tables.amazonaws.com service principal,
gated by aws:SourceAccount and aws:SourceArn conditions. It covers both planning and the
data-copy (migrating) phase.
Use
migration.s3tables.amazonaws.com, nots3tables.amazonaws.com.Both condition keys go in ONE
StringEqualsblock. A secondStringEqualsblock silently overwrites the first.aws:SourceArnmust match the destination table-bucket ARN exactly (region, account, bucket name). These conditions are confused-deputy protection and the secure default.
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "AllowS3TablesMigrationService",
"Effect": "Allow",
"Principal": {
"Service": "migration.s3tables.amazonaws.com"
},
"Action": "sts:AssumeRole",
"Condition": {
"StringEquals": {
"aws:SourceAccount": "${AccountId}",
"aws:SourceArn": "arn:${Partition}:s3tables:${Region}:${AccountId}:bucket/${TableBucketName}"
}
}
}
]
}2. Lake Formation (not supported)
Glue tables registered with Lake Formation are not supported (confirm current support in the migration guide); planning fails with
metadata.glueLakeFormation. The check and the stop rule are in references/preflight.md §6.
Do NOT grant Lake Formation permissions, register or deregister locations, or change data lake settings to work around this. Those are governance decisions for the customer's data lake administrators.
No Lake Formation grant is part of the migration role setup.
3. StartTableMigration policy
The migration service role's permission policy for StartTableMigration. Attach it to the migration service role (the role named in roleARN), scoped
to the exact source, destination, and report resources via the placeholders above. Notes:
s3:GetObjectVersionis required: without it, planning fails on the source read with a plan-artifact read error even thoughs3:GetObjectis present.Destination access is split into
CreateDestinationTable(create-side actions,s3tables:namespacecondition) andMigrateDestinationTable(copy-side actions,s3tables:namespace+s3tables:tableNameconditions). Prefer these condition keys over a simpler ARN-only statement. WithStringEquals, thetableNamevalue must equal the per-run destination table exactly or planning/copy is denied (a common self-inflicted failure); to cover many runs without editing the policy each time, useStringLikewith a scoped pattern (e.g.s3tables:tableName=myprefix_*).Report writes: the migration writes all three reports (table compatibility, object compatibility, object migration) under the single
migrationOutput.bucketand the prefixes you set, under<prefix>/<migration-id>/<report-type>/v1/...(the folder layout can change, so read each object key frommigrationOutput.<report>.keyinget-table-migration; seereferences/lifecycle.md). Grant ones3:PutObjecton the report prefix (${NormalizedReportPrefix}*), with anaws:ResourceAccountcondition. This assumes all three reports share one prefix (as the Start and Sync examples do); if you configure distinct prefixes, grant oneResourceper prefix. Omitting a prefix is legal and writes that report to the bucket root, which${NormalizedReportPrefix}*would not cover.CreateDestinationTablelists both the bucket ARN andbucket/<name>/table/*, scoped by the namespace condition.KMS:
kms:DescribeKeyvalidates the destination key;kms:Decrypt/kms:GenerateDataKeyare scoped bykms:ViaServiceandkms:EncryptionContext.
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "ReadSourceGlueTable",
"Effect": "Allow",
"Action": [
"glue:GetTable",
"glue:GetPartitions",
"glue:GetColumnStatisticsForPartition"
],
"Resource": [
"arn:${Partition}:glue:${Region}:${AccountId}:catalog",
"arn:${Partition}:glue:${Region}:${AccountId}:database/${GlueDatabaseName}",
"arn:${Partition}:glue:${Region}:${AccountId}:table/${GlueDatabaseName}/${GlueTableName}"
]
},
{
"Sid": "ReadSourceObjects",
"Effect": "Allow",
"Action": [
"s3:GetObject",
"s3:GetObjectVersion"
],
"Resource": "arn:${Partition}:s3:::${SourceBucketName}/${NormalizedSourcePrefix}*",
"Condition": {
"StringEquals": {
"aws:ResourceAccount": "${AccountId}"
}
}
},
{
"Sid": "ListSourceBucket",
"Effect": "Allow",
"Action": "s3:ListBucket",
"Resource": "arn:${Partition}:s3:::${SourceBucketName}",
"Condition": {
"StringEquals": {
"aws:ResourceAccount": "${AccountId}"
}
}
},
{
"Sid": "DecryptSourceObjects",
"Effect": "Allow",
"Action": "kms:Decrypt",
"Resource": "${SourceKmsKeyArn}",
"Condition": {
"StringEquals": {
"kms:ViaService": ["s3.${Region}.amazonaws.com"]
},
"StringLike": {
"kms:EncryptionContext:aws:s3:arn": [
"arn:${Partition}:s3:::${SourceBucketName}",
"arn:${Partition}:s3:::${SourceBucketName}/*"
]
}
}
},
{
"Sid": "CreateDestinationTable",
"Effect": "Allow",
"Action": [
"s3tables:CreateTable",
"s3tables:TagResource",
"s3tables:PutTableEncryption",
"s3tables:PutTableStorageClass"
],
"Resource": [
"arn:${Partition}:s3tables:${Region}:${AccountId}:bucket/${TableBucketName}",
"arn:${Partition}:s3tables:${Region}:${AccountId}:bucket/${TableBucketName}/table/*"
],
"Condition": {
"StringEquals": {
"s3tables:namespace": "${NamespaceName}"
}
}
},
{
"Sid": "MigrateDestinationTable",
"Effect": "Allow",
"Action": [
"s3tables:GetTable",
"s3tables:GetTableMetadataLocation",
"s3tables:UpdateTableMetadataLocation",
"s3tables:PutTableMaintenanceConfiguration",
"s3tables:GetTableData",
"s3tables:PutTableData"
],
"Resource": "arn:${Partition}:s3tables:${Region}:${AccountId}:bucket/${TableBucketName}/table/*",
"Condition": {
"StringEquals": {
"s3tables:namespace": "${NamespaceName}",
"s3tables:tableName": "${TableName}"
}
}
},
{
"Sid": "ValidateDestinationKmsKey",
"Effect": "Allow",
"Action": "kms:DescribeKey",
"Resource": "${DestinationKmsKeyArn}",
"Condition": {
"StringEquals": {
"kms:ViaService": ["s3tables.${Region}.amazonaws.com"]
}
}
},
{
"Sid": "UseDestinationKmsKey",
"Effect": "Allow",
"Action": [
"kms:GenerateDataKey",
"kms:Decrypt"
],
"Resource": "${DestinationKmsKeyArn}",
"Condition": {
"StringEquals": {
"kms:ViaService": ["s3.${Region}.amazonaws.com"]
},
"StringLike": {
"kms:EncryptionContext:aws:s3:arn": [
"arn:${Partition}:s3tables:${Region}:${AccountId}:bucket/${TableBucketName}/table/*"
]
}
}
},
{
"Sid": "WriteReports",
"Effect": "Allow",
"Action": "s3:PutObject",
"Resource": "arn:${Partition}:s3:::${ReportBucketName}/${NormalizedReportPrefix}*",
"Condition": {
"StringEquals": {
"aws:ResourceAccount": "${AccountId}"
}
}
},
{
"Sid": "EncryptReportObjects",
"Effect": "Allow",
"Action": "kms:GenerateDataKey",
"Resource": "${ReportKmsKeyArn}",
"Condition": {
"StringEquals": {
"kms:ViaService": ["s3.${Region}.amazonaws.com"]
},
"StringLike": {
"kms:EncryptionContext:aws:s3:arn": [
"arn:${Partition}:s3:::${ReportBucketName}",
"arn:${Partition}:s3:::${ReportBucketName}/*"
]
}
}
}
]
}4. SyncTableMigration policy
The permission policy for SyncTableMigration (applying source deltas to the already-migrated
table before cutover). It differs from the Start policy: it drops the create and table-config
actions (CreateTable, PutTableEncryption, PutTableStorageClass,
PutTableMaintenanceConfiguration) and scopes the destination to the table ARN
(${DestinationTableArn}) rather than the bucket. Both policies carry
s3tables:GetTableMetadataLocation and glue:GetColumnStatisticsForPartition; Amazon S3 Tables
needs both on the Start and the Sync paths. The Sync destination statement needs no
s3tables:namespace / s3tables:tableName condition: its Resource is already the exact
destination table ARN, which identifies the one table on its own. (The Start policy keeps the
conditions because its destination Resource is a bucket/table/* wildcard that the conditions
scope down. The Start CreateDestinationTable statement conditions on s3tables:namespace only,
not s3tables:tableName, because the table name is not yet in context at create time.) A role
used for the full lifecycle (Start then Sync) should carry both documents as two separate inline
policies; IAM evaluates the union automatically. Do not merge them into one document: they share
several Sids (ReadSourceGlueTable, ReadSourceObjects, and others), which must be unique within
a single policy.
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "ReadSourceGlueTable",
"Effect": "Allow",
"Action": [
"glue:GetTable",
"glue:GetPartitions",
"glue:GetColumnStatisticsForPartition"
],
"Resource": [
"arn:${Partition}:glue:${Region}:${AccountId}:catalog",
"arn:${Partition}:glue:${Region}:${AccountId}:database/${GlueDatabaseName}",
"arn:${Partition}:glue:${Region}:${AccountId}:table/${GlueDatabaseName}/${GlueTableName}"
]
},
{
"Sid": "ReadSourceObjects",
"Effect": "Allow",
"Action": [
"s3:GetObject",
"s3:GetObjectVersion"
],
"Resource": "arn:${Partition}:s3:::${SourceBucketName}/${NormalizedSourcePrefix}*",
"Condition": {
"StringEquals": {
"aws:ResourceAccount": "${AccountId}"
}
}
},
{
"Sid": "ListSourceBucket",
"Effect": "Allow",
"Action": "s3:ListBucket",
"Resource": "arn:${Partition}:s3:::${SourceBucketName}",
"Condition": {
"StringEquals": {
"aws:ResourceAccount": "${AccountId}"
}
}
},
{
"Sid": "DecryptSourceObjects",
"Effect": "Allow",
"Action": "kms:Decrypt",
"Resource": "${SourceKmsKeyArn}",
"Condition": {
"StringEquals": {
"kms:ViaService": ["s3.${Region}.amazonaws.com"]
},
"StringLike": {
"kms:EncryptionContext:aws:s3:arn": [
"arn:${Partition}:s3:::${SourceBucketName}",
"arn:${Partition}:s3:::${SourceBucketName}/*"
]
}
}
},
{
"Sid": "SyncDestinationTable",
"Effect": "Allow",
"Action": [
"s3tables:GetTable",
"s3tables:GetTableMetadataLocation",
"s3tables:UpdateTableMetadataLocation",
"s3tables:GetTableData",
"s3tables:PutTableData"
],
"Resource": "${DestinationTableArn}"
},
{
"Sid": "UseDestinationKmsKey",
"Effect": "Allow",
"Action": [
"kms:GenerateDataKey",
"kms:Decrypt"
],
"Resource": "${DestinationKmsKeyArn}",
"Condition": {
"StringEquals": {
"kms:ViaService": ["s3.${Region}.amazonaws.com"]
},
"StringLike": {
"kms:EncryptionContext:aws:s3:arn": [
"arn:${Partition}:s3tables:${Region}:${AccountId}:bucket/${TableBucketName}/table/*"
]
}
}
},
{
"Sid": "WriteReports",
"Effect": "Allow",
"Action": "s3:PutObject",
"Resource": "arn:${Partition}:s3:::${ReportBucketName}/${NormalizedReportPrefix}*",
"Condition": {
"StringEquals": {
"aws:ResourceAccount": "${AccountId}"
}
}
},
{
"Sid": "EncryptReportObjects",
"Effect": "Allow",
"Action": "kms:GenerateDataKey",
"Resource": "${ReportKmsKeyArn}",
"Condition": {
"StringEquals": {
"kms:ViaService": ["s3.${Region}.amazonaws.com"]
},
"StringLike": {
"kms:EncryptionContext:aws:s3:arn": [
"arn:${Partition}:s3:::${ReportBucketName}",
"arn:${Partition}:s3:::${ReportBucketName}/*"
]
}
}
}
]
}Requirements and compatibility
Works with: Claude Code, Claude apps, OpenAI Codex, GitHub Copilot, Cursor, Gemini CLI, Kiro, OpenCode, Goose, Amp, Roo Code, JetBrains Junie, Factory Droid, Devin (ex-Windsurf), Mistral Vibe, OpenHands, Letta
“Works with” means the tool reads the open Agent Skills format; a skill written for one tool may use features others lack.
Needs: Needs an MCP server
Security
No issues found by our static scan· No issues found
A static scan is not a guarantee. Skills are third-party content: review a skill before you let an agent use it.
Attribution and licence
- Published by
- AWS
- Publisher
- AWS (Official)
- Source
- aws/agent-toolkit-for-aws · skills/specialized-skills/analytics-skills/migrating-hive-tables-to-s3-tables · commit 0a218f8
- Licence
- Apache License 2.0 (redistribution allowed)
- LICENSE (added by AutoGineer from LICENSE)
- NOTICE (added by AutoGineer from NOTICE)
- ATTRIBUTION.md (written by AutoGineer)
- Synced
AutoGineer is not affiliated with or endorsed by AWS or AWS.
Download ZIP
The ZIP holds the skill’s files, its licence files and an ATTRIBUTION.md. Download migrating-hive-tables-to-s3-tables.zip