fixes https://github.com/thousandeyes/terraform-provider-thousandeyes/issues/158
This issue is happening because we currently allow the alert rule <-> test association to be established from both perspectives. From the alert rule update perspective, it will clear any test association if the list of testIds is not sent in the request.
This PR changes the alert rule test_ids schema attribute to be computed so that it is not considered in the TF plan but it's still retrieved from the alert rule get by id operation and passed along the alert rule update request.
Also, since the alert rule returns a field tests when getting by id and receives a field testIds when updating the alert rule, had to implement a map from the GenericTest to get only the testId.
One drawback of this approach (not a huge one IMO) is that the state may not always be accurate. This is because a test <-> alert rules association can be changed from the test perspective and not get reflected on the alert rule perspective. Anyways, it will eventually update the state when the next alert rule update is performed.
fixes https://github.com/thousandeyes/terraform-provider-thousandeyes/issues/158 This issue is happening because we currently allow the alert rule <-> test association to be established from both perspectives. From the alert rule update perspective, it will clear any test association if the list of testIds is not sent in the request. This PR changes the alert rule
test_ids
schema attribute to be computed so that it is not considered in the TF plan but it's still retrieved from the alert rule get by id operation and passed along the alert rule update request. Also, since the alert rule returns a fieldtests
when getting by id and receives a fieldtestIds
when updating the alert rule, had to implement a map from the GenericTest to get only the testId.One drawback of this approach (not a huge one IMO) is that the state may not always be accurate. This is because a test <-> alert rules association can be changed from the test perspective and not get reflected on the alert rule perspective. Anyways, it will eventually update the state when the next alert rule update is performed.