Hi Arun,
It is not clear what you mean by the role being used to invoke the CreateDataSource function. Is this role determined by something that is set when I create a new AmazonQuickSightClient? If so how do I know what that role is and where to change it’s permissions?
Here is some more information:
When I create a datasource using the APi, the api returns without an error. However, when I describe the datasource using the API the datasource indicates that it was not created successfully. Here is what the DescribeDataSourceAsync returns. Notice the status CREATION_FAILED and the ErrorInfo element:
{“DataSource”:{“AlternateDataSourceParameters”:[],“Arn”:“arn:aws:quicksight:us-east-2:402467524418:datasource/9999_56-DataSource”,“CreatedTime”:“2022-05-03T13:40:15.761Z”,“DataSourceId”:“9999_56-DataSource”,“DataSourceParameters”:{“AmazonElasticsearchParameters”:null,“AmazonOpenSearchParameters”:null,“AthenaParameters”:null,“AuroraParameters”:null,“AuroraPostgreSqlParameters”:null,“AwsIotAnalyticsParameters”:null,“ExasolParameters”:null,“JiraParameters”:null,“MariaDbParameters”:null,“MySqlParameters”:null,“OracleParameters”:null,“PostgreSqlParameters”:null,“PrestoParameters”:null,“RdsParameters”:null,“RedshiftParameters”:null,“S3Parameters”:null,“ServiceNowParameters”:null,“SnowflakeParameters”:null,“SparkParameters”:null,“SqlServerParameters”:{“Database”:“9999_56”,“Host”:“10.100.9.165”,“Port”:1433},“TeradataParameters”:null,“TwitterParameters”:null},“ErrorInfo”:{“Message”:“The DataSourceParameters is not authorized to use the CopySourceArn arn:aws:quicksight:us-east-2:402467524418:datasource/e833711b-63ac-42fe-a2cd-751026103071”,“Type”:{“Value”:“ACCESS_DENIED”}},“LastUpdatedTime”:“2022-05-03T13:40:16.407Z”,“Name”:“9999_56 DELETE ME”,“SslProperties”:{“DisableSsl”:true},“Status”:{“Value”:“CREATION_FAILED”},“Type”:{“Value”:“SQLSERVER”},“VpcConnectionProperties”:{“VpcConnectionArn”:“arn:aws:quicksight:us-east-2:402467524418:vpcConnection/Six Disciplines”}},“RequestId”:“c60c93ad-a70a-46e9-9663-556dd29f276c”,“Status”:200,“ResponseMetadata”:{“RequestId”:“c60c93ad-a70a-46e9-9663-556dd29f276c”,“Metadata”:{},“ChecksumAlgorithm”:0,“ChecksumValidationStatus”:0},“ContentLength”:1428,“HttpStatusCode”:200}
If I then try and use that datasource to create a new dataset, I get the error: One or more errors occurred. (DataSource arn:aws:quicksight:us-east-2:402467524418:datasource/9999_56-DataSource is in status CREATION_FAILED)
Here is the code I am using for the CreateDataSourceRequest:
var createDataSource = new CreateDataSourceRequest
{
AwsAccountId = AccountID,
DataSourceId = "9999_56-DataSource",
Name = "9999_56 DELETE ME",
Type = DataSourceType.SQLSERVER,
Permissions = new List<ResourcePermission>() {
new ResourcePermission() {
Actions = new List<string>() {
"quicksight:UpdateDataSourcePermissions",
"quicksight:DescribeDataSource",
"quicksight:DescribeDataSourcePermissions",
"quicksight:PassDataSource",
"quicksight:UpdateDataSource",
"quicksight:DeleteDataSource"
},
Principal = $"arn:aws:quicksight:{"us-east-1"}:{AccountID}:group/default/Author"
}
},
Credentials = new DataSourceCredentials()
{
CopySourceArn = "arn:aws:quicksight:us-east-2:402467524418:datasource/e833711b-63ac-42fe-a2cd-751026103071"
},
DataSourceParameters = new DataSourceParameters()
{
SqlServerParameters = new SqlServerParameters()
{
Database = "9999_56",
Host = "10.100.9.165",
Port = 1433
}
},
SslProperties = new SslProperties()
{
DisableSsl = true,
},
VpcConnectionProperties = new VpcConnectionProperties()
{
VpcConnectionArn = "arn:aws:quicksight:us-east-2:402467524418:vpcConnection/Six Disciplines"
}
};