terraform-provider-dynatrace
terraform-provider-dynatrace copied to clipboard
Question: Resource IDs & generating duplicate resources on each run
Hello, After any change (e.g. change dashboard owner), a new dashboard is created rather than the existing dashboard being modified. The old dashboard is also left in place.
I was looking at the docs here https://github.com/dynatrace-oss/terraform-provider-dynatrace/blob/main/docs/resources/dashboard.md
And noticed that id is defined as an optional key
I tried using this in the hope I could get terraform to hook onto a single resource instead of creating new ones for each run but it threw the error: "Error: Invalid or unknown key"
In my dashboard .tf file (generated via direct invocation of the tool) I added the id of the dashboard in dyntrace like this: ''' resource "dynatrace_dashboard" "mydashboard" { id = "xxxx-xxxx-xxxx-xxxx-xxxxxxx" dashboard_metadata { ... '''
Maybe I am misusing this, is there another way to prevent duplicates being created? Many thanks.