

# Integrating with external catalogs

Integrating with an external catalog is a way to populate the AWS Glue Data Catalog. You bring metadata that already exists in Databricks Unity Catalog and Snowflake Horizon Catalog into the Data Catalog as assets, without building your own pipeline. AWS Glue keeps these assets current on the schedule that you set.

Synced assets appear in the Data Catalog next to your AWS assets. You can discover them with [Semantic search for AWS Glue Data Catalog](catalog-semantic-search.md) and add business context to them with [Adding business context](catalog-business-context.md).

## Supported sources
<a name="catalog-external-catalogs-sources"></a>

You can integrate with the following external catalogs:
+ Databricks Unity Catalog
+ Snowflake Horizon Catalog

## How integrating with external catalogs works
<a name="catalog-external-catalogs-how-it-works"></a>

The following steps describe how an external catalog integration works. You do the first four steps, and AWS Glue does the rest:

1. You create an AWS Glue connection of type `DATABRICKS` or `SNOWFLAKE`. The connection uses AWS Secrets Manager for the source credentials and stores only the ARN of the secret.

1. You register the connection with Lake Formation for federation by setting `WithFederation` to `true`. You must register the connection before you can create a catalog on it.

1. You create a top-level federated catalog on the connection with the `ConnectionName` and `ConnectionType`. AWS Glue creates one top-level catalog for the connection. Each Databricks catalog or Snowflake database appears as a child catalog under the top-level catalog.

1. You turn on sync by adding a `SyncConfiguration` to the federated catalog with the `CreateCatalog` or `UpdateCatalog` operation. The `SyncConfiguration` includes `RoleArn` (the discovery and asset cataloging role), `AssetsSyncConfiguration`, and an optional `LineageSyncConfiguration`.

1. AWS Glue creates a managed crawler for the catalog. The crawler runs as the discovery and asset cataloging role on a schedule that you set with `RefreshIntervalMinutes`.

1. The managed crawler reads metadata from the source and writes it to the Data Catalog as synced assets. You can find synced assets with the `SearchAssets` operation and read an asset with the `GetAsset` operation.

An external catalog integration uses two IAM roles. The discovery and asset cataloging role is the role that the managed crawler runs as. The query engine credential-vending role is the role that Lake Formation assumes to vend credentials to query engines when the connection uses AWS vended credentials. For the requirements of each role, see [Prerequisites for integrating with external catalogs](catalog-external-catalogs-prerequisites.md).

A connection vends credentials to query engines in one of two modes. With AWS vended credentials, the default mode, Lake Formation assumes the query engine credential-vending role and vends credentials to the engine. With source vended credentials, the source vends the credentials to the query engine. Source vended credentials are available to first-party query engines only.

## Key concepts
<a name="catalog-external-catalogs-concepts"></a>

This section defines the following terms for external catalog integration:

Federated catalog  
A top-level Data Catalog catalog that AWS Glue creates for an AWS Glue connection. Each Databricks catalog or Snowflake database appears as a child catalog under the top-level catalog. You add a `SyncConfiguration` to the federated catalog to turn on sync.

Discovery and asset cataloging role  
The IAM role that the managed crawler runs as. For the requirements of this role, see [Prerequisites for integrating with external catalogs](catalog-external-catalogs-prerequisites.md).

Query engine credential-vending role  
The IAM role that Lake Formation assumes to vend AWS vended credentials to query engines. For the requirements of this role, see [Prerequisites for integrating with external catalogs](catalog-external-catalogs-prerequisites.md).

Managed crawler  
The crawler that AWS Glue creates and runs for a federated catalog when sync is on. The managed crawler is locked, and you manage it through the catalog, not directly. For more information, see [Working with managed crawlers](catalog-external-catalogs-managed-crawlers.md).

Synced assets  
The assets that the managed crawler writes to the Data Catalog from the source. Synced assets include metadata about the objects in the source catalog.

Credential vending modes  
How a connection vends credentials to query engines. With AWS vended credentials, the default mode, Lake Formation vends credentials through the query engine credential-vending role. With source vended credentials, the source vends the credentials.

## Find synced assets
<a name="catalog-external-catalogs-find-assets"></a>

Synced assets appear in semantic search alongside your other Data Catalog assets. To list only the assets from one external catalog, filter the `SearchAssets` operation on the `thirdparty::ThirdPartyResource.connectionArn` attribute with the ARN of the connection.

```bash
aws glue search-assets \
    --filter-clause '{
        "AttributeFilter": {
            "Attribute": "thirdparty::ThirdPartyResource.connectionArn",
            "Operator": "equals",
            "Value": {"StringValue": "{{connection-arn}}"}
        }
    }'
```

For more information about semantic search, see [Semantic search for AWS Glue Data Catalog](catalog-semantic-search.md).

## Considerations and limitations
<a name="catalog-external-catalogs-considerations-overview"></a>

For the considerations and limitations that apply across external catalog integration, including per source notes, see [Considerations and limitations](catalog-external-catalogs-considerations.md).

## Next steps
<a name="catalog-external-catalogs-next-steps"></a>

To start syncing metadata, first set up the prerequisites. Then create a connection and turn on sync for your source.
+ [Prerequisites for integrating with external catalogs](catalog-external-catalogs-prerequisites.md)
+ [Integrating with Databricks Unity Catalog](catalog-external-catalogs-databricks.md)
+ [Integrating with Snowflake Horizon Catalog](catalog-external-catalogs-snowflake.md)