Creating datashares
With Amazon Redshift, you can share live data across Amazon Redshift clusters or AWS accounts using datashares. A datashare is a consumer-producer object that allows you to share live data from your Amazon Redshift cluster with other clusters or AWS accounts. Creating datashares enables secure data sharing while maintaining control over access and ensuring data remains up-to-date. The following sections provide details on creating datashares and adding database objects such as schemas, tables, and views to share live data securely.
Creating datashares
As a producer cluster administrator, you can create datashares from the Databases or Datashares tabs in the cluster details page.
Sign in to the AWS Management Console and open the Amazon Redshift console at https://console.aws.amazon.com/redshiftv2/
. -
On the navigation menu, choose Clusters, then choose your cluster. The cluster details page appears.
-
In the cluster details page, do one of the following:
-
From the Databases tab, in the Database section, choose a database. The database details page appears.
Choose Create datashare. You can only create a datashare from a local database. If you haven't connected to the database, the Connect to database page appears. Follow the steps in Connecting to a database to connect to a database. If there is a recent connection, the Create datashare page appears.
-
From the Datashares tab, in the Datashares section, connect to a database if you don't have a database connection.
In the Datashares created in my cluster section, choose Create datashare. The Create datashare page appears.
-
-
In the Datashare information section, choose one of the following:
-
Choose Datashare to create datashares to share data for read purpose across different Amazon Redshift clusters or in the same AWS account or different AWS accounts.
-
Choose AWS Data Exchange datashare to create datashares to license your data through AWS Data Exchange.
-
-
Specify values for Datashare name, Database name, and Publicly accessible.
When you change the database name, make a new database connection.
-
In the Datashare objects section, choose Add. The add datashare page appears. To add objects to a datashare, follow Adding datashare objects to datashares.
-
In the Data consumers section, you can choose to publish to a Redshift account, or publish to the AWS Glue Data Catalog, which starts the process of sharing data via Lake Formation. Publishing your datashare to Redshift accounts means sharing your data with another Redshift account that acts as the consumer cluster.
Note
Once the datashare is created, you can't edit the configuration to publish to the other option.
-
Choose Create datashare.
Amazon Redshift creates the datashare. After the datashare is created, you can create databases from the datashare.
Adding datashare objects to datashares
Add one or more objects to the datashare. Datashare objects are read-only for data consumers.
You can create a datashare without adding datashare objects and add objects later.
A datashare becomes active only when you add at least one object to the datashare.
Choose the datashare you want to add objects to from the datashare list.
Choose Add. The add datashare objects page appears.
-
Add at least one schema to the datashare before adding other datashare objects. Add multiple schemas by choosing Add and repeat.
You can choose to add all existing objects of chosen object types from the specified schema or add specific individual objects from the specified schema. Choose the Object types, such as tables and views or user-defined functions.
You can choose Add and repeat to add the specified schemas and datashare objects and continue to add another and objects.
Adding data consumers to datashares
You can add one or more data consumers to the datashares. Data consumers can be cluster namespaces that uniquely identified Amazon Redshift clusters or AWS accounts.
You must explicitly choose to turn off or turn on sharing your datashare to clusters with public access.
-
Choose Add cluster namespaces to the datashare. Namespaces are globally unique identifier (GUID) for Amazon Redshift cluster.
-
Choose Add AWS accounts to the datashare. The specified AWS accounts must have access permissions to the datashare.