Quicksight - Replace Deleted Datasource

0

In Quicksight I accidentally deleted a datasource that a few datasets were connected to. I have attempted to replace the missing datasource in the dataset via using CLI in AWS CloudShell with an identical one using aws quicksight update-data-set --aws-account-id --data-set-id --cli-input-json file://update-data-source.json. However, i receive the following error:

An error occurred (InvalidParameterValueException) when calling the UpdateDataSet operation: Invalid dataSourceArn: datasource:

How do I avoid this error to update the datasource in the dataset?

asked 3 months ago190 views
2 Answers
2
Accepted Answer

Good morning. In my company the same thing has just happened this week. By accident a member deleted an Athena DataSource on which many DataSets had been created. To solve it we contacted AWS support and they told us that we should proceed as follows, managing to solve the problem and having the DataSets operational again: 1. Create a new DataSource using the CLI: create-data-source --aws-account-id <value> --data-source-id <same id as the deleted datasource> --name <value> --type <value> 2. Create a new DataSource that is automatically assigned its ID by console. 3. Get the information of the DataSets that do not work for the deleted DataSource: describe-data-set --aws-account-id <value> --data-set-id <value> 4. In case you do not know the ids of the datasets consult them with: list-data-sets --aws-account-id <value> 5. Update the datasets with the PhysicalTableMap structures and others to keep the DataSets the same, but changing inside the PhysicalTableMap the value of DataSourceArn to the value of the new ID created: update-data-set --aws-account-id <value> --data-set-id <value> --name <value> --physical-table-map <PhysicalTableMap> --import-mode <value>.

You cannot directly change the DataSource for the new one without having previously created the replacement for the deleted one with the same ID, otherwise the API will fail because the DataSource that has the DataSet before the change (the one that has been deleted) does not exist. In addition, the new DataSource that keeps the ID of the deleted one cannot be used either, as it is assigned a different internal ID than the deleted one and the API fails. We recommend passing to the update-data-set arguments the structures from a json file instead of directly to the command line: update-data-set --aws-account-id <value> --data-set-id <value> --name <value> --physical-table-map file://my_physical_table_map.json --import-mode <value>

answered 2 months ago
profile picture
EXPERT
reviewed a month ago
  • This worked. Thank You!!! You are a lifesaver. I have been beating my head against the wall on this. You've saved me a lot of time.

0

I am not a QuickSight expert. But upon a quick glance, I don't think udpate-data-set is the right command to replace the missing data source. Parameter --data-set-id is the dataset that you want to update on (the dataset that is missing) which is why you are receiving the error.

profile pictureAWS
EXPERT
answered 3 months ago
  • This is what Amazon Q told me to do, which i did, and i get the same error message:

    Update just the datasource ARN value in the physical table map to the correct one, and save it as a new JSON file.

    Use the update-dataset command pointing to the new JSON file to replace just the datasource, keeping all other fields the same:

    aws quicksight update-dataset --dataset-id <id> --physical-table-map file://updated-map.json

    Double check that the datasource ARN in the JSON matches an existing one in your account that has the same schema as the original.

    Updating just the datasource reference in the physical table map should resolve the error by replacing the invalid ARN with a valid one, without changing any other dataset properties.

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions