Creating datashares and adding objects (preview)
Creating datashares
This is prerelease documentation for the multi-data warehouse writes through data sharing feature for
Amazon Redshift, which is available in public preview in the PREVIEW_2023 track. The documentation and the feature are both subject to change. We recommend that you use this feature
only with test clusters, and not in production environments.
For preview terms and conditions, see Beta Service Participation in AWS Service Terms |
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.
For more information about getting started with data sharing, go to Sharing write access to data (Preview).
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 (preview) 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.
-
From here, you can add database objects of various types. Select the Add button to add objects. A dialog appears. Perform the following steps:
Choose a schema, or more than one schema. Doing this makes objects from the schemas available to add.
Select Objects types from the schemas.
From here you can choose a couple options to Add objects:
Add specific objects from schemas – If you choose this, it lists individual objects by name. You can select objects and add them to the datashare. For example, you can add specific Tables and Stored procedures, if you like. Then the tables and stored procedures from the schema you selected are included in the datashare. Setting permissions is explained further in subsequent steps. Continue with Views and other types, selecting objects to add.
Add all existing objects from the selected object types to the schema – This adds all of the objects.
You can also choose whether you want to Add future objects. When you choose to include datashare objects added to the schema, it means that objects added to the schema are added to the datashare automatically.
Choose Add to complete the section and add the objects. They're listed under the Datashare objects.
After you add objects, you can select individual objects and edit their permissions. If you select a schema, a dialog appears that asks if you would like to add Scoped permissions. This makes it so each existing or added object to the schema has a pre-selected set of permissions, appropriate for the object type. For instance, the administrator can set that all added tables have SELECT and UPDATE permissions, for instance.
After you configure schema permissions you can walk through additional object types and select their permissions. For instance, you can add UPDATE permissions to a specific table.
In the Data consumers section, you can add namespaces or add AWS accounts as consumers of the datashare.
Choose Create datashare to save your changes.
After you create the datashare, it appears in the list under Datashares created in my namespace. If you choose a datashare from the list, you can view its consumers, its objects, and other properties.
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.