# AWS Glue (beta)

### **Before you start**

{% hint style="info" %}
Ensure AWS Glue database and tables are setup in your AWS Glue instance. For details, see [Adding an AWS Glue crawler](https://docs.aws.amazon.com/glue/latest/ug/tutorial-add-crawler.html).
{% endhint %}

To connect AWS Glue to Select Star, you will need to...

1. [Connect AWS Glue to Select Star](#1.-connect-aws-glue-to-select-star)
2. [Create an AWS IAM Role ARN using Cloudformation](#2.-create-an-aws-iam-role-arn-using-cloudformation)
3. [Confirm authorization](#3.-confirm-authorization)
4. [Choose Catalogs and Databases](#4.-choose-catalogs-and-databases)

### **1**. Connect AWS Glue to Select Star

Select AWS Glue from the Add Data Source menu and provide the

**Display Name** - This value is `AWS Glue` by default, but you can overrided.

**Region** - ID of the AWS region where the cluster was created. For example `us-east-2`,`us-west-1`, `eu-central-1`

<figure><img src="https://3470314135-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MgAiVthA_yg9UXKuhyY%2Fuploads%2Fgit-blob-3b7dd7ce27932f7fd9ad018cb40c7119240c2a43%2F2023-05-01%2015.24.57.gif?alt=media" alt=""><figcaption><p>Select AWS Glue from the Source Type list</p></figcaption></figure>

### 2. **Create** an AWS IAM Role ARN using Cloudformation

Select Star recommends use of AWS CloudFormation to setup integration, which allows you to make necessary changes to the AWS Glue environment in a automatic, transparent, safe and auditable manner.

AWS CloudFormation creates an AWS IAM Role to enable access for Select Star and add it to AWS Glue cluster.

The source code of the CloudFormation template along with build scripts and real-time logs of the continuous deployment system is available on public repository on GitHub "[selectstar/cloudformation-templates](https://github.com/selectstar/cloudformation-templates/tree/main/glue)" to be freely audited.

You can pass the link to CloudFormation to the infrastructure team to enable the integration to be created.

1\. A simple form will be displayed in Select Star.

<figure><img src="https://3470314135-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MgAiVthA_yg9UXKuhyY%2Fuploads%2Fgit-blob-63e58df48fbb59bc8e4879b4005afaef704aa384%2Fimage.png?alt=media" alt=""><figcaption><p>Provide a Role ARN</p></figcaption></figure>

2\. Select the "Open CloudFormation" button. A new window will open to proceed to the creation of a CloudFormation stack by AWS Management Console. Make sure you are logged into the AWS account in which the AWS Glue cluster exist.

3\. The **Create Stack** form will be displayed. Fill form in the required information:

<figure><img src="https://3470314135-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MgAiVthA_yg9UXKuhyY%2Fuploads%2Fgit-blob-805b6a14ef1912c84d550faf9508fe9639d42b07%2Fimage.png?alt=media" alt=""><figcaption></figcaption></figure>

4\. Review the information and under **Capabilities** choose "I acknowledge that AWS CloudFormation might create IAM resources".

<figure><img src="https://3470314135-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MgAiVthA_yg9UXKuhyY%2Fuploads%2Fgit-blob-fcbabe6084ce50291ed8c5f16d1eda4a3dadb575%2Fimage%20(17).png?alt=media" alt=""><figcaption></figcaption></figure>

5\. Click **Create stack**.

6\. Wait until the stack changes it status to "<mark style="color:green;">CREATE\_COMPLETE</mark>" from "CREATE\_IN\_PROGRESS" in tab "**Stack Info**". The operation should take up to 5 minutes. You need to refresh tab to see the progress.

<figure><img src="https://3470314135-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MgAiVthA_yg9UXKuhyY%2Fuploads%2Fgit-blob-73cc7e0f4c47ade947218d67f3ed0949e8a573d6%2Fimage.png?alt=media" alt=""><figcaption></figcaption></figure>

7\. After completing stack creation, the `Role ARN` is available from the "**Outputs**". Copy and save the `RoleArn` for later use.

<figure><img src="https://3470314135-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MgAiVthA_yg9UXKuhyY%2Fuploads%2Fgit-blob-81a86764d491f38544c50645b0a862280e4f19f8%2Fimage.png?alt=media" alt=""><figcaption><p>Outputs tab</p></figcaption></figure>

### 3. Confirm authorization

1\. Return to Select Star. You should see a form that allows you to provide "Role ARN". Fill form in the required information:

* **Role ARN:** Identifier of AWS IAM Role to use by Select Star. You'll see this after completing [step 2.7](#2.-create-an-aws-iam-role-arn-using-cloudformation) of the instructions.

<figure><img src="https://3470314135-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MgAiVthA_yg9UXKuhyY%2Fuploads%2Fgit-blob-f91230817e21c0faa5f4aa4adce8df60ea4d235d%2Fimage.png?alt=media" alt=""><figcaption><p>Enter Role ARN from Step 2.7</p></figcaption></figure>

2\. Click **Connect**.

### 4. Choose Catalogs and Databases

After you fill in the information, you'll be asked to select the catalogs and databases you'd like to load into Select Star.

{% hint style="info" %}
Select Star will not read queries or metadata or generate lineage for databases, or tables that are not loaded. Please load all data for which you expect to see lineage.

You can [change the catalog and databases](https://docs.selectstar.com/data-source-management/manage-data-sources#configure-a-data-source) you have loaded if needed.
{% endhint %}

Select the Catalog from the list (if more than one).

<figure><img src="https://3470314135-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MgAiVthA_yg9UXKuhyY%2Fuploads%2Fgit-blob-d7c2035c386c7bbac58c41a29086fe642e56a3e9%2Fimage.png?alt=media" alt=""><figcaption><p>Ingesting Catalog</p></figcaption></figure>

Select Databases from the list.

<figure><img src="https://3470314135-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MgAiVthA_yg9UXKuhyY%2Fuploads%2Fgit-blob-fd3ec696747ad5e832795dd0396c545f247b8906%2Fimage.png?alt=media" alt=""><figcaption><p>Select Databases</p></figcaption></figure>

Click Next and your metadata should start loading automatically. Please allow 24-48 hours to completely generate lineage.

<figure><img src="https://3470314135-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MgAiVthA_yg9UXKuhyY%2Fuploads%2Fgit-blob-9b1aae5372cb3df5978b07a64d71f5266f2c1ce0%2Fimage.png?alt=media" alt=""><figcaption></figcaption></figure>

When the sync is complete, you'll be able to explore AWS Glue in Select Star.
