Prerequisites for integrating with external catalogs
Before you integrate with an external catalog, set up the caller permissions and two IAM roles. You also create an AWS Secrets Manager secret for each source. This topic describes these prerequisites. For more information, see Integrating with external catalogs.
Caller permissions
The following table lists the permissions that you need to integrate with an external catalog.
Action |
Required permissions |
|---|---|
Create a connection |
|
Register a connection with Lake Formation for federation |
|
Grant Lake Formation permissions to a role |
|
Create or update a catalog and turn on sync |
|
Read or delete a catalog |
|
IAM roles
An external catalog integration uses two IAM roles in your account. You set up a discovery and asset cataloging role for the managed crawler, and a query engine credential-vending role for AWS vended credentials.
Discovery and asset cataloging role
The managed crawler runs as the discovery and asset cataloging role. This is an
IAM role in your account that trusts the AWS Glue service principal
glue.amazonaws.com. You set this role in
SyncConfiguration.RoleArn when you turn on sync, and you must have the
iam:PassRole permission on it. This role is not registered with
Lake Formation.
Add the aws:SourceAccount condition key to the trust policy so that
AWS Glue assumes the role only for your account. In the following trust policy, replace
with your account ID.account-id
{ "Version": "2012-10-17", "Statement": [ { "Effect": "Allow", "Principal": { "Service": "glue.amazonaws.com" }, "Action": "sts:AssumeRole", "Condition": { "StringEquals": { "aws:SourceAccount": "account-id" } } } ] }
Grant this role the Lake Formation DESCRIBE permission on the federated catalog
before you turn on sync. When you grant the permission, you identify the role as the
data lake principal by its role ARN. For the steps to grant Lake Formation permissions, see
Granting
and revoking permissions on Data Catalog resources in the AWS Lake Formation Developer Guide.
Query engine credential-vending role
When a connection uses AWS vended credentials, Lake Formation assumes the query engine
credential-vending role to vend credentials to the query engine. You register the
connection with Lake Formation for federation and specify this role as the role that Lake Formation
uses, by setting WithFederation to true with the
register-resource operation. You also need this role for Amazon Athena
federated queries. This role is not used with source vended credentials.
When you register the connection and grant Lake Formation permissions, you identify the role as the data lake principal by its role ARN. For the steps to register the resource and grant Lake Formation permissions on the federated catalog, see Granting and revoking permissions on Data Catalog resources in the AWS Lake Formation Developer Guide.
VPC connections
The ROLE_ARN connection property applies only to connections that use
a VPC. For more information about VPC connections, see Adding an AWS Glue connection.
Secrets Manager secret
Create one AWS Secrets Manager secret for each source. The connection uses AWS Secrets Manager for the source credentials and stores only the ARN of the secret. Deleting a connection doesn't delete its secret.
Use the following secret contents for each authentication type.
- Databricks OAuth and Snowflake OAuth
-
Store the client secret. The connector adds the access token to the same secret and refreshes it. For Snowflake, the connector also adds the refresh token.
{ "USER_MANAGED_CLIENT_APPLICATION_CLIENT_SECRET": "client-secret" } - Snowflake key pair
-
Store the Snowflake user name and the unencrypted PKCS#8 private key.
{ "sfUser": "snowflake-user", "pem_private_key": "-----BEGIN PRIVATE KEY-----\nprivate-key\n-----END PRIVATE KEY-----" }
Placeholders in the examples
Replace the following placeholders in the examples with your own values:
account-id-
Your 12-digit AWS account ID.
region-
The AWS Region code of the catalog, for example
aa-example-1. catalog-name-
The name of the federated catalog.
connection-name-
The name of the AWS Glue connection.
crawler-name-
The name of the managed crawler.