How to Push changes made in source account analysis to imported analysis

Hi,
I have imported analysis and dashboard from one aws account to another using Assets bundle apis.
Now i have done some changes in source account analysis like added some graphs, filters and actions,etc. how can these all changes would reflect in target account analysis without creating new one.
I got some suggestion of template updates, but I am still confuse about the process. Please share any solution or document of it. any suggestion would be appreciated.

Thanks,

1 Like

Hi @VaishnaviM,

To update analysis in target account without creating new one - You can try the following steps and let me know if you face any challenges.

Step 1: Export the Template from the Source Account
You need to create a template from your updated analysis. Use the following AWS CLI command:

aws quicksight create-template \
  --aws-account-id <Source-Account-ID> \
  --template-id <Template-ID> \
  --source-entity "{\"SourceAnalysis\":{\"Arn\":\"arn:aws:quicksight:<region>:<Source-Account-ID>:analysis/<Analysis-ID>\",\"DataSetReferences\":[{\"DataSetArn\":\"arn:aws:quicksight:<region>:<Source-Account-ID>:dataset/<Dataset-ID>\",\"DataSetPlaceholder\":\"<Placeholder>\"}]}}"

Replace <Source-Account-ID>, <Analysis-ID>, <Dataset-ID>, <Placeholder>, and <Template-ID> with your values. This will create a template based on the analysis from the source account.

Step 2: Share the Template with the Target Account
In order for the target account to access and use the template, you need to grant permissions to the target account.

Use the following command to update template permissions so that the target AWS account can access it:

aws quicksight update-template-permissions \
  --aws-account-id <Source-Account-ID> \
  --template-id <Template-ID> \
  --grant-permissions "Principal=arn:aws:iam::<Target-Account-ID>:root,Actions=quicksight:DescribeTemplate"

Step 3: Update the Analysis in the Target Account Using the Template

Now, in the target AWS account, you will use the shared template to update the existing analysis without creating a new one.

Log in to the target account and use the following command to update the analysis using the template from the source account:

aws quicksight update-analysis \
  --aws-account-id <Target-Account-ID> \
  --analysis-id <Analysis-ID> \
  --source-entity "{\"SourceTemplate\":{\"Arn\":\"arn:aws:quicksight:<region>:<Source-Account-ID>:template/<Template-ID>\"}}"

References:

  1. AWS CLI QuickSight Documentation
  2. AWS CLI Create Template
  3. AWS CLI Update Template
  4. AWS QuickSight Template Permissions

I hope that helps.

Thank you,
Shravya

Hi @shravya , Thank you for the response.
I am trying to update analysis using exported json file of template.

I am using below command for this:
aws quicksight update-analysis
–aws-account-id ACCOUNTID
–analysis-id ANALYSISID
–name “Test_Dashbaord”
–cli-input-json file://template.json

but I am getting errors as,

Parameter validation failed:
Unknown parameter in input: “CreatedTime”, must be one of: AwsAccountId, AnalysisId, Name, Parameters, SourceEntity, ThemeArn, Definition, ValidationStrategy
Unknown parameter in input: “VersionNumber”, must be one of: AwsAccountId, AnalysisId, Name, Parameters, SourceEntity, ThemeArn, Definition, ValidationStrategy
Unknown parameter in input: “Status”, must be one of: AwsAccountId, AnalysisId, Name, Parameters, SourceEntity, ThemeArn, Definition, ValidationStrategy
Unknown parameter in input: “DataSetConfigurations”, must be one of: AwsAccountId, AnalysisId, Name, Parameters, SourceEntity, ThemeArn, Definition, ValidationStrategy
Unknown parameter in input: “SourceEntityArn”, must be one of: AwsAccountId, AnalysisId, Name, Parameters, SourceEntity, ThemeArn, Definition, ValidationStrategy
Unknown parameter in input: “Sheets”, must be one of: AwsAccountId, AnalysisId, Name, Parameters, SourceEntity, ThemeArn, Definition, ValidationStrategy

It would be helpful if you provide any info regarding this, or update analysis using json file of templates.

Thank you!

Hi @VaishnaviM

By looking at the errors I would say, please re-verify your json file and make sure that it follows correct structure.

I hope these blogs help -

  1. API - describe_template/dashboard/analysis - duplicate FilterGroup IDs - #19 by Adrian_Vacaru
  2. New Amazon QuickSight API Capabilities to Accelerate Your BI Transformation | AWS News Blog
  3. Migrate Amazon QuickSight across AWS accounts | AWS Big Data Blog

Thank you,
Shravya

1 Like

Hi, @shravya

The json generated by describe-template is just a metadata of template. It doesn’t include whole schema or graph structure, right. so If I used this json by doing some changes still i feel it would not be used to reflect updated changes in analysis. So i think this approach would not be helpful and i have to achieve this by using Template ARN only.
Correct me if I am wrong.
Thank you.

Sorry for the late response @VaishnaviM - Yes, that is true. Template ARN should work as expected. The above mentioned blogs has step-by-step process for your reference.

Tagging an expert to give you more suggestions or ideas on this - @Sanjeeb2022

Thank you,
Shravya

1 Like