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
A Redshift cluster with an AWS row-level security patch applied. Contact Immuta for guidance.
The
enable_case_sensitive_identifierparameter must be set tofalse(default setting) for your Redshift cluster.
Permissions
The user configuring the integration must have the permissions below.
APPLICATION_ADMINImmuta permissionThe 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 DATABASEfor the database you configure the integration with, as you must manage grants on that database.CREATE USERGRANT TEMP ON DATABASE
If creating a new database
CREATE DATABASECREATE USERGRANT TEMP ON DATABASEREVOKE 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
databasein 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 DATABASEfor the database you configure the integration with, as you must manage grants on that database.CREATE USERGRANT 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
databasein 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 DATABASECREATE USERGRANT TEMP ON DATABASEREVOKE ALL PRIVILEGES ON DATABASE
Generate the script
Copy the request example. The example provided uses JSON format, but the request also accepts YAML.
Replace the Immuta URL and API key with your own.
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.
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
Copy the request example. The example provided uses JSON format, but the request also accepts YAML.
Replace the Immuta URL and API key with your own.
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.
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 an integration
Copy the request example.
Replace the Immuta URL and API key with your own.
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 /integrationsendpoint.
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
Copy the request example.
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
Copy the request example. The example provided uses JSON format, but the request also accepts YAML.
Replace the Immuta URL and API key with your own.
Replace the {id} request parameter with the unique identifier of the integration you want to update.
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.
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
Copy the request example. The example provided uses JSON format, but the request also accepts YAML.
Replace the Immuta URL and API key with your own.
Replace the {id} request parameter with the unique identifier of the integration you want to update.
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.
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.
Delete an integration
Copy the request example.
Replace the Immuta URL and API key with your own.
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?

