How to create Quicksight Analysis & Template in CDK
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?
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.
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.
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.
How do I find my QuickSight dashboard and analysis IDs?asked 4 months ago
Quicksight - Create data set (Athena) - Table query times out when trying to create data set
Quicksight Athena - analysis error: "HIVE_UNSUPPORTED_FORMAT: Unable to create input format"
How to add domain alias to existing CloudFront distribution using CDKAccepted Answerasked 7 months ago
create Secret with namy generated password/keys with CDKasked 3 months ago
Amazon QuickSight - is it possible to fully automate a dashboard creation with AWS SDKAccepted Answerasked 2 years ago
QuickSight Analysis Export to Excel Limitasked 4 months ago
How to create Quicksight Analysis & Template in CDKAccepted Answerasked 3 months ago
Detecting data-share in Amazon QuicksightAccepted Answerasked 2 years ago
CDK QuickSight unable to schedule refreshasked 5 months ago