aws-sdkaws-sdk-java-2.0amazon-quicksightquicksight-embedding

QuickSight not showing DataSource created with API


I've recently started looking into creating dashboards and analysis with the Quicksight API. I tried creating a datasource using the AWS SDK, the response was successful and I was also able to double-check this by calling a describe on the datasourceId. However, when I logged in to quicksight GUI it doesn't show in the list of datasources, can someone explain why this is happening.


Solution

  • I think that's a permission issue.

    This was resolved if I add permissions when creating data sets and data sources.

    const input: CreateDataSourceCommandInput = {
        ...
        Permissions: [
          {
            Actions: [
              'quicksight:DescribeDataSource',
              'quicksight:DescribeDataSourcePermissions',
              'quicksight:PassDataSource',
            ],
            Principal: 'USER_ARN',
          },
        ],
        ...
      }
    

    To retrieve USER_ARN, refer to this guide: https://docs.aws.amazon.com/solutions/latest/discovering-hot-topics-using-machine-learning/quicksight-principal-arn.html

    API document: https://docs.aws.amazon.com/quicksight/latest/APIReference/API_CreateDataSource.html#QS-CreateDataSource-request-Permissions