

# Connecting to Teradata Vantage in AWS Glue Studio
<a name="connecting-to-data-teradata"></a>

 AWS Glue provides built-in support for Teradata Vantage. AWS Glue Studio provides a visual interface to connect to Teradata, author data integration jobs, and run them on the AWS Glue Studio serverless Spark runtime. 

 AWS Glue Studio creates a unified connection for Teradata Vantage. For more information, see [Considerations](using-connectors-unified-connections.md#using-connectors-unified-connections-considerations). 

**Topics**
+ [

# Creating a Teradata Vantage connection
](creating-teradata-connection.md)
+ [

# Creating a Teradata source node
](creating-teradata-source-node.md)
+ [

# Creating a Teradata target node
](creating-teradata-target-node.md)
+ [

## Advanced options
](#creating-teradata-connection-advanced-options)

# Creating a Teradata Vantage connection
<a name="creating-teradata-connection"></a>

To connect to Teradata Vantage from AWS Glue, you will need to create and store your Teradata credentials in an AWS Secrets Manager secret, then associate that secret with a AWS Glue Teradata connection.

**Prerequisites**:
+ If you are accessing your Teradata environment through Amazon VPC, configure Amazon VPC to allow your AWS Glue job to communicate with the Teradata environment. We discourage accessing the Teradata environment over the public internet.

  In Amazon VPC, identify or create a **VPC**, **Subnet** and **Security group** that AWS Glue will use while executing the job. Additionally, you need to ensure Amazon VPC is configured to permit network traffic between your Teradata instance and this location. Your job will need to establish a TCP connection with your Teradata client port. For more information about Teradata ports, see the [Teradata documentation](https://docs.teradata.com/r/Teradata-VantageTM-on-AWS-DIY-Installation-and-Administration-Guide/April-2020/Before-Deploying-Vantage-on-AWS-DIY/Security-Groups-and-Ports).

  Based on your network layout, secure VPC connectivity may require changes in Amazon VPC and other networking services. For more information about AWS connectivity, consult [AWS Connectivity Options](https://docs.teradata.com/r/Teradata-VantageCloud-Enterprise/Get-Started/Connecting-Your-Environment/AWS-Connectivity-Options) in the Teradata documentation.

**To configure a AWS Glue Teradata connection:**

1. In your Teradata configuration, identify or create a user and password AWS Glue will connect with, *teradataUser* and *teradataPassword*. For more information, consult [Vantage Security Overview](https://docs.teradata.com/r/Configuring-Teradata-VantageTM-After-Installation/January-2021/Security-Overview/Vantage-Security-Overview) in the Teradata documentation.

1. In AWS Secrets Manager, create a secret using your Teradata credentials. To create a secret in Secrets Manager, follow the tutorial available in [ Create an AWS Secrets Manager secret ](https://docs.aws.amazon.com//secretsmanager/latest/userguide/create_secret.html) in the AWS Secrets Manager documentation. After creating the secret, keep the Secret name, *secretName* for the next step. 
   + When selecting **Key/value pairs**, create a pair for the key `user` with the value *teradataUsername*.
   + When selecting **Key/value pairs**, create a pair for the key `password` with the value *teradataPassword*.

1. In the AWS Glue console, create a connection by following the steps in [Adding an AWS Glue connection](console-connections.md). After creating the connection, keep the connection name, *connectionName*, for the next step. 
   + When selecting a **Connection type**, select Teradata.
   + When providing **JDBC URL**, provide the URL for your instance. You can also hardcode certain comma separated connection parameters in your JDBC URL. The URL must conform to the following format: `jdbc:teradata://teradataHostname/ParameterName=ParameterValue,ParameterName=ParameterValue`

     Supported URL parameters include:
     + `DATABASE`– name of database on host to access by default.
     + `DBS_PORT`– the database port, used when running on a nonstandard port.
   + When selecting a **Credential type**, select **AWS Secrets Manager**, then set **AWS Secret** to *secretName*.

1. In the following situations, you may require additional configuration:
   + 

     For Teradata instances hosted on AWS in an Amazon VPC
     + You will need to provide Amazon VPC connection information to the AWS Glue connection that defines your Teradata security credentials. When creating or updating your connection, set **VPC**, **Subnet** and **Security groups** in **Network options**.

# Creating a Teradata source node
<a name="creating-teradata-source-node"></a>

## Prerequisites needed
<a name="creating-teradata-source-node-prerequisites"></a>
+ An AWS Glue Teradata Vantage connection, configured with an AWS Secrets Manager secret, as described in the previous section, [Creating a Teradata Vantage connection](creating-teradata-connection.md).
+ Appropriate permissions on your job to read the secret used by the connection.
+ A Teradata table you would like to read from, *tableName*, or query *targetQuery*.

## Adding a Teradata data source
<a name="creating-teradata-source-node-add"></a>

**To add a **Data source – Teradata** node:**

1.  Choose the connection for your Teradata data source. Since you have created it, it should be available in the dropdown. If you need to create a connection, choose **Create a new connection**. For more information see the previous section, [Creating a Teradata Vantage connection](creating-teradata-connection.md). 

    Once you have chosen a connection, you can view the connection properties by clicking **View properties**. 

1.  Choose a **Teradata Source** option: 
   +  **Choose a single table** – access all data from a single table. 
   +  **Enter custom query ** – access a dataset from multiple tables based on your custom query. 

1.  If you chose a single table, enter *tableName*. 

    If you chose **Enter custom query**, enter a SQL SELECT query. 

1.  In **Custom Teradata properties**, enter parameters and values as needed. 

# Creating a Teradata target node
<a name="creating-teradata-target-node"></a>

## Prerequisites needed
<a name="creating-teradata-target-node-prerequisites"></a>
+ A AWS Glue Teradata Vantage connection, configured with an AWS Secrets Manager secret, as described in the previous section, [Creating a Teradata Vantage connection](creating-teradata-connection.md).
+ Appropriate permissions on your job to read the secret used by the connection.
+ A Teradata table you would like to write to, *tableName*.

## Adding a Teradata data target
<a name="creating-teradata-target-node-add"></a>

**To add a **Data target – Teradata** node:**

1.  Choose the connection for your Teradata data source. Since you have created it, it should be available in the dropdown. If you need to create a connection, choose **Create Teradata connection**. For more information, see [ Overview of using connectors and connections ](https://docs.aws.amazon.com/glue/latest/ug/connectors-chapter.html#using-connectors-overview). 

    Once you have chosen a connection, you can view the connection properties by clicking **View properties**. 

1. Configure **Table name** by providing *tableName*.

1.  In **Custom Teradata properties**, enter parameters and values as needed. 

## Advanced options
<a name="creating-teradata-connection-advanced-options"></a>

You can provide advanced options when creating a Teradata node. These options are the same as those available when programming AWS Glue for Spark scripts.

See [Teradata Vantage connections](aws-glue-programming-etl-connect-teradata-home.md). 