Configure an Amazon Redshift Spectrum Integration

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

Use the /integrations endpoint to

Requirements

Permissions

The user configuring the integration must have the permissions below.

  • APPLICATION_ADMIN Immuta permission

  • The Redshift role used to run the Immuta bootstrap script must have the following privileges when configuring the integration:

    • If using an existing database

      • ALL PRIVILEGES ON DATABASE for the database you configure the integration with, as you must manage grants on that database.

      • CREATE USER

      • GRANT TEMP ON DATABASE

    • If creating a new database

      • CREATE DATABASE

      • CREATE USER

      • GRANT TEMP ON DATABASE

      • REVOKE ALL PRIVILEGES ON DATABASE

Configure the integration

To configure the integration, complete the following steps:

Setup the Immuta database

You have two options for setting up the database Immuta will use to manage the integration and enforce policies:

  • Configure the integration with an existing database that contains the external tables. When configuring the integration, specify an existing database in Amazon Redshift as the database in which Immuta will add the Immuta-managed schemas and views.

    If using an existing database, the Redshift role used to run the Immuta bootstrap script must have the following privileges:

    • ALL PRIVILEGES ON DATABASE for the database you configure the integration with, as you must manage grants on that database.

    • CREATE USER

    • GRANT TEMP ON DATABASE

  • Create a new database: Create a new database for Immuta that manages all schemas and views created when Redshift data is registered in Immuta, and re-create all of your external tables in that database. When configuring the integration, specify this new database you created in Amazon Redshift as the database in which Immuta will add the Immuta-managed schemas and views. If creating a new database, the Redshift role used to run the Immuta bootstrap script must have the following privileges:

    • CREATE DATABASE

    • CREATE USER

    • GRANT TEMP ON DATABASE

    • REVOKE ALL PRIVILEGES ON DATABASE

Generate the script

  1. Copy the request example. The example provided uses JSON format, but the request also accepts YAML.

  2. Replace the Immuta URL and API key with your own.

  3. Change the config values to your own, where

    • host is the URL of your Redshift account.

    • database is the name of the existing or new database that the Immuta system user will manage and store metadata in.

    • impersonation specifies whether user impersonation is enabled. See the object description for child parameters.

    • username and password are the credentials for the system account that can act on Redshift objects and configure the integration.

  4. Run the script returned in the response in the existing or new database you created in Amazon Redshift.

See the config object description for parameter definitions, value types, and additional configuration options.

Response

The response returns the script for you to run in the existing or new database you created for the Immuta system user.

Configure the integration in Immuta

  1. Copy the request example. The example provided uses JSON format, but the request also accepts YAML.

  2. Replace the Immuta URL and API key with your own.

  3. Pass the same payload you sent when generating the script, where

    • host is the URL of your Redshift account.

    • database is the name of the existing or new database that the Immuta system user will manage and store metadata in.

    • impersonation specifies whether user impersonation is enabled. See the object description for child parameters.

    • username and password are the credentials for the system account that can act on Redshift objects and configure the integration.

See the config object description for parameter definitions, value types, and additional configuration options.

Response

The response returns the status of the Amazon Redshift Spectrum integration configuration connection. See the response schema reference for details about the response schema.

A successful response includes the validation tests statuses.

Get an integration

  1. Copy the request example.

  2. Replace the Immuta URL and API key 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.

Response

The response returns an Amazon Redshift Spectrum integration configuration. See the response schema reference 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 for a list of statuses, error messages, and troubleshooting guidance.

Get all integrations

  1. Copy the request example.

  2. Replace the Immuta URL and API key with your own.

Response

The response returns the configuration for all integrations. See the response schema reference 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 for a list of statuses, error messages, and troubleshooting guidance.

Update an integration configuration

To update the integration, complete the following steps:

Generate the updated script

  1. Copy the request example. The example provided uses JSON format, but the request also accepts YAML.

  2. Replace the Immuta URL and API key with your own.

  3. Replace the {id} request parameter with the unique identifier of the integration you want to update.

  4. Change the config values to your own, where

    • host is the URL of your Redshift account.

    • database is the name of the existing or new database that the Immuta system user will manage and store metadata in.

    • impersonation specifies whether user impersonation is enabled. See the object description for child parameters.

    • username and password are the credentials for the system account that can act on Redshift objects and configure the integration.

  5. Run the script returned in the response in your Amazon Redshift environment.

See the config object description for parameter definitions, value types, and additional configuration options.

Response

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

Update the integration in Immuta

  1. Copy the request example. The example provided uses JSON format, but the request also accepts YAML.

  2. Replace the Immuta URL and API key with your own.

  3. Replace the {id} request parameter with the unique identifier of the integration you want to update.

  4. Pass the same payload you sent when updating the script, where

    • host is the URL of your Redshift account.

    • database is the name of the existing or new database that the Immuta system user will manage and store metadata in.

    • impersonation specifies whether user impersonation is enabled. See the object description for child parameters.

    • username and password are the credentials for the system account that can act on Redshift objects and configure the integration.

See the config object description for parameter definitions, value types, and additional configuration options.

Response

The response returns the status of the Amazon Redshift Spectrum integration configuration connection. See the response schema reference for details about the response schema.

A successful response includes the validation tests statuses.

Delete an integration

  1. Use the script cleanup endpoint (for integrations that were not successfully created) or the delete endpoint (for integrations that were successfully created) to remove Immuta-managed resources from your Amazon Redshift environment.

  2. Copy the request example.

  3. Replace the Immuta URL and API key with your own.

  4. Replace the {id} request parameter with the unique identifier of the integration you want to delete.

Response

The response returns the status of the Amazon Redshift Spectrum integration configuration that has been deleted. See the response schema reference 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 for a list of statuses, error messages, and troubleshooting guidance.

Last updated

Was this helpful?