View a markdown version of this page

Authorizing connections from Amazon Quick Sight to Amazon Redshift clusters - Amazon Quick
Services or capabilities described in Amazon Web Services documentation might vary by Region. To see the differences applicable to the China Regions, see Getting Started with Amazon Web Services in China (PDF).

Authorizing connections from Amazon Quick Sight to Amazon Redshift clusters

   Applies to: Enterprise Edition and Standard Edition 
   Intended audience: System administrators 

You can provide access to Amazon Redshift data using three authentication methods: trusted identity propagation, run-as IAM role, or Amazon Redshift database credentials. You can also connect to Amazon Redshift Serverless with express configuration, a service-managed Serverless endpoint that uses the IAM role for your Quick account. For more information, see Connecting to Amazon Redshift Serverless with express configuration.

With trusted identity propagation, a user's identity is passed to Amazon Redshift with single sign-on that is managed by IAM Identity Center. A user that accesses a dashboard in Amazon Quick Sight has their identity propagated to Amazon Redshift. In Amazon Redshift, fine grained data permissions are applied on the data before the data is presented in a Amazon Quick asset to the user. Amazon Quick authors can also connect to Amazon Redshift data sources without a password input or IAM role. If Amazon Redshift Spectrum is used, all permission management is centralized in Amazon Redshift. Trusted identity propagation is supported when Amazon Quick and Amazon Redshift use the same organization instance of IAM Identity Center. Trusted identity propagation is not currently supported for the following features.

  • SPICE datasets

  • Custom SQL on data sources

  • Alerts

  • Email reports

  • Amazon Quick Q

  • CSV, Excel, and PDF exports

  • Anomaly detection

For Amazon Quick to connect to an Amazon Redshift instance, you must create a new security group for that instance. This security group contains an inbound rule that authorizes access from the appropriate IP address range for the Amazon Quick servers in that Amazon Web Services Region. To learn more about authorizing Amazon Quick connections, see Manually enabling access to an Amazon Redshift cluster in a VPC.

Enabling connection from Amazon Quick servers to your cluster is just one of several prerequisites for creating a data set based on an Amazon database data source. For more information about what is required, see Creating a dataset from a database.

Enabling trusted identity propagation with Amazon Redshift

Trusted identity propagation authenticates the end user in Amazon Redshift when they access Amazon Quick assets that leverage a trusted identity propagation enabled data source. When an author creates a data source with trusted identity propagation, the identity of the data source consumers in Amazon Quick Sight is propagated and logged in CloudTrail. This allows database administrators to centrally manage data security in Amazon Redshift and automatically apply all data security rules to data consumers in Amazon Quick. With other authentication methods, the data permissions of the author who created the data source are applied to all data source consumers. The data source author can choose to apply additional row and column level security to the data sources that they create in Amazon Quick Sight.

Trusted identity propagation data sources are supported only in Direct Query datasets. SPICE datasets do not currently support trusted identity propagation.

Prerequisites

Before you get started, make sure that you have all of the required prerequisites ready.

  • Trusted identity propagation is only supported for Amazon Quick accounts that are integrated with IAM Identity Center. For more information, see Configure your Amazon Quick account with IAM Identity Center.

  • An Amazon Redshift application that is integrated with IAM Identity Center. The Amazon Redshift cluster that you use must be in the same organization in Amazon Organizations as the Amazon Quick account that you want to use. The cluster must also be configured with the same organization instance in IAM Identity Center that your Amazon Quick account is configured to. For more information about configuring a Amazon Redshift cluster, see Integrating IAM Identity Center.

Enabling trusted identity propagation in Amazon Quick Sight

To configure Amazon Quick Sight to connect to Amazon Redshift data sources with trusted identity propagation, configure Amazon Redshift OAuth scopes to your Amazon Quick account.

To add a scope that allows Amazon Quick to authorize identity propagation to Amazon Redshift, specify the Amazon Web Services account ID of the Amazon Quick account and the service that you want to authorize identity propagation with, in this case 'REDSHIFT'.

Specify the IAM Identity Center application ARN of the Amazon Redshift cluster that you are authorizing Amazon Quick to propagate user identities to. This information can be found in the Amazon Redshift console. If you don't specify authorized targets for the Amazon Redshift scope, Amazon Quick authorizes users from any Amazon Redshift cluster that share the same IAM Identity Center instance. The example below configures Amazon Quick to connect to Amazon Redshift data sources with trusted identity propagation.

