我能够在Amazon QuickSight从cli创建数据集。但是,当我尝试从本地系统创建一个数据集Asp。Net代码使用亚马逊SDK,然后我得到访问拒绝。所有的read和list方法都工作得很好。我正在使用与cli相同的aws凭据。
CLI代码:
aws quicksight create-data-set --cli-input-json file://./create-data-set.json --profile PROFILE //This works fine in CLI
c#代码:
AmazonQuickSightClient client = new AmazonQuickSightClient(<AccessKey>, <SecretAccessKey>, <Region>); //Same credentials as I used in above CLI
//This line works
List<DataSetSummary> dsSummary = client.ListDataSetsAsync(<ListDataSetsRequest>).Result.DataSetSummaries;
//This line throws error
int result = client.CreateDataSetAsync(<CreateDataSetRequest>).Result.Status;
我在异常中看到的错误如下:
"User: arn:aws:iam::ACCOUNT: User/User未被授权访问此资源">
"AccessDeniedException">
"远程服务器返回一个错误:(403)Forbidden.">
谢谢
数据源信息不正确,更新已修复此问题。
datasetBlah.PhysicalTableMap.Values.First().RelationalTable.DataSourceArn = <CORRECT_DATASOURCE_ARN>;