I have two aws accounts with an AWS QuickSight dashboard in my source environment and am trying to copy that dashboard to my target environment on the other account. I have identical Athena databases/tables in both environments with the exception of the schema name. I can’t figure out how to issue or format the --override-parameters
argument in the CLI to supply the appropriate schema name (or otherwise), so when I execute the start-asset-bundle-import-job
. However, if I run start-asset-bundle-export-job
on my source environment and download the output .qs bundle, and edit the schema name in the datasets .json file, and then simply run start-asset-bundle-import-job
, everything works. If I attempt to update the dataset via the CLI using the --physical-table-map
, the dashboards are unable to connect to the data. I’ve also tried running the --override-parameters
option with no luck. Does anyone know how to issue change the schema of the Athena database upon import with the API?
For reference here is some toy code that explains what I have tried:
Export the bundle from the source environment, called “dev”:
aws quicksight start-asset-bundle-export-job --profile dev --aws-account-id XXXXXXXXXXXX --asset-bundle-export-job-id="migration_6_export" --resource-arns='arn:aws:quicksight:us-east-1:XXXXXXXXXXXX:dashboard/redacted-redacted-redacted-9817-redacted' --include-all-dependencies --export-format "QUICKSIGHT_JSON"
Then after running describe-asset-bundle-export-job I obtain the migration_6_export.js file and upload it to an s3 bucket my target environment “val”. Next, I imported the bundle successfully:
aws quicksight start-asset-bundle-import-job --profile dev --aws-account-id YYYYYYYYYYYY --asset-bundle-import-job-id="migration_6_export" --asset-bundle-import-source S3Uri="s3://val-quicksight-migration-files/migration_6_export.qs"
I can now see the dashboard in my target environment. I figured this would require a simple updating of the dataset schema using the following code, since the Athena database schema “my-new-schema-database-in-athena-db” already exists in my target enviroment, but this does not work:
aws quicksight update-data-set --profile ocse-val-dev --aws-account-id YYYYYYYYYYYY --data-set-id 'redacted-c5ec-redacted-redacted-redacted' --name "migration_dummy_table" --import-mode "SPICE" --physical-table-map='{"redacted-513e-redacted-redacted-redacted": {
"RelationalTable": {
"DataSourceArn": "arn:aws:quicksight:us-east-1:YYYYYYYYYYYY :datasource/redacted-e621-redactedredacted-redacted",
"Catalog": "AwsDataCatalog",
"Schema": "my-new-schema-database-in-athena-db",
"Name": "migration_dummy_table",
"InputColumns": [
{
"Name": "id",
"Type": "INTEGER"
},
{
"Name": "total_cases",
"Type": "DECIMAL",
"SubType": "FLOAT"
}
]
}
}
}'
If I now review the dashboard, the visuals are not displayed. Instead I get an error on each visual that reads, “Fields for this Visual no longer in Analysis.”
Can anyone help or provide some suggestions? I’d really appreciate some sample api commands if anyone can assist. For reference, I’ve been following the recording here:
https://www.youtube.com/watch?v=VhAumX35-X0 as well as the blog blost here on this topic:
https://aws.amazon.com/blogs/business-intelligence/automate-and-accelerate-your-amazon-quicksight-asset-deployments-using-the-new-apis/