gessnerfl / terraform-provider-instana

Terraform provider implementation for Instana REST API
Apache License 2.0
29 stars 16 forks source link

fetch channel id and event ids in the terraform #203

Closed pavan141994 closed 10 months ago

pavan141994 commented 11 months ago

Hi, Can you please let me know how to fetch channel id in integration ids and event ids in event filter rule id on instana_alerting_channel resource.

Thanks in advance.

gessnerfl commented 11 months ago

@pavan141994 If you maintain the alerting channels as well in terraform you can fetch the id form the resources:

instana_alerting_channel.my_channel.id

Alternatively you could define a data source to fetch the define alerting channel and then get the id from the data source: https://registry.terraform.io/providers/gessnerfl/instana/latest/docs/data-sources/alerting_channel

For custom event specifications you can fetch id as well its terraform resource when maintained in terraform. Otherwise you have to get the id from the user interface and maintain it as a string in code. For built-in events you can again use the corresponding data source: https://registry.terraform.io/providers/gessnerfl/instana/latest/docs/data-sources/builtin_event_spec

If you maintain alerting channels or events in different terraform projects you can export the required data as output parameters and import the remote state in the terraform project where you maintain the instana_alerting_config.

gessnerfl commented 10 months ago

@pavan141994 Can you please close the issue if my previous reply helped solve the problem.