Reputation: 2615
We have a lot of AWS quicksight reports in one account, which needs to be migrated to another account.
Within the same account, we can use the 'save-as' feature of the dashboard to create a copy of the report, but is there any way to export the analysis from one account and import into another account?
At present, it appears only we way is to recreate all the reports again from scratch in the new account, but anyone has any other options?
Upvotes: 14
Views: 14266
Reputation: 21
1.Create template in account1 from Analysis
--template.json:
{
"SourceAnalysis": {
"Arn": "arn:aws:quicksight:<AccountID-1>:analysis/<Analysis ID>",
"DataSetReferences": [
{
"DataSetPlaceholder": "DS1",
"DataSetArn": "arn:aws:quicksight:AccountID-1:dataset/<DatasetID>"
}
]
}
}
aws quicksight create-template --aws-account-id AccountID-1 --template-id <templateId> --source-entity file://template.json --profile default
2.Update Template Permissions in Account1->root(Account2):
--TemplatePermission.json
[{
"Principal": "arn:aws:iam::AccountID-2:root",
"Actions": ["quicksight:UpdateTemplatePermissions", "quicksight:DescribeTemplate"]
}]
aws quicksight update-template-permissions --aws-account-id AccountID-1 --template-id <templateId> --grant-permissions file://TemplatePermission.json --profile default
3.Create Analysis in Account2 using Account1 Template
createAnalysis.json
{
"SourceTemplate": {
"DataSetReferences": [
{
"DataSetPlaceholder": "DS1",
"DataSetArn": "arn:aws:quicksight:us-east-1:AccountID-2:dataset/<DatasetID in account 2>"
}
],
"Arn": "arn:aws:quicksight:us-east-1:AccountID-1:template/testTemplate"
}
}
aws quicksight create-analysis --aws-account-id AccountID-2 --analysis-id testanalysis --name test1 --source-entity file://createAnalysis.json
4.Update Permissions to view analysis for your user
UpdateAnalysisPermission.json
[
{
"Principal": "arn:aws:quicksight:us-east-1:AccountID-2:user/default/<username>",
"Actions": [
"quicksight:RestoreAnalysis",
"quicksight:UpdateAnalysisPermissions",
"quicksight:DeleteAnalysis",
"quicksight:DescribeAnalysisPermissions",
"quicksight:QueryAnalysis",
"quicksight:DescribeAnalysis",
"quicksight:UpdateAnalysis"
]
}
]
aws quicksight update-analysis-permissions --aws-account-id AccountID-2 --analysis-id testanalysis --grant-permissions file://UpdateAnalysisPermission.json
Upvotes: 0
Reputation: 338
In my organization, we are using the QuickSight APIs in AWS Lambda Functions and save the Analysis template in JSON format in an S3 bucket. This S3 bucket has access to multiple environments like Dev, QA, Staging, and Production. Leveraging the API again, we create analysis in other environments by using the template JSON file. We also store version information of the templates in a PostgreSQL database.
PS - The dataset in each environment needs to be created prior to migrating the analysis.
Upvotes: 3
Reputation: 1469
You can do this programmatically through the API:
However, it will take a bit of scripting. You will need to pull out the pieces with the API, and then rebuild on a new account.
For example, DescribeTemplate
will pull the JSON defining a template. Then you can use CreateTemplate
to create on another account.
Upvotes: 8