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

Hi @shravya ,
client is not ready to built trust relationship to use template ARN in target account. Is there any other way to achieve this?
Waiting for your suggestions - @Sanjeeb2022

Thank you!

Hi @VaishnaviM ,

You can redo the same export-import steps using Asset bundle APIs. If you keep the ids same, it will get overwritten.

Just one catch when you do this import with changes, you will need to run one more set of command to publish the latest version of dashboard in the target account. Adding more details below:

step 1: export asset bundle of modified dashboard with all dependencies
step 2: import asset bundle of newly downloaded bundle zip, keeping all configuration same as the first import
step 3: fetch the dashboard version using list-dashboard-versions to verify the dashboard version in target account
step 4: run UpdateDashboardPublishedVersion to publish the overwritten version.

Until step 4 is done, the changes in dashboard will not reflect

Thanks,
Prantika

1 Like

Hi @VaishnaviM,
It’s been awhile since we last heard from you, did you have any additional questions regarding your initial post?
If we do not hear back within the next 3 business days, I’ll go ahead and close out this topic?

Thank you!

Hi @VaishnaviM,
Since we haven’t heard back, I’ll close out this topic. However, if you have any additional questions, feel free to create a new post in the community and link this discussion for relevant information if needed.

Thank you!