# Configure a Redshift Integration

{% @mermaid/diagram content="graph LR
A(Authenticate) --> B(Configure integration) --> C(Map users and create policies) --> D(Register metadata);
style A fill:#fff
style B fill:#2F6BA7,color:#fff
style C fill:#fff
style D fill:#fff" %}

In the Redshift integration, Immuta generates policy-enforced views in your configured Redshift schema for tables registered as Immuta data sources.

Use the `/integrations` endpoint to

* [configure a Redshift integration](#configure-the-integration)
* [get a Redshift integration](#get-an-integration)
* [get all integrations](#get-all-integrations)
* [update a Redshift integration](#update-an-integration-configuration)
* [delete a Redshift integration](#delete-an-integration)

## Requirements

* `APPLICATION_ADMIN` Immuta permission
* A Redshift cluster with an RA3 node is required for the multi-database integration. You must use a Redshift RA3 instance type because Immuta requires cross-database views, which are only supported in Redshift RA3 instance types. For other instance types, you may configure a single-database integration using one of the [Redshift Spectrum options](https://documentation.immuta.com/2024.2/data-and-integrations/redshift/reference-guides/redshift#redshift-spectrum):
  * Configure the integration with an existing database that contains the external tables. In the steps below, specify an existing database in Redshift as the `database` in which Immuta will add the Immuta-managed schemas and views instead of creating a new database.
  * Create a new database as specified in the steps below, and then re-create all of your external tables in that database.
* For automated installations, the credentials provided must be a Superuser or have the ability to create databases and users and modify grants.
* Account used to configure or edit the integration must have the following Redshift permissions:
  * `CREATE DATABASE`
  * `CREATE USER`
  * `REVOKE ALL PRIVILEGES ON DATABASE`
  * `GRANT TEMP ON DATABASE`
  * `MANAGE GRANTS ON ACCOUNT`

## Configure the integration

You have two options for configuring your Redshift integration:

* [**Automatic setup**](#automatic-setup): Grant Immuta one-time use of credentials to automatically configure your Redshift environment and the integration. When performing an automated installation, Immuta requires temporary, one-time use of credentials with the Redshift permissions listed in the [requirements section](#requirements).

  These privileges will be used to create and configure a new Immuta-managed database within the specified Redshift instance. The credentials are not stored or saved by Immuta, and Immuta doesn’t retain access to them after initial setup is complete.

  You can create a new account for Immuta to use that has these privileges, or you can grant temporary use of a pre-existing account. By default, the pre-existing account with appropriate privileges is a Superuser. If you create a new account, it can be deleted after initial setup is complete.
* [**Manual setup**](#manual-setup): Run the Immuta script in your Redshift environment yourself to configure your Redshift environment and the integration. The specified role used to run the bootstrap needs to have the Redshift permissions listed in the [requirements section](#requirements).

### Automatic setup

Copy the request example from one of the sections below, and replace the values with your own as directed to configure the integration settings. The examples provided use JSON format, but the request also accepts YAML.

See the [**config** object description](https://documentation.immuta.com/2024.2/developer-guides/api-intro/reference-guides/payload#redshift-configuration-objects) for parameter definitions, value types, and additional configuration options.

#### Username and password authentication example

This request specifies `userPassword` as the authentication type for the Immuta system user. The username and password provided are credentials for a system account that can manage the database.

```shell
curl -X 'POST' \
    'https://www.organization.immuta.com/integrations' \
    -H 'accept: application/json' \
    -H 'Content-Type: application/json' \
    -H 'Authorization: 846e9e43c86a4ct1be14290d95127d13f' \
    -d '{
    "type": "Redshift",
    "autoBootstrap": true,
    "config": {
      "host": "organization.aws.amazon.com",
      "database": "immuta",
      "initialDatabase": "REDSHIFT_SAMPLE_DATA",
      "authenticationType": "userPassword",
      "username": "taylor@redshift.com",
      "password": "abc1234"
    }
    }'
```

1. Replace the **Immuta URL** and [**API key**](https://documentation.immuta.com/2024.2/developer-guides/api-intro/getting-started#authenticate-with-the-api) with your own.
2. Change the **config** values to your own, where
   * **host** is the URL of your Redshift account.
   * **database** is the name of a new empty database that the Immuta system user will manage and store metadata in.
   * **initialDatabase** is the name of an existing database in Redshift that Immuta initially connects to and creates the Immuta-managed database.
   * **username** and **password** are the credentials for the system account that can act on Redshift objects and configure the integration.

#### Okta authentication example

This request uses Okta as the authentication type for the Immuta system user and enables impersonation to allow Immuta administrators to grant users permission to query Redshift data as other Immuta users.

```shell
curl -X 'POST' \
    'https://www.organization.immuta.com/integrations' \
    -H 'accept: application/json' \
    -H 'Content-Type: application/json' \
    -H 'Authorization: 846e9e43c86a4ct1be14290d95127d13f' \
    -d '{
    "type": "Redshift",
    "autoBootstrap": true,
    "config": {
      "host": "organization.aws.amazon.com",
      "database": "immuta",
      "initialDatabase": "REDSHIFT_SAMPLE_DATA",
      "impersonation": {
        "enabled": true,
        "role": "immuta_impersonation"
      },
      "authenticationType": "okta",
      "okta": {
        "username": "taylor@redshift.com",
        "password": "abc1234",
        "appId": "Okta",
        "idpHost": "organization.okta.com",
        "role": "admin"
      }
    }
    }'
```

1. Replace the **Immuta URL** and [**API key**](https://documentation.immuta.com/2024.2/developer-guides/api-intro/getting-started#authenticate-with-the-api) with your own.
2. Change the **config** values to your own, where
   * **host** is the URL of your Redshift account.
   * **database** is the name of a new empty database that the Immuta system user will manage and store metadata in.
   * **initialDatabase** is the name of an existing database in Redshift that Immuta initially connects to and creates the Immuta-managed database.
   * **impersonation** specifies whether user impersonation is enabled. See the [object description](https://documentation.immuta.com/2024.2/developer-guides/api-intro/reference-guides/payload#redshift-impersonation-object) for child parameters.
   * **okta** specifies your username, password, appId, idpHost, and role. See the [object description](https://documentation.immuta.com/2024.2/developer-guides/api-intro/reference-guides/payload#okta-object) for details about child parameters.

#### Response

The response returns the status of the Redshift integration configuration connection. See the [response schema reference](https://documentation.immuta.com/2024.2/developer-guides/api-intro/integrations-api/reference-guides/response-schema) for details about the response schema.

{% tabs %}
{% tab title="200 response" %}
A successful response includes the validation tests statuses.

```json
{
  "id": "123456789",
  "status": "creating",
  "validationResults": {
    "status": "passed",
    "validationTests": [
    {
      "name": "Initial Validation: Basic Connection Test",
      "result": [null],
      "status": "passed"
    },
    {
      "name": "Validate Automatic Bootstrap: Immuta Database Does Not Exist",
      "result": [],
      "status": "passed"
    }
    ]
  }
}
```

{% endtab %}

{% tab title="Unsuccessful request" %}
An unsuccessful request returns the status code and an error message. See the [HTTP status codes and error messages](https://documentation.immuta.com/2024.2/developer-guides/api-intro/reference-guides/status-codes#post-errors) for a list of statuses, error messages, and troubleshooting guidance.

```json
{
  "statusCode": 409,
  "error": "Conflict",
  "message": "Redshift integration already exists on host organization.aws.amazon.com (id = 123456789)"
}
```

{% endtab %}
{% endtabs %}

### Manual setup

To manually configure the integration, complete the following steps:

1. [Generate the first Immuta script and run it in your Redshift environment.](#generate-the-first-script)
2. [Generate the second Immuta script and run it inside the database created by the initial script.](#generate-the-second-script)
3. [Configure the integration in Immuta.](#configure-the-integration-in-immuta)

#### Generate the first script

Copy the request example from one of the tabs below, and replace the values with your own as directed to generate the first script. The examples provided use JSON format, but the request also accepts YAML.

See the [**config** object description](https://documentation.immuta.com/2024.2/developer-guides/api-intro/reference-guides/payload#redshift-configuration-objects) for parameter definitions, value types, and additional configuration options.

**Username and password authentication example**

This request specifies `userPassword` as the authentication type for the Immuta system user. The username and password provided are credentials for a system account that can manage the database.

```shell
curl -X 'POST' \
    'https://www.organization.immuta.com/integrations/scripts/initial-create' \
    -H 'accept: application/json' \
    -H 'Content-Type: application/json' \
    -H 'Authorization: 846e9e43c86a4ct1be14290d95127d13f' \
    -d '{
    "type": "Redshift",
    "autoBootstrap": false,
    "config": {
      "host": "organization.aws.amazon.com",
      "database": "immuta",
      "initialDatabase": "REDSHIFT_SAMPLE_DATA",
      "impersonation": {
        "enabled": false
      },
      "authenticationType": "userPassword",
      "username": "taylor@redshift.com",
      "password": "abc1234"
    }
    }'
```

1. Replace the **Immuta URL** and [**API key**](https://documentation.immuta.com/2024.2/developer-guides/api-intro/getting-started#authenticate-with-the-api) with your own.
2. Change the **config** values to your own, where
   * **host** is the URL of your Redshift account.
   * **database** is the name of a new empty database that the Immuta system user will manage and store metadata in.
   * **initialDatabase** is the name of an existing database in Redshift that Immuta initially connects to and creates the Immuta-managed database.
   * **impersonation** specifies whether user impersonation is enabled. See the [object description](https://documentation.immuta.com/2024.2/developer-guides/api-intro/reference-guides/payload#redshift-impersonation-object) for child parameters.
   * **username** and **password** are the credentials for the system account that can act on Redshift objects and configure the integration.
3. Run the script returned in the response in the Redshift **initialDatabase** specified in the payload.

**Okta authentication example**

This request uses Okta as the authentication type for the Immuta system user and enables impersonation to allow Immuta administrators to grant users permission to query Redshift data as other Immuta users.

```shell
curl -X 'POST' \
    'https://www.organization.immuta.com/integrations/scripts/initial-create' \
    -H 'accept: application/json' \
    -H 'Content-Type: application/json' \
    -H 'Authorization: 846e9e43c86a4ct1be14290d95127d13f' \
    -d '{
    "type": "Redshift",
    "autoBootstrap": false,
    "config": {
      "host": "organization.aws.amazon.com",
      "database": "immuta",
      "initialDatabase": "REDSHIFT_SAMPLE_DATA",
      "impersonation": {
        "enabled": true,
        "role": "immuta_impersonation"
      },
      "authenticationType": "okta",
      "okta": {
        "username": "taylor@redshift.com",
        "password": "abc1234",
        "appId": "Okta",
        "idpHost": "organization.okta.com",
        "role": "admin"
      }
    }
    }'
```

1. Replace the **Immuta URL** and [**API key**](https://documentation.immuta.com/2024.2/developer-guides/api-intro/getting-started#authenticate-with-the-api) with your own.
2. Change the **config** values to your own, where
   * **host** is the URL of your Redshift account.
   * **database** is the name of a new empty database that the Immuta system user will manage and store metadata in.
   * **initialDatabase** is the name of an existing database in Redshift that Immuta initially connects to and creates the Immuta-managed database.
   * **impersonation** specifies whether user impersonation is enabled. See the [object description](https://documentation.immuta.com/2024.2/developer-guides/api-intro/reference-guides/payload#redshift-impersonation-object) for child parameters.
   * **okta** specifies your username, password, appId, idpHost, and role. See the [object description](https://documentation.immuta.com/2024.2/developer-guides/api-intro/reference-guides/payload#okta-object) for details about child parameters.
3. Run the script returned in the response in the Redshift **initialDatabase** specified in the payload.

**Response**

The response returns the script for you to run in the Redshift **initialDatabase**.

#### Generate the second script

Copy the request example from one of the tabs below, and replace the values with your own as directed to configure the integration settings. The examples provided use JSON format, but the request also accepts YAML. The payload you provide must match the payload sent when [generating the script](#generate-the-first-script).

See the [**config** object description](https://documentation.immuta.com/2024.2/developer-guides/api-intro/reference-guides/payload#redshift-configuration-objects) for parameter definitions, value types, and additional configuration options.

**Username and password authentication example**

This request specifies `userPassword` as the authentication type for the Immuta system user. The username and password provided are credentials for a system account that can manage the database.

```shell
curl -X 'POST' \
    'https://www.organization.immuta.com/integrations/scripts/create' \
    -H 'accept: application/json' \
    -H 'Content-Type: application/json' \
    -H 'Authorization: 846e9e43c86a4ct1be14290d95127d13f' \
    -d '{
    "type": "Redshift",
    "autoBootstrap": false,
    "config": {
      "host": "organization.aws.amazon.com",
      "database": "immuta",
      "initialDatabase": "REDSHIFT_SAMPLE_DATA",
      "impersonation": {
        "enabled": false
      },
      "authenticationType": "userPassword",
      "username": "taylor@redshift.com",
      "password": "abc1234"
    }
    }'
```

1. Replace the **Immuta URL** and [**API key**](https://documentation.immuta.com/2024.2/developer-guides/api-intro/getting-started#authenticate-with-the-api) with your own.
2. Pass the same payload you sent when [generating the first script](#generate-the-first-script), where
   * **host** is the URL of your Redshift account.
   * **database** is the name of a new empty database that the Immuta system user will manage and store metadata in.
   * **initialDatabase** is the name of an existing database in Redshift that Immuta initially connects to and creates the Immuta-managed database.
   * **impersonation** specifies whether user impersonation is enabled. See the [object description](https://documentation.immuta.com/2024.2/developer-guides/api-intro/reference-guides/payload#redshift-impersonation-object) for child parameters.
   * **username** and **password** are the credentials for the system account that can act on Redshift objects and configure the integration.
3. Run the script returned in the response in the database created by the first script.

**Okta authentication example**

This request uses Okta as the authentication type for the Immuta system user and enables impersonation to allow Immuta administrators to grant users permission to query Redshift data as other Immuta users.

```shell
curl -X 'POST' \
    'https://www.organization.immuta.com/integrations/scripts/create' \
    -H 'accept: application/json' \
    -H 'Content-Type: application/json' \
    -H 'Authorization: 846e9e43c86a4ct1be14290d95127d13f' \
    -d '{
    "type": "Redshift",
    "autoBootstrap": false,
    "config": {
      "host": "organization.aws.amazon.com",
      "database": "immuta",
      "initialDatabase": "REDSHIFT_SAMPLE_DATA",
      "impersonation": {
        "enabled": true,
        "role": "immuta_impersonation"
      },
      "authenticationType": "okta",
      "okta": {
        "username": "taylor@redshift.com",
        "password": "abc1234",
        "appId": "Okta",
        "idpHost": "organization.okta.com",
        "role": "admin"
      }
    }
    }'
```

1. Replace the **Immuta URL** and [**API key**](https://documentation.immuta.com/2024.2/developer-guides/api-intro/getting-started#authenticate-with-the-api) with your own.
2. Pass the same payload you sent when [generating the first script](#generate-the-first-script), where
   * **host** is the URL of your Redshift account.
   * **database** is the name of a new empty database that the Immuta system user will manage and store metadata in.
   * **initialDatabase** is the name of an existing database in Redshift that Immuta initially connects to and creates the Immuta-managed database.
   * **impersonation** specifies whether user impersonation is enabled. See the [object description](https://documentation.immuta.com/2024.2/developer-guides/api-intro/reference-guides/payload#redshift-impersonation-object) for child parameters.
   * **okta** specifies your username, password, appId, idpHost, and role. See the [object description](https://documentation.immuta.com/2024.2/developer-guides/api-intro/reference-guides/payload#okta-object) for details about child parameters.
3. Run the script returned in the response in the database created by the first script.

**Response**

The response returns the script for you to run in the database created by the first script.

#### Configure the integration in Immuta

Copy the request example from one of the tabs below, and replace the values with your own as directed to configure the integration settings. The examples provided use JSON format, but the request also accepts YAML. The payload you provide must match the payload sent when [generating the scripts](#generate-the-first-script).

See the [**config** object description](https://documentation.immuta.com/2024.2/developer-guides/api-intro/reference-guides/payload#redshift-configuration-objects) for parameter definitions, value types, and additional configuration options.

**Username and password authentication example**

This request specifies `userPassword` as the authentication type for the Immuta system user. The username and password provided are credentials for a system account that can manage the database.

```shell
curl -X 'POST' \
    'https://www.organization.immuta.com/integrations' \
    -H 'accept: application/json' \
    -H 'Content-Type: application/json' \
    -H 'Authorization: 846e9e43c86a4ct1be14290d95127d13f' \
    -d '{
    "type": "Redshift",
    "autoBootstrap": false,
    "config": {
      "host": "organization.aws.amazon.com",
      "database": "immuta",
      "initialDatabase": "REDSHIFT_SAMPLE_DATA",
      "impersonation": {
        "enabled": false
      },
      "authenticationType": "userPassword",
      "username": "taylor@redshift.com",
      "password": "abc1234"
    }
    }'
```

1. Replace the **Immuta URL** and [**API key**](https://documentation.immuta.com/2024.2/developer-guides/api-intro/getting-started#authenticate-with-the-api) with your own.
2. Pass the same payload you sent when [generating the scripts](#generate-the-first-script), where
   * **host** is the URL of your Redshift account.
   * **database** is the name of a new empty database that the Immuta system user will manage and store metadata in.
   * **initialDatabase** is the name of an existing database in Redshift that Immuta initially connects to and creates the Immuta-managed database.
   * **impersonation** specifies whether user impersonation is enabled. See the [object description](https://documentation.immuta.com/2024.2/developer-guides/api-intro/reference-guides/payload#redshift-impersonation-object) for child parameters.
   * **username** and **password** are the credentials for the system account that can act on Redshift objects and configure the integration.

**Okta authentication example**

This request uses Okta as the authentication type for the Immuta system user and enables impersonation to allow Immuta administrators to grant users permission to query Redshift data as other Immuta users.

```shell
curl -X 'POST' \
    'https://www.organization.immuta.com/integrations' \
    -H 'accept: application/json' \
    -H 'Content-Type: application/json' \
    -H 'Authorization: 846e9e43c86a4ct1be14290d95127d13f' \
    -d '{
    "type": "Redshift",
    "autoBootstrap": false,
    "config": {
      "host": "organization.aws.amazon.com",
      "database": "immuta",
      "initialDatabase": "REDSHIFT_SAMPLE_DATA",
      "impersonation": {
        "enabled": true,
        "role": "immuta_impersonation"
      },
      "authenticationType": "okta",
      "okta": {
        "username": "taylor@redshift.com",
        "password": "abc1234",
        "appId": "Okta",
        "idpHost": "organization.okta.com",
        "role": "admin"
      }
    }
    }'
```

1. Replace the **Immuta URL** and [**API key**](https://documentation.immuta.com/2024.2/developer-guides/api-intro/getting-started#authenticate-with-the-api) with your own.
2. Pass the same payload you sent when [generating the scripts](#generate-the-first-script), where
   * **host** is the URL of your Redshift account.
   * **database** is the name of a new empty database that the Immuta system user will manage and store metadata in.
   * **initialDatabase** is the name of an existing database in Redshift that Immuta initially connects to and creates the Immuta-managed database.
   * **impersonation** specifies whether user impersonation is enabled. See the [object description](https://documentation.immuta.com/2024.2/developer-guides/api-intro/reference-guides/payload#redshift-impersonation-object) for child parameters.
   * **okta** specifies your username, password, appId, idpHost, and role. See the [object description](https://documentation.immuta.com/2024.2/developer-guides/api-intro/reference-guides/payload#okta-object) for details about child parameters.

#### Response

The response returns the status of the Redshift integration configuration connection. See the [response schema reference](https://documentation.immuta.com/2024.2/developer-guides/api-intro/integrations-api/reference-guides/response-schema) for details about the response schema.

{% tabs %}
{% tab title="200 response" %}
A successful response includes the validation tests statuses.

```json
{
  "id": "123456789",
  "status": "creating",
  "validationResults": {
    "status": "passed",
    "validationTests": [
    {
      "name": "Initial Validation: Basic Connection Test",
      "result": [null],
      "status": "passed"
    },
    {
      "name": "Validate Automatic Bootstrap: Immuta Database Does Not Exist",
      "result": [],
      "status": "passed"
    }
    ]
  }
}
```

{% endtab %}

{% tab title="Unsuccessful response" %}
An unsuccessful request returns the status code and an error message. See the [HTTP status codes and error messages](https://documentation.immuta.com/2024.2/developer-guides/api-intro/reference-guides/status-codes#post-errors) for a list of statuses, error messages, and troubleshooting guidance.

```json
{
  "statusCode": 409,
  "error": "Conflict",
  "message": "Redshift integration already exists on host organization.aws.amazon.com (id = 123456789)"
}
```

{% endtab %}
{% endtabs %}

## Get an integration

```shell
curl -X 'GET' \
    'https://www.organization.immuta.com/integrations/{id}' \
    -H 'accept: application/json' \
    -H 'Content-Type: application/json' \
    -H 'Authorization: 846e9e43c86a4ct1be14290d95127d13f'
```

1. Copy the request example.
2. Replace the **Immuta URL** and [**API key**](https://documentation.immuta.com/2024.2/developer-guides/api-intro/getting-started#authenticate-with-the-api) with your own.
3. Replace the **{id}** request parameter with the unique identifier of the integration you want to get. Alternatively, you can get a list of all integrations and their IDs with the [`GET /integrations` endpoint](https://documentation.immuta.com/2024.2/developer-guides/api-intro/reference-guides/integrations-api#get-integrations).

### Response

The response returns a Redshift integration configuration. See the [response schema reference](https://documentation.immuta.com/2024.2/developer-guides/api-intro/integrations-api/reference-guides/response-schema) for details about the response schema. An unsuccessful request returns the status code and an error message. See the [HTTP status codes and error messages](https://documentation.immuta.com/2024.2/developer-guides/api-intro/reference-guides/status-codes#get-error) for a list of statuses, error messages, and troubleshooting guidance.

{% tabs %}
{% tab title="Username and password authentication" %}

```json
{
  "id": "123456789",
  "status": "enabled",
  "validationResults": {
    "status": "passed",
    "validationTests": [
    {
      "name": "Initial Validation: Basic Connection Test",
      "result": [null],
      "status": "passed"
    },
    {
      "name": "Validate Automatic Bootstrap: Immuta Database Does Not Exist",
      "result": [],
      "status": "passed"
    }
    ]
  },
  "type": "Redshift",
  "autoBootstrap": true,
  "config": {
    "host": "organization.aws.amazon.com",
    "database": "immuta",
    "initialDatabase": "REDSHIFT_SAMPLE_DATA",
    "port": 5439,
    "impersonation": {
      "enabled": false
    },
    "authenticationType": "userPassword",
    "username": "<REDACTED>",
    "password": "<REDACTED>"
  }
}
```

{% endtab %}

{% tab title="Okta authentication" %}

```json
{
  "id": "123456789",
  "status": "enabled",
  "validationResults": {
    "status": "passed",
    "validationTests": [
    {
      "name": "Initial Validation: Basic Connection Test",
      "result": [null],
      "status": "passed"
    },
    {
      "name": "Validate Automatic Bootstrap: Immuta Database Does Not Exist",
      "result": [],
      "status": "passed"
    }
    ]
  },
  "type": "Redshift",
  "autoBootstrap": true,
  "config": {
    "host": "organization.aws.amazon.com",
    "database": "immuta",
    "initialDatabase": "REDSHIFT_SAMPLE_DATA",
    "port": 5439,
    "impersonation": {
      "enabled": true,
      "role": "immuta_impersonation"
    },
    "authenticationType": "okta",
    "okta": {
      "username": "<REDACTED>",
      "appId": "Okta",
      "idpHost": "organization.okta.com",
      "role": "admin"
    }
  }
}
```

{% endtab %}
{% endtabs %}

## Get all integrations

```shell
curl -X 'GET' \
    'https://www.organization.immuta.com/integrations' \
    -H 'accept: application/json' \
    -H 'Content-Type: application/json' \
    -H 'Authorization: 846e9e43c86a4ct1be14290d95127d13f'
```

1. Copy the request example.
2. Replace the **Immuta URL** and [**API key**](https://documentation.immuta.com/2024.2/developer-guides/api-intro/getting-started#authenticate-with-the-api) with your own.

### Response

The response returns the configuration for all integrations. See the [response schema reference](https://documentation.immuta.com/2024.2/developer-guides/api-intro/integrations-api/reference-guides/response-schema) for details about the response schema. An unsuccessful request returns the status code and an error message. See the [HTTP status codes and error messages](https://documentation.immuta.com/2024.2/developer-guides/api-intro/reference-guides/status-codes#get-error) for a list of statuses, error messages, and troubleshooting guidance.

```json
[
  {
    "id": "1",
    "status": "enabled",
    "validationResults": {
      "status": "passed",
      "validationTests": [
        {
          "name": "Initial Validation: Basic Connection Test",
          "status": "passed"
        },
        {
          "name": "Initial Validation: Default Warehouse Access Test",
          "status": "passed",
          "result": []
        },
        {
          "name": "Initial Validation: Validate access to Privileged Role",
          "status": "passed",
          "result": []
        },
        {
          "name": "Validate Automatic: Database Does Not Exist",
          "status": "passed"
        },
        {
          "name": "Validate Automatic: Impersonation Role Does Not Exist",
          "status": "skipped"
        },
        {
          "name": "Validate Automatic Bootstrap User Grants",
          "status": "passed"
        }
      ]
    },
    "type": "Snowflake",
    "autoBootstrap": true,
    "config": {
      "host": "organization.us-east-1.snowflakecomputing.com",
      "warehouse": "SAMPLE_WAREHOUSE",
      "database": "SNOWFLAKE_SAMPLE_DATA",
      "port": 443,
      "audit": {
        "enabled": false
      },
      "workspaces": {
        "enabled": false
      },
      "impersonation": {
        "enabled": false
      },
      "lineage": {
        "enabled": false
      },
      "authenticationType": "userPassword",
      "username": "<REDACTED>",
      "password": "<REDACTED>",
      "role": "ACCOUNTADMIN"
    }
  },
  {
    "id": "2",
    "status": "enabled",
    "type": "Databricks",
    "validationResults": {
      "status": "passed",
      "validationTests": [
        {
          "name": "Metastore validation",
          "status": "passed"
        },
        {
          "name": "Basic Connection Test",
          "result": [
            {
              "1": 1
            }
          ],
          "status": "passed"
        }
      ]
    },
    "autoBootstrap": true,
    "config": {
      "workspaceUrl": "www.example-workspace.cloud.databricks.com",
      "httpPath": "sql/protocolv1/o/0/0000-00000-abc123",
      "token": "REDACTED",
      "audit": {
        "enabled": false
      },
      "catalog": "immuta"
    }
  }
]
```

## Update an integration configuration

You have two options for updating your integration. Follow the steps that match your initial configuration of **autoBootstrap**:

* [**automatic update**](#automatic-update) (**autoBootstrap** is `true`)
* [**manual update**](#manual-update) (**autoBootstrap** is `false`)

### Automatic update

Copy the request example, and replace the values with your own as directed to update the integration settings. The example provided uses JSON format, but the request also accepts YAML.

See the [**config** object description](https://documentation.immuta.com/2024.2/developer-guides/api-intro/reference-guides/payload#redshift-configuration-objects) for parameter definitions, value types, and additional configuration options.

```shell
curl -X 'PUT' \
    'https://www.organization.immuta.com/integrations/{id}' \
    -H 'accept: application/json' \
    -H 'Content-Type: application/json' \
    -H 'Authorization: 846e9e43c86a4ct1be14290d95127d13f' \
    -d '{
    "type": "Redshift",
    "autoBootstrap": true,
    "config": {
      "host": "organization.aws.amazon.com",
      "database": "immuta",
      "initialDatabase": "REDSHIFT_SAMPLE_DATA",
      "authenticationType": "okta",
      "okta": {
        "username": "taylor@redshift.com",
        "password": "abc1234",
        "appId": "Okta",
        "idpHost": "organization.okta.com",
        "role": "admin"
      }
    }
    }'
```

1. Replace the **Immuta URL** and [**API key**](https://documentation.immuta.com/2024.2/developer-guides/api-intro/getting-started#authenticate-with-the-api) with your own.
2. Replace the **{id}** request parameter with the unique identifier of the integration you want to update.
3. Change the **config** values to your own, where
   * **host** is the URL of your Redshift account.
   * **database** is the name of a new empty database that the Immuta system user will manage and store metadata in.
   * **initialDatabase** is the name of an existing database in Redshift that Immuta initially connects to and creates the Immuta-managed database.
   * **okta** specifies your username, password, appId, idpHost, and role. See the [object description](https://documentation.immuta.com/2024.2/developer-guides/api-intro/reference-guides/payload#okta-object) for details about child parameters.

### Response

The response returns the status of the Redshift integration configuration connection. See the [response schema reference](https://documentation.immuta.com/2024.2/developer-guides/api-intro/integrations-api/reference-guides/response-schema) for details about the response schema.

{% tabs %}
{% tab title="200 response" %}
A successful response includes the validation tests statuses.

```json
{
  "id": "123456789",
  "status": "editing",
  "validationResults": {
    "status": "passed",
    "validationTests": [
    {
      "name": "Initial Validation: Basic Connection Test",
      "result": [null],
      "status": "passed"
    },
    {
      "name": "Validate Automatic Bootstrap: Immuta Database Does Not Exist",
      "result": [],
      "status": "passed"
    }
    ]
  }
}
```

{% endtab %}

{% tab title="Unsuccessful response" %}
An unsuccessful request returns the status code and an error message. See the [HTTP status codes and error messages](https://documentation.immuta.com/2024.2/developer-guides/api-intro/reference-guides/status-codes#put-errors) for a list of statuses, error messages, and troubleshooting guidance.

```json
{
  "statusCode": 409,
  "error": "Conflict",
  "message": "Unable to edit integration with ID 123456789 in current state editing."
}
```

{% endtab %}
{% endtabs %}

### Manual update

To manually update the integration, complete the following steps:

1. [Generate the updated Immuta script and run it in your Redshift environment.](#generate-the-updated-script)
2. [Update the integration in Immuta.](#update-the-integration-in-immuta)

#### Generate the updated script

Copy the request example, and replace the values with your own as directed to generate the script. The example provided uses JSON format, but the request also accepts YAML.

See the [**config** object description](https://documentation.immuta.com/2024.2/developer-guides/api-intro/reference-guides/payload#redshift-configuration-objects) for parameter definitions, value types, and additional configuration options.

```shell
curl -X 'POST' \
    'https://www.organization.immuta.com/integrations/{id}/scripts/edit' \
    -H 'accept: application/json' \
    -H 'Content-Type: application/json' \
    -H 'Authorization: 846e9e43c86a4ct1be14290d95127d13f' \
    -d '{
    "type": "Redshift",
    "autoBootstrap": false,
    "config": {
      "host": "organization.aws.amazon.com",
      "database": "immuta",
      "initialDatabase": "REDSHIFT_SAMPLE_DATA",
      "impersonation": {
        "enabled": false
      },
      "authenticationType": "okta",
      "okta": {
        "username": "taylor@redshift.com",
        "password": "abc1234",
        "appId": "Okta",
        "idpHost": "organization.okta.com",
        "role": "admin"
      }
    }
    }'
```

1. Replace the **Immuta URL** and [**API key**](https://documentation.immuta.com/2024.2/developer-guides/api-intro/getting-started#authenticate-with-the-api) with your own.
2. Replace the **{id}** request parameter with the unique identifier of the integration you want to update.
3. Change the **config** values to your own, where
   * **host** is the URL of your Redshift account.
   * **database** is the name of a new empty database that the Immuta system user will manage and store metadata in.
   * **initialDatabase** is the name of an existing database in Redshift that Immuta initially connects to and creates the Immuta-managed database.
   * **impersonation** specifies whether user impersonation is enabled. See the [object description](https://documentation.immuta.com/2024.2/developer-guides/api-intro/reference-guides/payload#redshift-impersonation-object) for child parameters.
   * **okta** specifies your username, password, appId, idpHost, and role. See the [object description](https://documentation.immuta.com/2024.2/developer-guides/api-intro/reference-guides/payload#okta-object) for details about child parameters.
4. Run the script returned in the response in your Redshift environment.

**Response**

The response returns the script for you to run in your Redshift environment.

#### Update the integration in Immuta

Copy the request example, and replace the values with your own as directed to update the integration settings. The example provided uses JSON format, but the request also accepts YAML. The payload you provide must match the payload sent when [generating the script](#generate-the-updated-script).

See the [**config** object description](https://documentation.immuta.com/2024.2/developer-guides/api-intro/reference-guides/payload#redshift-configuration-objects) for parameter definitions, value types, and additional configuration options.

```shell
curl -X 'PUT' \
    'https://www.organization.immuta.com/integrations/{id}' \
    -H 'accept: application/json' \
    -H 'Content-Type: application/json' \
    -H 'Authorization: 846e9e43c86a4ct1be14290d95127d13f' \
    -d '{
    "type": "Redshift",
    "autoBootstrap": false,
    "config": {
      "host": "organization.aws.amazon.com",
      "database": "immuta",
      "initialDatabase": "REDSHIFT_SAMPLE_DATA",
      "impersonation": {
        "enabled": false
      },
      "authenticationType": "okta",
      "okta": {
        "username": "taylor@redshift.com",
        "password": "abc1234",
        "appId": "Okta",
        "idpHost": "organization.okta.com",
        "role": "admin"
      }
    }
    }'
```

1. Replace the **Immuta URL** and [**API key**](https://documentation.immuta.com/2024.2/developer-guides/api-intro/getting-started#authenticate-with-the-api) with your own.
2. Replace the **{id}** request parameter with the unique identifier of the integration you want to update.
3. Pass the same payload you sent when [updating the script](#generate-the-updated-script), where
   * **host** is the URL of your Redshift account.
   * **database** is the name of a new empty database that the Immuta system user will manage and store metadata in.
   * **initialDatabase** is the name of an existing database in Redshift that Immuta initially connects to and creates the Immuta-managed database.
   * **impersonation** specifies whether user impersonation is enabled. See the [object description](https://documentation.immuta.com/2024.2/developer-guides/api-intro/reference-guides/payload#redshift-impersonation-object) for child parameters.
   * **okta** specifies your username, password, appId, idpHost, and role. See the [object description](https://documentation.immuta.com/2024.2/developer-guides/api-intro/reference-guides/payload#okta-object) for details about child parameters.

#### Response

The response returns the status of the Redshift integration configuration connection. See the [response schema reference](https://documentation.immuta.com/2024.2/developer-guides/api-intro/integrations-api/reference-guides/response-schema) for details about the response schema.

{% tabs %}
{% tab title="200 response" %}
A successful response includes the validation tests statuses.

```json
{
  "id": "123456789",
  "status": "editing",
  "validationResults": {
    "status": "passed",
    "validationTests": [
    {
      "name": "Initial Validation: Basic Connection Test",
      "result": [null],
      "status": "passed"
    },
    {
      "name": "Validate Automatic Bootstrap: Immuta Database Does Not Exist",
      "result": [],
      "status": "passed"
    }
    ]
  }
}
```

{% endtab %}

{% tab title="Unsuccessful response" %}
An unsuccessful request returns the status code and an error message. See the [HTTP status codes and error messages](https://documentation.immuta.com/2024.2/developer-guides/api-intro/reference-guides/status-codes#put-errors) for a list of statuses, error messages, and troubleshooting guidance.

```json
{
  "statusCode": 409,
  "error": "Conflict",
  "message": "Unable to edit integration with ID 123456789 in current state editing."
}
```

{% endtab %}
{% endtabs %}

## Delete an integration

```shell
curl -X 'DELETE' \
    'https://www.organization.immuta.com/integrations/{id}' \
    -H 'accept: application/json' \
    -H 'Content-Type: application/json' \
    -H 'Authorization: 846e9e43c86a4ct1be14290d95127d13f' \
    -d '{
    "authenticationType": "userPassword",
    "username": "taylor@redshift.com",
    "password": "abc1234"
    }'
```

1. Copy the request example.
2. Replace the **Immuta URL** and [**API key**](https://documentation.immuta.com/2024.2/developer-guides/api-intro/getting-started#authenticate-with-the-api) with your own.
3. Replace the **{id}** request parameter with the unique identifier of the integration you want to delete.
4. If you set
   * **autoBootstrap** to `true` when enabling the integration, specify the [**authenticationType**](https://documentation.immuta.com/2024.2/developer-guides/api-intro/reference-guides/payload#authenticationtypeRedshift) and the credentials you used to configure the integration in the payload, as illustrated in the example.
   * **autoBootstrap** to `false` when enabling the integration, use the script [cleanup](https://documentation.immuta.com/2024.2/developer-guides/api-intro/reference-guides/integrations-api#post-integrationsscriptscleanup) endpoint (for integrations that were not successfully created) or the [delete](https://documentation.immuta.com/2024.2/developer-guides/api-intro/reference-guides/integrations-api#post-integrationsidscriptsdelete) endpoint (for integrations that were successfully created) to remove Immuta-managed resources from your environment. Then, make the request above without including a payload to remove the integration from Immuta.

### Response

The response returns the status of the Redshift integration configuration that has been deleted. See the [response schema reference](https://documentation.immuta.com/2024.2/developer-guides/api-intro/integrations-api/reference-guides/response-schema) for details about the response schema. An unsuccessful request returns the status code and an error message. See the [HTTP status codes and error messages](https://documentation.immuta.com/2024.2/developer-guides/api-intro/reference-guides/status-codes#delete-errors) for a list of statuses, error messages, and troubleshooting guidance.

```json
{
  "id": "123456789",
  "status": "deleting",
  "validationResults": {
    "status": "passed",
    "validationTests": [
    {
      "name": "Initial Validation: Basic Connection Test",
      "result": [null],
      "status": "passed"
    },
    {
      "name": "Validate Automatic Bootstrap: Immuta Database Does Not Exist",
      "result": [],
      "status": "passed"
    }
    ]
  }
}
```
