> For the complete documentation index, see [llms.txt](https://upsolver.gitbook.io/content/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://upsolver.gitbook.io/content/how-to-guides-1/connectors/create-connections/aws-glue-data-catalog.md).

# AWS Glue Data Catalog

AWS Glue Data Catalog connections serve as a metadata store connection type needed to create Upsolver-managed tables in Upsolver. When a table is created in Upsolver using an AWS Glue Data Catalog connection, its underlying files are stored in Amazon S3 and a pointer to the table is created in your AWS Glue Data Catalog.

AWS Glue Data Catalog connections also double as Athena connections in Upsolver, so if your goal is to write your transformed data into an Athena table, you should first ensure you have an AWS Glue Data Catalog connection with the correct credentials to write to your intended location.

{% hint style="success" %}
Note that an AWS Glue Data Catalog connection is created by default when you deploy Upsolver on your AWS account.

See [Deploy Upsolver on AWS](/content/how-to-guides-1/setup/deploy-upsolver-on-aws.md) for more information.&#x20;
{% endhint %}

## Create an AWS Glue Data Catalog connection

#### Simple example

An AWS Glue Data Catalog connection can be created as follows:

```sql
CREATE GLUE_CATALOG CONNECTION my_glue_catalog_connection
    DEFAULT_STORAGE_CONNECTION = my_s3_storage_connection
    DEFAULT_STORAGE_LOCATION = 's3://sqlake/my_glue_catalog_table_files/';
```

Note that the connection in this example is created based on the default credentials derived from Upsolver's integration with your AWS account.

Additionally, you need an [Amazon S3](/content/reference-1/sql-commands/connections/create-connection/amazon-s3.md) connection with write permissions in order to create any Glue Catalog connection.&#x20;

#### Full example

The following example also creates an AWS Glue Data Catalog connection but additionally configures credentials by providing a specific role:

```sql
CREATE GLUE_CATALOG CONNECTION my_glue_catalog_connection
    AWS_ROLE = 'arn:aws:iam::123456789012:role/upsolver-sqlake-role'
    DEFAULT_STORAGE_CONNECTION = my_s3_storage_connection
    DEFAULT_STORAGE_LOCATION = 's3://sqlake/my_glue_catalog_table_files/'
    REGION = 'us-east-1'
    DATABASE_DISPLAY_FILTERS = ('demo_db', 'prod_db')
    COMMENT = 'glue catalog connection example';
```

To establish a connection with specific permissions, you can configure the `AWS_ROLE` and `EXTERNAL_ID` options like in the example above or you can configure the `AWS_ACCESS_KEY_ID` and `AWS_SECRET_ACCESS_KEY` options to provide the credentials to work with your AWS Glue Data Catalog.

Additionally, the `REGION` option can be used to provide the region of your AWS Glue Data Catalog. &#x20;

You can also limit the list of databases displayed within your catalog by providing the list of database names using `DATABASE_DISPLAY_FILTER[S]`.

Finally using the `COMMENT` option, you can add a description for your connection.

## Alter a Glue Catalog connection

Some connection options are considered mutable, so in some cases, you can run a SQL command to alter an existing AWS Glue Data Catalog connection rather than create a new one.

For example, take the AWS Glue Data Catalog connection we created previously, based on default credentials:

```sql
CREATE GLUE_CATALOG CONNECTION my_glue_catalog_connection
    DEFAULT_STORAGE_CONNECTION = my_s3_storage_connection
    DEFAULT_STORAGE_LOCATION = 's3://sqlake/my_glue_catalog_table_files/';
```

To change the connection's permissions and keep everything else the same without creating a new connection, you can run the following command:

```sql
ALTER GLUE_CATALOG CONNECTION my_glue_catalog_connection
    SET AWS_ROLE = 'arn:aws:iam::123456789012:role/new-sqlake-role'; 
```

Note that some options such as `REGION` cannot be altered once the connection has been created.

## Drop a Glue Catalog connection

If you no longer need a connection, you can easily drop it with the following SQL command:

```sql
DROP CONNECTION my_glue_catalog_connection; 
```

However, be aware that the connection cannot be deleted if existing tables or jobs depend upon the connection.

***

{% hint style="success" %}
**Learn More**

To discover which connection options are mutable, and to learn more about the options, please see the SQL command reference for [AWS Glue Data Catalog](/content/reference-1/sql-commands/connections/create-connection/aws-glue-data-catalog.md).
{% endhint %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://upsolver.gitbook.io/content/how-to-guides-1/connectors/create-connections/aws-glue-data-catalog.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
