An error occurred (AccessDeniedException) when calling the CreateDataSet operation from boto3

Hello,

While executing CreateDataset API from an EC2 instance and running python scripy we get below error

“botocore.errorfactory.AccessDeniedException: An error occurred (AccessDeniedException) when calling the CreateDataSet operation: User is not authorized to access this resource”. Already IAM role has quicksight:* permissions

Already followed below docs:

community ref–>No permission when use boto3 to create datasets

The script is actually runs fine in another account. any other advice to be followed

thanks

Did you make sure that the account number is in the same account as your EC2 instance?

Hello Max,

yes that right same account and in same region.

I would suggest opening up a support case.

Here are the steps to open a support case. If your company has someone who manages your AWS account, you might not have direct access to AWS Support and will need to raise an internal ticket to your IT team or whomever manages your AWS account. They should be able to open an AWS Support case on your behalf. Hope this helps!