Area: Ingestion
Sub-Area: Data Catalogs
Applies to: OSS + Cloud
Issue
AWS Glue Data Catalog metadata is not syncing to DataHub, or lineage from Glue ETL jobs is missing. This usually comes from missing IAM permissions, AWS settings in the wrong place in the recipe, or a recipe that uses keys the Glue source does not have.
You Might Be Asking
- What IAM permissions does DataHub need for Glue?
- How do I extract lineage from Glue ETL jobs?
- How do I get lineage between Glue tables and S3?
- Can DataHub sync Glue crawlers?
Cause
- The IAM principal is missing Glue permissions. Datasets need
glue:GetDatabasesandglue:GetTables. Jobs and profiling need more (see step 2). - The recipe uses keys the Glue source does not define. The Glue source rejects unknown keys, so the recipe fails validation. Use only the keys shown in this article and on the Glue source page.
- The AWS settings are in the wrong place. In the Glue source,
aws_region,aws_access_key_id,aws_secret_access_key,aws_session_token,aws_roleandaws_profileare top-level keys. There is noaws_configblock. (The S3 source is different: it usesaws_config.)
The Glue source extracts tables, column types, table metadata (owner, description, parameters), jobs with their transformations, sources and sinks, and upstream lineage from JDBC sources that Glue jobs reference. Glue crawlers are not among the things it extracts.
Solution
- Configure the Glue source with AWS settings at the top level:
source:
type: glue
config:
aws_region: "us-east-1"
# Use access keys, or aws_role / aws_profile
aws_access_key_id: "${AWS_ACCESS_KEY_ID}"
aws_secret_access_key: "${AWS_SECRET_ACCESS_KEY}"
# Glue jobs and owners (both default to true)
extract_transforms: true
extract_owners: true
# Filter databases
database_pattern:
allow: ["analytics.*", "warehouse.*"]
deny: ["temp.*"]
- Grant the required IAM permissions. See Glue IAM permissions.
- Datasets:
glue:GetDatabases,glue:GetTables. - Jobs (
extract_transforms: true, the default): alsoglue:GetDataflowGraph,glue:GetJobs,s3:GetObject, andglue:GetConnectionwhen jobs reference named connections. - Profiling:
glue:GetPartitions.
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": [
"glue:GetDatabases",
"glue:GetTables",
"glue:GetDataflowGraph",
"glue:GetJobs",
"glue:GetConnection",
"glue:GetPartitions"
],
"Resource": "*"
},
{
"Effect": "Allow",
"Action": ["s3:GetObject"],
"Resource": "arn:aws:s3:::your-bucket/*"
}
]
}
Drop glue:GetConnection or glue:GetPartitions if you do not need them.
The source also calls glue:GetTable when profiling is on, and when it reads the schema of a Lake Formation resource link's owning table. If that resource-link call fails, ingestion continues. The source logs the warning Failed to read resource-link owner schema from Glue and ingests the resource link without a schema. Grant glue:GetTable on the shared table to get the schema.
- Extract Glue ETL job lineage. With
extract_transforms: true, the source reads jobs with their transformations, sources and sinks. It also reads upstream lineage from JDBC sources that Glue jobs reference. You can't filter jobs by name.database_patternandtable_patternare the only filter patterns, andextract_transformsturns jobs on or off as a whole.
source:
type: glue
config:
aws_region: "us-east-1"
extract_transforms: true
- Create lineage between Glue tables and their storage. Set
emit_storage_lineage: true(defaultfalse). With the defaultglue_storage_lineage_direction: upstream, the storage location is upstream of the Glue table.
source:
type: glue
config:
aws_region: "us-east-1"
emit_storage_lineage: true
use_s3_bucket_tags and use_s3_object_tags (both default false) only copy S3 bucket and object tags onto the ingested tables as DataHub tags. They do not create lineage.
- For Lake Formation tags, set
extract_lakeformation_tags: true. If tags are missing, check that the principal haslakeformation:GetResourceLFTags. The connector does not needlakeformation:GrantPermissionsorlakeformation:GetDataAccess.
source:
type: glue
config:
aws_region: "us-east-1"
extract_lakeformation_tags: true
- For cross-account Glue, set
catalog_idto the account ID that holds the Glue catalog. Setaws_roleat the top level of the Glue config. See cross-account access. Putaws_roleat the top level, not underaws_config, even where the examples on that page nest it.