# Configuring Amazon Redshift workspace data connections

During workspace creation, under **Connection Type**, click **Redshift**.

## Connecting to the source database <a href="#redshift-connect-source-database" id="redshift-connect-source-database"></a>

In the **Source Settings** section, provide the details about the source database:

### Specifying the source connection details <a href="#redshift-source-connection-details" id="redshift-source-connection-details"></a>

To provide the connection details for the source database:

1. In the **Server** field, provide the server where the database is located.
2. In the **Database** field, provide the name of the database.
3. In the **Port** field, provide the port to use to connect to the database.
4. In the **Username** field, provide the username for the account to use to connect to the database.
5. For **Password**, you can either specify the password manually or, if secrets managers are available, you can [select a secret name from a secrets manager](https://docs.tonic.ai/app/workspace/managing-workspaces/workspace-configuration-settings/secrets-manager/selecting-a-secrets-manager-secret).
6. In the **S3 Bucket Path** field, specify the S3 bucket where Tonic Structural places temporary CSV files that it uses to load and unload Amazon Redshift tables.\
   \
   During data generation, CSV files containing the source data are copied to an `input` folder in the S3 bucket.\
   \
   After the generators are applied, CSV files containing the destination data are copied to an `output` folder in the S3 bucket.
7. To test the connection to the source database, click **Test Source Connection**.

### Ensuring encryption of source database authentication <a href="#redshift-source-auth-encryption" id="redshift-source-auth-encryption"></a>

The **Enable SSL/TLS** setting indicates whether to encrypt source database authentication data.

By default, the toggle is in the on position. We strongly recommend that you do not turn off this setting.

## Determining ownership in the destination database <a href="#redshift-data-gen-destination-ownership" id="redshift-data-gen-destination-ownership"></a>

By default, the admin user for the destination database gains ownership of the schema and tables, and the **Preserve source database owners in destination database** toggle is in the off position.

To instead preserve the source database owner relationships, such as schema and table ownership,  in the destination database, toggle **Preserve source database owners in destination database** to the on position. Note that if you preserve the source database owners, then the destination database user must be a superuser.

## Limiting the included schemas <a href="#redshift-workspace-limit-schemas" id="redshift-workspace-limit-schemas"></a>

By default, the source database includes all of the schemas. To specify a list of specific schemas to either include or exclude:

1. Toggle **Limit Schemas** to the on position.
2. From the filter option dropdown list, select whether to include or exclude the listed schemas.
3. In the field, provide the list of schemas to either include or exclude. Use commas or semicolons to separate the schemas.

Do not exclude schemas that are referred to by included schemas, unless you create those schemas manually outside of Structural.

## Connecting to the destination database <a href="#redshift-connect-destination-database" id="redshift-connect-destination-database"></a>

In the **Destination Settings** section, you specify the connection information for the destination database.

### Copying the source connection details <a href="#redshift-data-connection-destination-copy-source" id="redshift-data-connection-destination-copy-source"></a>

To copy the connection details from the source database:

1. Click **Copy Settings from Source**.
2. For **Password**, you can either specify the password manually or, if secrets managers are available, you can [select a secret name from a secrets manager](https://docs.tonic.ai/app/workspace/managing-workspaces/workspace-configuration-settings/secrets-manager/selecting-a-secrets-manager-secret).
3. To test the connection to the destination database, click **Test Destination Connection**.

### Specifying the destination connection details <a href="#redshift-data-connection-destination-provide-details" id="redshift-data-connection-destination-provide-details"></a>

If you do not copy the source connection details, then to specify the connection information for the destination database:

1. In the **Server** field, provide the server where the database is located.
2. In the **Database** field, provide the name of the database.
3. In the **Port** field, provide the port to use to connect to the database.
4. In the **Username** field, provide the username for the account to use to connect to the database.
5. For **Password**, you can either specify the password manually or, if secrets managers are available, you can [select a secret name from a secrets manager](https://docs.tonic.ai/app/workspace/managing-workspaces/workspace-configuration-settings/secrets-manager/selecting-a-secrets-manager-secret).
6. To test the connection to the destination database, click **Test Destination Connection**.

### Ensuring encryption of destination database authentication <a href="#redshift-destination-enable-ssl" id="redshift-destination-enable-ssl"></a>

The **Enable SSL/TLS** setting indicates whether to encrypt authentication data for the destination database.

By default, it is in the on position. We strongly recommend that you do not turn off this setting.
