Viewing QuickSight analysis created by API on the AWS QuickSight console

The QuickSight analysis which is created using ‘create-analysis’ API, it is not found on the AWS QuickSight console.

How can we view the analysis which is created using ‘create-analysis’ API on the AWS QuickSight console ?

Hi,

Are you able to find this analysis using the list-analyses API? If so, what Status do you get?

I am wondering if the creation may have failed.

Hi,

Thanks for your response.

Sharing the steps done,

1.Running the ‘create-analysis’ API on the AWS CLI
aws quicksight create-analysis --cli-input-json file://./create-analysis-input.json

Contents of “create-analysis-input.json” file,

{
“AwsAccountId”: “account-id-used-here”,
“AnalysisId”: “analysis-id-used-here”,
“Name”: “TestReport6”,
“SourceEntity”: {
“SourceTemplate”: {
“Arn”: “arn-for-template-used-here”,
“DataSetReferences”: [
{
“DataSetPlaceholder”: “DEMO_DSET_2”,
“DataSetArn”: “arn-for-dataset-used-here”
}
]
}
},
“Permissions”:
[
{
“Principal”: “arn-for-prinipal-user-given-here”,
“Actions”: [
“quicksight:RestoreAnalysis”,
“quicksight:UpdateAnalysisPermissions”,
“quicksight:DeleteAnalysis”,
“quicksight:DescribeAnalysisPermissions”,
“quicksight:QueryAnalysis”,
“quicksight:DescribeAnalysis”,
“quicksight:UpdateAnalysis”
]
}
]
}

Response received from the CLI,

{
“Status”: 202,
“Arn”: “arn-for-created-analysis”,
“AnalysisId”: “id-for-created-analysis”,
“CreationStatus”: “CREATION_IN_PROGRESS”,
“RequestId”: “b77f83e6-ebac-4f63-ab97-3966b46d5d24”
}

2.Running the ‘list-analyses’ API on the AWS CLI to check the status of creation of analysis,
aws quicksight list-analyses --aws-account-id

Response received from the CLI,

{
“AnalysisSummaryList”: [

{
“Arn”: “arn-for-created-analysis”,
“AnalysisId”: “id-for-created-analysis”,
“Name”: “TestReport6”,
“Status”: “CREATION_FAILED”,
“CreatedTime”: “2022-11-30T10:44:54.339000+05:30”,
“LastUpdatedTime”: “2022-11-30T10:44:55.048000+05:30”
}

]
}

3.The status of creation of analysis as per the above response is “CREATION_FAILED”.

4.Therefore this analysis cannot be viewed on the QuickSight console.

Are we missing something here ?

Any guidance will be much appreciated.

Ok, it makes sense that you can’t see the analysis if the creation failed. However, I can’t spot an obvious reason the creation has failed from your code.

I think you can get more information on creation errors with the describe-analysis API. Let me know what it returns!

Running ‘describe-analysis’ command,

aws quicksight describe-analysis --aws-account-id --analysis-id

Response received from the CLI,

{
“Status”: 200,
“Analysis”: {
“AnalysisId”: “analysis-id-used-here”,
“Arn”: “arn-for-created-analysis”,
“Name”: “TestReport6”,
“Status”: “CREATION_FAILED”,
“Errors”: [
{
“Type”: “VALIDATION_ERROR”,
“Message”: “Invalid principals given [arn-for-prinipal-user-given-here].”
}
],
“DataSetArns”: [
“arn-for-dataset-used-here”
],
“CreatedTime”: “2022-11-30T10:44:54.339000+05:30”,
“LastUpdatedTime”: “2022-11-30T10:44:55.048000+05:30”,
“Sheets”: [
{
“SheetId”: “4474e940-20b7-45e0-b155-78a640e17f20”,
“Name”: “Sheet 1”
}
]
},
“RequestId”: “3b5af80a-bfc7-4e9e-bfd5-dea374357899”
}

Note
1.The arn given for the principal user was invalid (given by “VALIDATION_ERROR” in the above response)

Rechecked the sequence for generation of user arn, one particular substring was missing from the user arn which I gave earlier.
This was causing the issue.
Generated the correct sequence for the user arn, placed it in the body of the request and ran the ‘create-analysis’ command again.
After this, ran the ‘describe-analysis’ command again, it gave the status as “CREATION_SUCCESSFUL” and was able to view the newly created analysis on the QuickSight console.

Thanks for your help !

1 Like