I’m trying to create a template using create_template(), but instead of using the original datasets I want to use copies of those, which are CustomSQL queries.
Would that be possible while at create_template()?
If not, would I be able to replace the datasets later maybe while update_template() or, finally while create_dashboard()?
yes it should be possible.
In order to use templates cross accounts you first need to create the datasource in the the Accounts.
We are using a longer powershell script to move all the datasets from our DEV account to the STAGE and PROD accounts. Within this step we are also modifying some the ARNs of linked resources like datasets, the process is the following
- get the JSON definition in Account A
- adjust JSON (replace your SQL)
- deploy to Account B (you need to add logic to handle create and updates of the datasets for future updates)