terraform-provider-dynatrace icon indicating copy to clipboard operation
terraform-provider-dynatrace copied to clipboard

Question: Resource IDs & generating duplicate resources on each run

Open smc87 opened this issue 3 years ago • 6 comments

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 image

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.

smc87 avatar Jun 02 '21 11:06 smc87