View a markdown version of this page

Working with managed crawlers - AWS Glue

Working with managed crawlers

When you turn on sync for a federated catalog, AWS Glue creates and runs a managed crawler that reads metadata from the source and writes it to the Data Catalog. You manage the crawler through the catalog. This topic describes what AWS Glue creates, how to run and monitor the crawler, and which operations aren't allowed on a managed crawler.

What AWS Glue creates

For each federated catalog that has sync turned on, AWS Glue creates one managed crawler for assets. If you turn on lineage sync, AWS Glue creates a second managed crawler for lineage. After AWS Glue provisions a crawler, the first crawl starts automatically. The following table describes the properties of the assets managed crawler.

Assets managed crawler properties
Property Value
Name catalog-sync-assets-id, where id is a system-generated hexadecimal identifier.
Catalog account-id:catalog-name
Target RestCatalogTargets with the catalog's connection.
Role The IAM role from the SyncConfiguration.
Schedule Set from RefreshIntervalMinutes on the catalog. Either a 24-hour interval (1440) or a 7-day interval (10080).
Description System-managed REST_CATALOG crawler of federated catalog catalog-name

When lineage sync is turned on, the second managed crawler is named catalog-sync-lineage-id, where id is a system-generated hexadecimal identifier. Its target is LineageTargets, and its description identifies it as a LINEAGE crawler rather than a REST_CATALOG crawler.

Find the crawler name from the ARN

The GetCatalog operation returns the crawler Amazon Resource Name (ARN) in ManagedCrawlerDetails. The crawler operations take the crawler name, which is the part of the ARN after crawler/, not the full ARN. For example, in the ARN arn:aws:glue:region:account-id:crawler/catalog-sync-assets-id, the crawler name is catalog-sync-assets-id.

Run or stop a sync on demand

You can run a sync on demand instead of waiting for the next scheduled run, and you can stop a run that's in progress. The StartCrawler and StopCrawler operations are allowed on a managed crawler.

  1. Start a run with the start-crawler command.

    aws glue start-crawler --name crawler-name
  2. Stop a run that's in progress with the stop-crawler command.

    aws glue stop-crawler --name crawler-name

View runs, metrics, and logs

You can review the run history, metrics, and logs of a managed crawler the same way you review a crawler you create.

  1. List the crawler runs with the list-crawls command.

    aws glue list-crawls --crawler-name crawler-name
  2. Get the crawler metrics with the get-crawler-metrics command.

    aws glue get-crawler-metrics --crawler-name-list crawler-name
  3. Read the crawler logs from the /aws-glue/crawlers log group in CloudWatch Logs. Each crawler writes to a log stream named after the crawler.

    aws logs get-log-events \ --log-group-name /aws-glue/crawlers \ --log-stream-name crawler-name

Operations that aren't allowed on managed crawlers

A managed crawler doesn't allow the following operations. Each one returns an InvalidInputException with HTTP status 400.

  • UpdateCrawler

  • DeleteCrawler

  • StartCrawlerSchedule

  • StopCrawlerSchedule

  • UpdateCrawlerSchedule

The error text names the operation you called, as in the following example.

System-managed crawlers cannot be modified through UpdateCrawler. Manage synchronization through the Glue Catalog APIs (UpdateCatalog or DeleteCatalog) instead.

To change the schedule, update RefreshIntervalMinutes on the catalog with the UpdateCatalog operation. To remove the crawler, turn off sync or delete the catalog with the DeleteCatalog operation. You can't create a managed crawler yourself. Only AWS Glue creates the managed crawler for a federated catalog.