Reputation: 935
Using the nodejs AWS SDK i'm trying to update my quickSight DataSet with a csv file in S3 bucket. When calling the AWS quicksight update-data-set command(https://docs.aws.amazon.com/cli/latest/reference/quicksight/update-data-set.html) I'm getting the following error:
'physicalTableMap.string.member.s3Source.dataSourceArn' failed to satisfy constraint: Specified resource is not reachable in this region ('us-east-1')
I checked my quicksight region and s3 bucket region all set to 'us-east-1', so not sure why it's still complaining about region? IAM is also set to us-east-1
the dataSourceArn i'm passing is the arn for the S3 csv file.
const updateDataSetParams: UpdateDataSetRequest = {
AwsAccountId: awsAccountId /* required */,
DataSetId: getEnvironmentKeyValue("AWS_PERMISSIONS_DATA_SET_ID") /* required */,
ImportMode: "SPICE" /* required */,
Name: getEnvironmentKeyValue("AWS_PERMISSIONS_DATA_SET_DISPLAY_NAME") /* required */,
PhysicalTableMap: {
string: {
S3Source: {
DataSourceArn: getEnvironmentKeyValue("AWS_PERMISSIONS_S3_DATA_SOURCE_ARN") /* required */,
InputColumns: [
/* required */
{
Name: "UserName" /* required */,
Type: "STRING" /* required */
},
{
Name: "CompanyName" /* required */,
Type: "STRING" /* required */
},
{
Name: "BranchIds" /* required */,
Type: "STRING" /* required */
}
/* more items */
],
UploadSettings: {
ContainsHeader: true,
Delimiter: ",",
Format: "CSV"
// StartFromRow: 2
}
}
}
}
};
const updateDataSet = await quicksight.updateDataSetAsync(updateDataSetParams);
p:s , I manage to call other quicksight commands like create-namespace and create-user which all work fine. Only when I try to update the dataset.
Upvotes: 1
Views: 951
Reputation: 2736
I found the error message Specified resource is not reachable in this region
to be incredibly misleading. The same message was generated regardless of what DataSourceArn
I supplied.
The solution in my case was to create the data set using the AWS console and then print the definitions using the CLI, which is what I used in my code.
Note that creating a data set using the console actually creates:
So I believe you are required to recreate the equivalent in code.
My working code is shown in this gist. It is somewhat verbose, and I doubt that every config parameter is actually required. My source data is in JSON format, but to be honest I think that CSV would be much less confusing.
The following sample CLI commands will help you get the data from QuickSight to paste into your code.
List data sources
aws quicksight list-data-sources --aws-account-id 111111111111
Describe data source
aws quicksight describe-data-source --aws-account-id 111111111111 --data-source-id "b64cc8ac-e85d-4116-b4dc-cf901b530046"
Describe data source permissions
aws quicksight describe-data-source-permissions --aws-account-id 111111111111 --data-source-id "b64cc8ac-e85d-4116-b4dc-cf901b530046"
List data sets
aws quicksight list-data-sets --aws-account-id 111111111111
Describe data set
aws quicksight describe-data-set --aws-account-id 111111111111 --data-set-id "a2ea12e6-2583-4930-a492-b4797bf37ab4"
Describe data set permissions
aws quicksight describe-data-set-permissions --aws-account-id 111111111111 --data-set-id "a2ea12e6-2583-4930-a492-b4797bf37ab4"
Upvotes: 1