aws quicksight update-identity-propagation-config --aws-account-id "AWSACCOUNTID" --service "REDSHIFT" --authorized-targets "arn:aws-cn:sso::XXXXXXXXXXXX:application/ssoins-XXXXXXXXXXXX/apl-XXXXXXXXXXXX" "arn:aws-cn:sso::XXXXXXXXXXXX:application/ssoins-XXXXXXXXXXXX/apl-XXXXXXXXXXXX"

The following example deletes OAuth scopes from a Amazon Quick account.

aws quicksight delete-identity-propagation-config --aws-account-id "AWSACCOUNTID" --service "REDSHIFT" --authorized-targets "arn:aws-cn:sso::XXXXXXXXXXXX:application/ssoins-XXXXXXXXXXXXapl-XXXXXXXXXXXX "arn:aws-cn:sso::XXXXXXXXXXXX:application/ssoins-XXXXXXXXXXXX/apl-XXXXXXXXXXXX"

The following example lists all OAuth scopes that are currently on a Amazon Quick account.

aws quicksight list-identity-propagation-configs --aws-account-id "AWSACCOUNTID"

Connecting to Amazon Redshift with trusted identity propagation

Use the procedure below to connect to Amazon Redshift trusted identity propagation.

To connect to Amazon Redshift with trusted identity propagation
  1. Create a new dataset in Amazon Quick. For more information about creating a dataset, see Creating datasets.

  2. Choose Amazon Redshift as the data source for the new dataset.

    Note

    The authentication type of an existing data source can't be changed to trusted identity propagation

  3. Choose IAM Identity Center as the identity option for the data source, and then choose Create data source.

Connecting to Amazon Redshift Serverless with express configuration

Amazon Redshift Serverless with express configuration makes Amazon Redshift available to run SQL on your data within seconds, with no compute or networking setup. It uses a service-managed regional endpoint and the same query engine and SQL dialect as Amazon Redshift provisioned clusters and Amazon Redshift Serverless workgroups.

To connect Quick, you create an Amazon Redshift data source, and then you use that data source to create datasets for analyses and dashboards.

Important

Amazon Redshift Serverless with express configuration has its own service-managed regional endpoint, named express-default, separate from your provisioned clusters and Amazon Redshift Serverless workgroups.

The endpoint queries data that is registered in the Amazon Glue Data Catalog in place. This data includes Amazon S3 and Amazon S3 Tables data, and Amazon Redshift Managed Storage catalog objects that are registered through Amazon Redshift federated permissions.

Before you connect

Before an author creates the data source, complete the following prerequisites:

  • An Amazon Redshift administrator activates Amazon Redshift Serverless with express configuration once in each Amazon Web Services Region that you query. To activate, open the express configuration in the Amazon Redshift console, or call the GetExpressConfiguration API operation. The administrator needs the redshift-serverless:GetExpressConfiguration permission, and might also need iam:CreateServiceLinkedRole. For more information, see Activating Amazon Redshift Serverless with express configuration. For a cross-Region connection, the target Amazon Web Services Region must also be activated.

  • A Quick administrator must authorize access to the express configuration. For more information, see the administrator options in the following section.

  • Confirm that the IAM role for your Quick account has the permissions required for the Amazon Redshift connection and for the data that you intend to query.

  • Register the data that you want to query in the Amazon Glue Data Catalog, and configure the appropriate IAM access. For external catalogs, also configure the required Amazon Lake Formation grants.

  • Choose an Amazon Web Services Region where Amazon Redshift Serverless with express configuration is available.

Note

This integration uses the account-level IAM role for your Quick account. It does not support a per-data-source run-as role override, and it is not the Amazon Redshift default IAM role. If you manage your own account-level IAM role, you attach the connection and data-access permissions to it (see Option 2). For more information about the IAM role for your Quick account, see Accessing Amazon resources.

Enabling access as a Quick administrator

As a Quick administrator, use one of the following two options to enable access to the express configuration.

Option 1, Resource Permissions page

Sign in as a Quick administrator, open the Resource Permissions page, and select Redshift Serverless. After access is enabled, an author can create the data source.

Option 2, IAM role policy

If you manage your own IAM role for your Quick account, attach the following policy to it.

{ "Version": "2012-10-17", "Statement": [ { "Action": [ "redshift-serverless:GetCredentials", "redshift-serverless:DbConnect" ], "Effect": "Allow", "Resource": "arn:aws-cn:redshift-serverless:*:123456789012:workgroup/express/*" } ] }

