Skip to content
Development
Skill

/querying-aws-sagemaker-catalog

Runs SQL analytics on SageMaker Catalog asset metadata tables exported as Apache Iceberg in S3 Tables. Covers governance queries, asset growth tracking, ownership audits, time-travel over catalog state, and metadata quality analysis. Applies when querying catalog inventory,

From plugin
agent-toolkit-for-aws
2.3k146 skills9 commands3 MCP
Install
$ npx -y skills add aws/agent-toolkit-for-aws --skill querying-aws-sagemaker-catalog --agent claude-code

How it fires

How this skill gets triggered: by you, by Claude, or both.

  • Fires itselfAuto-invocation. Claude auto-loads it when your prompt matches the work.Auto-invocation is when the right skill fires by itself at the right moment, driven by a FLOW.md router and a hook, instead of you invoking it by name. It is the difference between a skill being installed and a skill actually getting used.Read the full definition →
  • You can call itInvoke it directly when you want it.
  • Slash command/querying-aws-sagemaker-catalog

Context preview

The summary Claude sees to decide when to auto-load this skill.

Runs SQL analytics on SageMaker Catalog asset metadata tables exported as Apache Iceberg in S3 Tables. Covers governance queries, asset growth tracking, ownership audits, time-travel over catalog state, and metadata quality analysis. Applies when querying catalog inventory,

SKILL.md

querying-aws-sagemaker-catalog.SKILL.md
name: querying-aws-sagemaker-catalog
description: >-
  Runs SQL analytics on SageMaker Catalog asset metadata tables exported as Apache Iceberg in
  S3 Tables. Covers governance queries, asset growth tracking, ownership audits, time-travel
  over catalog state, and metadata quality analysis. Applies when querying catalog inventory,
  finding assets without descriptions, comparing catalog snapshots, or auditing data
  ownership. Trigger phrases: catalog inventory SQL, how many assets, assets without
  descriptions, asset growth over time, who owns this data, catalog governance, data quality
  audit, catalog analytics.
version: 1
argument-hint: "[query|domain-id|'configure'|'status']"

Query AWS SageMaker Catalog System Tables

Overview

**Works best with** the [AWS MCP server](https://docs.aws.amazon.com/aws-mcp/) for sandboxed execution and audit logging. All commands below use the AWS CLI and work in any environment with configured AWS credentials.

Amazon SageMaker Unified Studio (whose catalog feature is referred to below as SageMaker Catalog) exports asset metadata as a daily-snapshot Apache Iceberg table in the AWS-managed `aws-sagemaker-catalog` table bucket. This enables SQL queries over your entire data catalog inventory — asset counts, governance gaps, ownership audits, and historical comparisons — without building custom ETL.

Data is partitioned by `snapshot_time` and exported once daily (around midnight per region). The table is read-only.

Decision Tree

| User intent | Use this skill? | Alternative | |---|---|---| | SQL analytics on catalog state (counts, governance, trends) | **Yes** | — | | Historical comparison ("what changed in catalog last week") | **Yes** — time travel via `snapshot_time` | — | | Find assets without owners or descriptions | **Yes** | — | | Find a specific table by name or concept | **No** | `finding-data-lake-assets` or Glue Discovery `search` | | Browse/enumerate catalog interactively | **No** | `exploring-data-catalog` | | Run a query *on* a table's data | **No** | `querying-data-lake` | | Manage catalog metadata (add descriptions, tags) | **No** | Glue Discovery `put-form-type` / `associate-glossary-terms` |

Common Tasks

1. Check If Configured

aws datazone get-data-export-configuration \
  --domain-identifier <DOMAIN_ID> \
  --region <REGION>
  • If no domain exists: `aws datazone list-domains --region <REGION>`
  • If export not enabled: guide user to enable.
  • One domain per account per region.

Verify table bucket exists:

aws s3tables list-table-buckets --region <REGION> \
  --query "tableBuckets[?name=='aws-sagemaker-catalog']"

2. Enable

**With KMS encryption (recommended for production):**

aws datazone put-data-export-configuration \
  --domain-identifier <DOMAIN_ID> \
  --region <REGION> \
  --enable-export \
  --encryption-configuration kmsKeyArn=<KMS_KEY_ARN>,sseAlgorithm=aws:kms

> **Note**: Encryption cannot be changed after creation. Always specify KMS for sensitive catalog data.

Without encryption (for quick testing only):

aws datazone put-data-export-configuration \
  --domain-identifier <DOMAIN_ID> \
  --region <REGION> \
  --enable-export

First data available within 24 hours. See: [Exporting asset metadata](https://docs.aws.amazon.com/sagemaker-unified-studio/latest/userguide/export-asset-metadata.html)

3. Verify Permissions for Querying

Requires:

  • S3 Tables federated catalog registered in Glue (`s3tablescatalog`)
  • Lake Formation SELECT + DESCRIBE grants on the table

Grant access:

aws lakeformation grant-permissions \
  --principal DataLakePrincipalIdentifier=<ROLE_ARN> \
  --resource '{"Table": {"CatalogId": "<ACCOUNT>:s3tablescatalog/aws-sagemaker-catalog", "DatabaseName": "asset_metadata", "Name": "asset"}}' \
  --permissions DESCRIBE SELECT \
  --region <REGION>

4. Query

**Query syntax:**

"s3tablescatalog/aws-sagemaker-catalog"."asset_metadata"."asset"

**Constraints:**

  • You MUST always filter by `snapshot_time` — without it, the query scans all historical snapshots and returns duplicates
  • You MUST confirm workgroup and output location before executing
  • Default to `DATE(snapshot_time) = CURRENT_DATE` for current state
  • You SHOULD use the key columns documented in this skill to build queries. If you need the full schema, run `get-tables` once:
  aws glue get-tables --catalog-id "<ACCOUNT>:s3tablescatalog/aws-sagemaker-catalog" --database-name "asset_metadata" --region <REGION>

**Key columns:**

| Column | What it holds | Usage | |--------|--------------|-------| | `snapshot_time` | Partition key — daily snapshot timestamp | **Always filter on this** | | `asset_id` | Unique catalog asset identifier | Primary key for lookups | | `resource_type_enum` | GlueTable, RedshiftTable, S3Collection, etc. | Filter by asset type | | `resource_id` | ARN or native identifier | Cross-reference with source systems | | `asset_name` | Business-friendly name | Display, search | | `resource_name` | Technical name (table name, prefix) | Filtering | | `business_description` | Business context (NULL if not provided) | Governance gaps | | `extended_metadata` | `map<string,string>` — flexible key-value attributes | Use bracket notation: `extended_metadata['owningEntityId']` | | `asset_created_time` | When asset first appeared in catalog | Growth analysis | | `asset_updated_time` | Last modification time | Freshness checks |

**Current catalog state:**

SELECT resource_type_enum, COUNT(*) as count
FROM "s3tablescatalog/aws-sagemaker-catalog"."asset_metadata"."asset"
WHERE DATE(snapshot_time) = CURRENT_DATE
GROUP BY resource_type_enum
ORDER BY count DESC;

**Assets without business descriptions:**

SELECT asset_name, resource_name, resource_type_enum, account_id
FROM "s3tablescatalog/aws-sagemaker-catalog"."asset_metadata"."asset"
WHERE DATE(snapshot_time) = CURRENT_DATE
  AND business_description IS
Read more
Ships withagent-toolkit-for-aws

Help AI coding agents build, deploy, and manage applications on AWS. The Agent Toolkit for AWS gives AI coding agents the tools, knowledge, and guardrails they need to work with AWS services.

Get the whole plugin

Other skills on agent-toolkit-for-aws.