How to create Quicksight Analysis & Template in CDK

0

I would like to create new Quicksight Analysis & Template in CDK (python): I'm trying to do it with CfnAnalysis class & CfnTemplate the problem is with SourceEntity parameter in both classes. Both of them required to provide arn of each other, but during CREATE_IN_PROGRESS only one of them is ready, so I get an error "Resource of type 'AWS::QuickSight::Analysis' with identifier 'CfnAnalysisId' was not found." I can skip in CfnTemplate parameter SourceAnalysis and give instead SourceTemplate with arn of existing template but then when I try to use this template to create a Dashboard I receive another error: "Given placeholders [placeholder] are not part of template". This is correct but placeholder parameter is part of "SourceAnalysis" parameter so back to the original problem.

In conclusion, I would like to use CDK to create a new template and a new analysis, both objects need each other, so how can this be done?

已提問 2 年前檢視次數 5846 次
6 個答案
1
已接受的答案

In the end, a workaround was found. A manual step is still needed, but only as a prerequisite.

1.Create manually quicksight template by CLI "aws quicksight create-template --aws-account-id 0123456789 --region region --template-id template --source-entity file://template.json"

2.Use this template ARN as SourceTemplate in new CfnTemplate

3.Create new CfnAnalysis with new CfnTemplate arn as SourceEntity.

已回答 2 年前
profile picture
專家
已審閱 1 個月前
1

Hi,

I just finished automating the Dashboard, Analysis generation in my project using CDK, Codepipeline. I released a lot of code about this in my github repo (https://github.com/gmournos/quicksight-as-code) and published an article in order to help others who try to automate quicksight (https://medium.com/@gmournos/aws-quicksight-as-code-a-unified-approach-for-quicksight-development-and-deployment-using-aws-30bbb6bd253a).

I hope this helps the community

已回答 10 個月前
0

Hi.

In order to create Analisys with QuickSight, you need the original Analisys.
So create Analisys manually or by another CloudFormation. It's another base analysis for input to the stack.

In this case, the ARN that the template should reference is the ARN of the analysis passed in the input parameters, not the Analisys you are about to create.

profile picture
專家
iwasa
已回答 2 年前
0

Thank you for your reply, but unfortunately it is insufficient because it focuses on solving one problem and creates another. To create the Analysis, a DataSet is required, which in my case is also built dynamically like Template and Analysis. If I specify in CfnTemplate an ARN from a manually created Analysis in which a different DataSet is specified, I get the error "Given data sets [arn] are not part of analysis". So if I followed this approach, I would have to manually create half the stack

It looks like a bug in CloudFormation here is reported issue.

已回答 2 年前
0

Another customer is facing this very same issue that they are creating analysis via template. Any suggestions and working are welcome?

AWS
已回答 1 年前
0

Has anyone found a solution for this problem? The error provided in the prior comment persists, "Given data sets [arn] are not part of analysis" for both Dashboards and Analysis creation using a manually created Analysis as the SourceEntity for the templates. You can also create an Analysis via a Definition, I see describe_analysis_definition in the available Quicksight functions but it does not appear to work even after upgrading to AWS CLI v2.

Pat G
已回答 1 年前

您尚未登入。 登入 去張貼答案。

一個好的回答可以清楚地回答問題並提供建設性的意見回饋,同時有助於提問者的專業成長。

回答問題指南