logdna / terraform-provider-logdna

Terraform provider to simplify creation of views, preset alerts and other resources in LogDNA!
https://registry.terraform.io/providers/logdna/logdna/latest
MIT License
11 stars 12 forks source link

Bug: provider will update resources in place when they have slack channels attached #40

Closed philippfrank closed 2 years ago

philippfrank commented 2 years ago

I use the provider to create:

Since there seems no way to attach the alert to the view yet (see https://github.com/logdna/terraform-provider-logdna/issues/26 and https://github.com/logdna/terraform-provider-logdna/issues/14), I have to attach the slack alert channel via the user interface.

Whenever I now run terraform apply, it will attempt to modify the view resources, detaching the slack channel. This is very frustrating.

image

mdeltito commented 2 years ago

@philippfrank we have added alerts as a Data Source, which should allow for the workflow you are looking for using Alert Presets:

https://registry.terraform.io/providers/logdna/logdna/latest/docs/data-sources/logdna_alert

mdeltito commented 2 years ago

ah I see your other comment about using a preset not working for slack_channel. that's unexpected, and something we can look into

philippfrank commented 2 years ago

Maybe I am misunderstanding presets. Question: when I use the web user interface and attach a previously created channel (slack, PD etc.) to a view, what happens internally? Are you "making a copy" of the preset params and attach that to the view. Or, are you referencing the ID of that preset from the view? In either case, as others have pointed out, it's not clear what's happening.

@david-ly's answer does not work, see my other comment.

EDIT: thanks for looking into this and being so responsive 👍🏻

gjanco commented 2 years ago

@philippfrank , we have added this request to our backlog. Our intention is to have a presetid as an option instead of a channel. This way you could either refer to an existing preset alert you created in the UI, or use TF state variables to set this value to an alert you created in TF.

philippfrank commented 2 years ago

@gjanco This is great, thanks for the update. Looking forward to the release, count me in for testing ;)

gjanco commented 2 years ago

Closing this issue as it will be addressed by #26