2
votes

We have multiple data sources with the exact same data model (one instance for each customer). We are using AWS Quicksight to create dashboards to view the data. We want to be able to clone or copy one dashboard created on one data source to a new data source using the SDK or AWS CLI. I can see here that I can use describe-dashboard or describe-data-set to get the details. I also know creating data-sources and dashboards are possible but I don't see a way to configure it using details we got from the describe methods mentioned above. How can we create "copies" of quicksight dashboards? They are all in the same account and region.

1

1 Answers

0
votes

The basic way is to "Save As" in the Dashboard and save as a Analysis. Then change the Datasets in the "new" Analysis and save it again as a Dashboard. You can then repeat the process for each and every Dashboard you wish to create.

For a programmatic way try out the following:

aws quicksight create-dashboard --aws-account-id <Account ID> --dashboard-id <any ID> --name <any dashboard name> --source-entity file://createDashboard.json --region <region>

where the JSON is:

{
  "SourceTemplate": {
    "DataSetReferences": [
      {
    "DataSetPlaceholder": "placeholder", // Place holder you provided when creating the template.
    "DataSetArn": "arn:aws:quicksight:us-east-2:<Account ID>:dataset/<Dataset ID>" // ARN of the data set
      }
    ],
    "Arn": "arn:aws:quicksight: ap-southeast-2:<Account A ID>:template/<Template ID>"
  }
}    

update the permission of the dashboard using, once it is created:

aws quicksight update-dashboard-permissions --aws-account-id <Account ID> --dashboard-id <new Dashboard ID> --grant-permissions file://permission.json

where permission.json is similar to below (to grant co-owner access to the dashboard):

[
  {
    "Principal": "arn:aws:quicksight:<region>:<Account ID>:user/default/<Quicksight user name>", // QuickSight user ARN who needs access to the dashboard
    "Actions": ["quicksight:DescribeDashboard","quicksight:ListDashboardVersions","quicksight:UpdateDashboardPermissions","quicksight:QueryDashboard","quicksight:UpdateDashboard","quicksight:DeleteDashboard","quicksight:DescribeDashboardPermissions","quicksight:UpdateDashboardPublishedVersion"]
  }
]   

then create an Analysis from this dashboard, share it with other users via the QuickSight console.