Replace 123456789012 with your Amazon account ID. This policy grants only the connection permissions. Data permissions are separate. For more information, see Accessing external catalogs and creating a dataset.

Creating the data source as an author

After a Quick administrator enables access to the express configuration, use the following procedure to create the data source over a public network.

To create the data source
  1. In the New Amazon Redshift data source dialog box, enter a Data source name.

  2. For a public-network connection, set Connection type to Public network.

  3. Select Connect to Serverless with Express configuration.

  4. For Database server, enter the regional endpoint for the target Amazon Web Services Region. The target Amazon Web Services Region can differ from your Quick Amazon Web Services Region. Use the following endpoint format.

    express-default.express.region.redshift-serverless.amazonaws.com

    Replace region with the Amazon Web Services Region of the regional endpoint. For a cross-Region connection, set Database server to the endpoint of the target Amazon Web Services Region.

  5. For Database name, enter dev. With dev, all registered data is reachable through three-part names, such as "awsdatacatalog"."database"."table".

  6. Validate the connection. After validation succeeds, choose Create data source.

Note

Connection validation uses the configured credentials to establish a database connection.

If you use a private connectivity path from Quick, follow the applicable Quick VPC and DNS configuration instructions. For more information, see Connecting to a Amazon VPC with Amazon Quick. For information about using Amazon PrivateLink with the regional endpoint, see Connecting to Amazon Redshift Serverless with express configuration through Amazon PrivateLink. The service-managed networking of Amazon Redshift does not remove any Quick-side requirements for the connectivity path that you select.

Accessing external catalogs and creating a dataset

A connection to the default dev database and authorization to external data are separate steps. A successful connection to dev does not by itself grant access to external catalogs or tables. For external-catalog access, configure the permissions on the IAM role for your Quick account for the applicable catalog and data type.

The following table lists the permissions that the IAM role for your Quick account needs for each data type.

Data Permissions the role needs
Amazon S3 data in an Amazon Glue Data Catalog database glue:GetDatabases, glue:GetTables, glue:GetTable, plus s3:GetObject and s3:ListBucket. If the Amazon S3 location is registered with Amazon Lake Formation, lakeformation:GetDataAccess replaces the Amazon S3 permissions.
Amazon S3 Tables glue:GetDatabases, glue:GetTables, glue:GetTable, plus lakeformation:GetDataAccess.
Amazon Redshift Managed Storage registered through Amazon Redshift federated permissions glue:GetDatabases, glue:GetTables, glue:GetTable, plus grants on the producer cluster or Amazon Redshift Serverless workgroup to the mapped database user. No Amazon S3 or Amazon Lake Formation permissions are required.

If a catalog uses Amazon Lake Formation permissions instead of IAM access control, the role also needs Amazon Lake Formation DESCRIBE and SELECT on the databases and tables.

For Amazon Redshift Managed Storage, the IAM role maps to the database user IAMR:role-name, where role-name is the name of the IAM role for your Quick account. The producer administrator grants to that user. For example, GRANT SELECT ON public.orders TO "IAMR:role-name";

After the connection is available, create a Quick dataset that uses the data source and the authorized data. You can use the dataset in your analyses, dashboards, and supported Quick dataset Q&A experiences. For Quick chat, expose the data through a dataset.

When you create the dataset, choose Direct Query or SPICE mode based on your use case.

Troubleshooting external-catalog access

If the connection to dev succeeds but you cannot access an external catalog or table, review the requirements in Accessing external catalogs and creating a dataset. Verify the catalog registration, the permissions on the IAM role for your Quick account, and any Amazon Lake Formation grants.

Manually enabling access to an Amazon Redshift cluster in a VPC

 Applies to: Enterprise Edition 

Use the following procedure to enable Amazon Quick Sight access to an Amazon Redshift cluster in a VPC.

