> ## Documentation Index
> Fetch the complete documentation index at: https://docs.open-metadata.org/llms.txt
> Use this file to discover all available pages before exploring further.

# Run the Glue Pipeline Connector Externally

> Use the YAML config for Glue pipeline ingestion to define metadata patterns, connection parameters, and lineage capture logic.

![Glue](https://docs.open-metadata.org/public/images/connectors/glue.webp)

# Glue

PROD

In this section, we provide guides and references to use the Glue connector.
Configure and schedule Glue metadata and profiler workflows from the OpenMetadata UI:

* [Requirements](#requirements)
* [Lineage](#lineage)
* [Metadata Ingestion](#metadata-ingestion)

## How to Run the Connector Externally

To run the Ingestion via the UI you'll need to use the OpenMetadata Ingestion Container, which comes shipped with
custom Airflow plugins to handle the workflow deployment.

If, instead, you want to manage your workflows externally on your preferred orchestrator, you can check
the following docs to run the Ingestion Framework **anywhere**.

> [card] [External Schedulers](https://docs.open-metadata.org/v2.1.x/deployment/ingestion.md)
>
> Get more information about running the Ingestion Framework Externally

## Requirements

The Glue connector ingests metadata through AWS [Boto3](https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/glue.html) Client.
We will ingest Workflows, its jobs and their run status.
The user must have the following permissions for the ingestion to run successfully:

* `glue:ListWorkflows`
* `glue:GetWorkflow`
* `glue:GetJobRuns`

Lineage needs the following additional permissions. Without them, ingestion still succeeds, but lineage is empty and OpenMetadata logs a warning:

* `glue:GetJob`
* `s3:GetObject` on the bucket that holds the job scripts
* `glue:GetConnection`, for jobs that use a Java Database Connectivity (JDBC) connection

### Python Requirements

Use Python 3.10 or later. Python 3.12 is recommended, because it is what the OpenMetadata 2.0 ingestion images use. To confirm the supported range for your release, check the `Requires-Python` metadata of that release’s `openmetadata-ingestion` package.

To run the Glue ingestion, you will need to install:

```bash theme={null}
pip3 install "openmetadata-ingestion[glue]"
```

## Lineage

The Glue connector creates lineage from the tables that a Glue job reads to the tables that it writes, including Snowflake tables, and records the Glue workflow as the pipeline of each edge. It reads only jobs that belong to a Glue workflow. OpenMetadata creates an edge only when both ends are already ingested, so ingest the Snowflake service first.

OpenMetadata reads the Snowflake sources and targets from the job's Glue Studio nodes. If the job has no Studio nodes, it reads the job script instead:

* **Glue Studio nodes**: `SnowflakeSource` and `SnowflakeTarget` nodes. OpenMetadata skips a node that has no table, such as a source that uses a query.
* **Job scripts**: Python scripts that use `connection_type="snowflake"` with the Glue `from_options` calls, or the Snowflake Spark connector with `format("snowflake")`. OpenMetadata doesn't read Scala scripts, so a Scala job produces no Snowflake lineage.

To create the Snowflake lineage, add the Snowflake service to **Database Service Names List** under **Lineage Information** in the metadata agent. In a YAML workflow, set `dbServiceNames` under `lineageInformation` in `sourceConfig.config`. When the list is empty, OpenMetadata searches all database services.

OpenMetadata takes the database, schema, and table from the node or from the script. In a script, the `dbtable` option accepts `TABLE`, `SCHEMA.TABLE`, or `DB.SCHEMA.TABLE`. A database or schema that the script sets at run time, for example from a job parameter, stays unset.

OpenMetadata matches the `database.schema.table` name first, then `schema.table`. It uses the table name alone only when the script doesn't set a schema. OpenMetadata links the job only when exactly one table matches. If several tables match, or no table matches, OpenMetadata skips the table and logs a warning.

## Metadata Ingestion

All connectors are defined as JSON Schemas.
[Here](https://github.com/open-metadata/OpenMetadata/blob/main/openmetadata-spec/src/main/resources/json/schema/entity/services/connections/database/glueConnection.json)
you can find the structure to create a connection to Glue.
In order to create and run a Metadata Ingestion workflow, we will follow
the steps to create a YAML configuration able to connect to the source,
process the Entities if needed, and reach the OpenMetadata server.
The workflow is modeled around the following
[JSON Schema](https://github.com/open-metadata/OpenMetadata/blob/main/openmetadata-spec/src/main/resources/json/schema/metadataIngestion/workflow.json)

### 1. Define the YAML Config

This is a sample config for Glue:

#### Source Configuration - Service Connection

#### awsConfig

AWS Access Key Credentials

**awsAccessKeyId** and **awsSecretAccessKey** are used to authenticate and authorize programmatic requests to AWS services.

An access key consists of:

* **Access Key ID** (for example, `AKIAIOSFODNN7EXAMPLE`)
* **Secret Access Key** (for example, `wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY`)

Both values must be provided together when using static credentials.

For more information, see
[Managing access keys](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_access-keys.html).

AWS Session Token

**awsSessionToken** is required when using **temporary security credentials**, such as those obtained via AWS STS.

The session token must be provided along with the access key ID and secret access key for the duration of the session.

AWS Region

**awsRegion** specifies the AWS Region where the target service is deployed (for example, `us-east-1`).

This is the **only required parameter** when configuring an AWS connection. Other credentials can be resolved automatically using environment variables, AWS profiles, or IAM roles.

Learn more in the
[AWS Regions and Availability Zones documentation](https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/Concepts.RegionsAndAvailabilityZones.html).

Custom Endpoint URL

**endPointURL** is an optional custom endpoint used to connect to an AWS service.

You may want to specify this when:

* Using VPC endpoints
* Connecting to local or AWS-compatible services
* Overriding the default regional endpoint

See
[AWS service endpoints](https://docs.aws.amazon.com/general/latest/gr/rande.html) for details.

AWS Profile Name

**profileName** specifies the AWS CLI profile to use for authentication.

Profiles store credentials and configuration in AWS config files.
If not specified, the `default` profile is used.

Learn more about
[Named profiles for the AWS CLI](https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-profiles.html).

Assume Role ARN

**assumeRoleArn** is the Amazon Resource Name (ARN) of the IAM role to assume.

This is commonly used for:

* Cross-account access
* Delegated permissions
* Enhanced security setups

This field is **required** when using Assume Role authentication.

See the
[AssumeRole API reference](https://docs.aws.amazon.com/STS/latest/APIReference/API_AssumeRole.html).

Assume Role Session Name

**assumeRoleSessionName** identifies the assumed role session.

This value helps uniquely identify a session when the same role is assumed multiple times or by different principals.

If not provided, the default value `OpenMetadataSession` is used.

Assume Role Source Identity

**assumeRoleSourceIdentity** is an optional source identity passed when assuming a role.

This value is recorded in AWS CloudTrail logs and can be used to trace actions performed using the assumed role.

See
[Source Identity in AssumeRole](https://docs.aws.amazon.com/STS/latest/APIReference/API_AssumeRole.html).

#### Source Config

The `sourceConfig` is defined [here](https://github.com/open-metadata/OpenMetadata/blob/main/openmetadata-spec/src/main/resources/json/schema/metadataIngestion/pipelineServiceMetadataPipeline.json):

* **dbServiceNames**: Database Service Name for the creation of lineage, if the source supports it.
* **includeTags**: Set the **Include Tags** toggle to control whether to include tags as part of metadata ingestion.
* **includeUnDeployedPipelines**: Set the **Include UnDeployed Pipelines** toggle to control whether to include un-deployed pipelines as part of metadata ingestion. By default it is set to `true`.
* **markDeletedPipelines**: Set the **Mark Deleted Pipelines** toggle to flag pipelines as soft-deleted if they are not present anymore in the source system.
* **pipelineFilterPattern** and **chartFilterPattern**: Note that the `pipelineFilterPattern` and `chartFilterPattern` both support regex as include or exclude.
* **includeOwners**: Set the **Include Owners** toggle to control whether to include owners to the ingested entity if the owner email matches with a user stored in the OM server as part of metadata ingestion. If the ingested entity already exists and has an owner, the owner will not be overwritten. It supports boolean values either `true` or `false`.
* **overrideLineage**: Set the **Override Lineage** toggle to control whether to override the existing lineage. It supports boolean values either `true` or `false`.
* **overrideMetadata**: Set the **Override Metadata** toggle to control whether to override the existing metadata in the OpenMetadata server with the metadata fetched from the source. If the toggle is set to true, the metadata fetched from the source will override the existing metadata in the OpenMetadata server. If the toggle is set to false, the metadata fetched from the source will not override the existing metadata in the OpenMetadata server. This is applicable for fields like description, tags, owner, and displayName. It supports boolean values either `true` or `false`.
* **statusLookbackDays**: Number of days of pipeline run status history to ingest. Only runs within the last N days are fetched. Integer, default `1`. Available on all pipeline connectors, but only honored by those that ingest run-status history (currently Dagster, dbt Cloud, Databricks Pipeline, and Data360).

To send the metadata to OpenMetadata, it needs to be specified as `type: metadata-rest`.

The main property here is `openMetadataServerConfig`, where you can define the host and security provider of your OpenMetadata installation.

* **loggerLevel**: Specify the logger level depending on your needs. If you are troubleshooting an ingestion, use `DEBUG` for more detailed traces.
* **JWT token**: JWT tokens allow clients to authenticate against the OpenMetadata server. See [Enable JWT Tokens](https://docs.open-metadata.org/deployment/security/enable-jwt-tokens) and [JWT Troubleshooting](https://docs.open-metadata.org/deployment/security/jwt-troubleshooting) for more information.
* **storeServiceConnection**: If set to `true` (default), sensitive information is stored encrypted with the Fernet Key or externally if you have configured a [Secrets Manager](https://docs.open-metadata.org/deployment/secrets-manager). If set to `false`, the service is created, but the service connection information is only used by the Ingestion Framework at runtime and is not sent to the OpenMetadata server.
* **SSL configuration**: If you have added SSL to the [OpenMetadata server](https://docs.open-metadata.org/deployment/security/enable-ssl), configure the certificates for ingestion. Set `verifySSL` to `ignore`, or set it to `validate` and provide `sslConfig.caCertificate` with a local path to the server certificate. See [SSL Troubleshooting](https://docs.open-metadata.org/deployment/security/enable-ssl/ssl-troubleshooting) for more information.
* **ingestionPipelineFQN**: Fully qualified name of the ingestion pipeline, used to identify the current ingestion pipeline.

connector\_config.yaml
Copy full code

```yaml theme={null}
source:
  type: gluepipeline
  serviceName: local_glue
  serviceConnection:
    config:
      type: GluePipeline
      awsConfig:
```

```yaml theme={null}
  sourceConfig:
    config:
      type: PipelineMetadata
      # lineageInformation:
      #   dbServiceNames: []
      #   storageServiceNames: []
      # markDeletedPipelines: True
      # includeTags: True
      # includeLineage: true
      # includeUnDeployedPipelines: true
      # pipelineFilterPattern:
      #   includes:
      #     - pipeline1
      #     - pipeline2
      #   excludes:
      #     - pipeline3
      #     - pipeline4
      # includeOwners: true # false
      # overrideLineage: false # true
      # overrideMetadata: false # true
      # statusLookbackDays: 1  # only honored by Dagster, dbt Cloud, Databricks Pipeline, Data360
```

```yaml theme={null}
sink:
  type: metadata-rest
  config: {}
```

```yaml theme={null}
workflowConfig:
  loggerLevel: INFO  # DEBUG, INFO, WARNING or ERROR
  openMetadataServerConfig:
    hostPort: "http://localhost:8585/api"
    authProvider: openmetadata
    securityConfig:
      jwtToken: "{bot_jwt_token}"
    ## Store the service Connection information
    storeServiceConnection: true  # false
    ## Secrets Manager Configuration
    # secretsManagerProvider: aws, azure or noop
    # secretsManagerLoader: airflow or env
    ## If SSL, fill the following
    # verifySSL: validate  # or ignore
    # sslConfig:
    #   caCertificate: /local/path/to/certificate
# ingestionPipelineFQN: <service name>.<ingestion name> ## e.g., "my_redshift.metadata"
```

### 2. Run with the CLI

First, we will need to save the YAML file. Afterward, and with all requirements installed, we can run:

```bash theme={null}
metadata ingest -c <path-to-yaml>
```

Note that from connector to connector, this recipe will always be the same. By updating the YAML configuration,
you will be able to extract metadata from different sources.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.