To enable Amazon Quick Sight access to an Amazon Redshift cluster in a VPC
  1. Sign in to the Amazon Web Services Management Console and open the Amazon Redshift console at https://console.amazonaws.cn/redshiftv2/.

  2. Navigate to the cluster that you want to make available in Amazon Quick.

  3. In the Cluster Properties section, find Port. Note the Port value.

  4. In the Cluster Properties section, find VPC ID and note the VPC ID value. Choose VPC ID to open the Amazon VPC console.

  5. On the Amazon VPC console, choose Security Groups in the navigation pane.

  6. Choose Create Security Group.

  7. On the Create Security Group page, enter the security group information as follows:

    • For Security group name, enter redshift-security-group.

    • For Description, enter redshift-security-group.

    • For VPC, choose the VPC for your Amazon Redshift cluster. This is the VPC with the VPC ID that you noted.

  8. Choose Create security group.

    Your new security group should appear on the screen.

  9. Create a second security group with the following properties.

    • For Security group name, enter quicksight-security-group.

    • For Description, enter quicksight-security-group.

    • For VPC, choose the VPC for your Amazon Redshift cluster. This is the VPC with the VPC ID that you noted.

  10. Choose Create security group.

  11. After you create the new security groups, create inbound rules for the new groups.

    Choose the new redshift-security-group security group, and input the following values.

    • For Type, choose Amazon Redshift.

    • For Protocol, choose TCP.

    • For Port Range, enter the port number of the Amazon Redshift cluster to which you are providing access. This is the port number that you noted in an earlier step.

    • For Source, enter the security group ID of quicksight-security-group.

  12. Choose Save rules to save your new inbound rule.

  13. Repeat the previous step for quicksight-security-group and enter the following values.

    • For Type, choose All traffic.

    • For Protocol, choose All.

    • For Port Range, choose All.

    • For Source, enter the security group ID of redshift-security-group.

  14. Choose Save rules to save your new inbound rule.

  15. In Amazon Quick, navigate to the Manage Amazon Quick menu.

  16. Choose Manage VPC connections, and then choose Add VPC connection.

  17. Configure the new VPC connection with the following values.

    • For VPC connection name, choose a meaningful name for the VPC connection.

    • For VPC ID, choose the VPC in which the Amazon Redshift cluster exists.

    • For Subnet ID, choose the subnet for the Availability Zone (AZ) that is used for Amazon Redshift.

    • For Security group id, copy and paste the security group ID for quicksight-security-group.

  18. Choose Create. It might take several minutes for the new VPC to generate.

  19. In the Amazon Redshift console, navigate to the Amazon Redshift cluster that redshift-security-group is configured to. Choose Properties. underNetwork and security settings, enter the name of the security group.

  20. In Amazon Quick, choose Datasets, and then choose New dataset. Create a new dataset with the following values.

    • For Data source, choose Amazon Redshift Auto-discovered.

    • Give the data source a meaningful name.

    • The instance ID should auto populate with the VPC connection that you created in Amazon Quick. If the instance ID doesn't auto populate, choose the VPC that you created from the dropdown list.

    • Enter the database credentials. If your Amazon Quick account uses trusted identity propagation, choose Single sign-on.

  21. Validate the connection, and then choose Create data source.

If you want to restrict the default outbound rules further, update the outbound rule of quicksight-security-group to allow only Amazon Redshift traffic to redshift-security-group. You can also delete the outbound rule that's located in the redshift-security-group.

Enabling access to Amazon Redshift Spectrum

Using Amazon Redshift Spectrum, you can connect Amazon Quick to an external catalog with Amazon Redshift. For example, you can access the Amazon Athena catalog . You can then query unstructured data on your Amazon S3 data lake using an Amazon Redshift cluster instead of the Athena query engine.

You can also combine data sets that include data stored in Amazon Redshift and in S3. Then you can access them using the SQL syntax in Amazon Redshift.

After you've registered your data catalog (for Athena) or external schema (for a Hive metastore), you can use Amazon Quick to choose the external schema and Amazon Redshift Spectrum tables. This process works just as for any other Amazon Redshift tables in your cluster. You don't need to load or transform your data.

For more information on using Amazon Redshift Spectrum, see Using Amazon Redshift Spectrum to query external data in the Amazon Redshift Database Developer Guide.

To connect using Redshift Spectrum, do the following:

  • Create or identify an IAM role associated with the Amazon Redshift cluster.

  • Add the IAM policies AmazonS3ReadOnlyAccess and AmazonAthenaFullAccess to the IAM role.

  • Register an external schema or data catalog for the tables that you plan to use.

Redshift Spectrum lets you separate storage from compute, so you can scale them separately. You only pay for the queries that you run.

To connect to Redshift Spectrum tables, you don't need to grant Amazon Quick access to Amazon S3 or Athena. Amazon Quick needs access only to the Amazon Redshift cluster. For full details on configuring Redshift Spectrum, see Getting started with Amazon Redshift Spectrum in the Amazon Redshift Database Developer Guide.