Open dgeorges opened 2 months ago
Thanks for reporting this. It may be due to the endpoint only accepting a list of service table items, leading to a race condition when run concurrently. For example, the first process edits a table item while the second process also edits a table item. A fix is to ensure that the resource can run only once concurrently against the same integration.
When provisioning multiple resources of type
sentry_integration_pagerduty
the terraform plan will fail with an error. Usual after the first resource has succeeded. The error is:eg.
Looking at the code here it seems the sentry API is behaving as eventually consistent, instead of transactional because the code it does the following:
I should mention this only happens when there are multiple "sentry_integration_pagerduty" resources to provision. The first one succeeds and the following ones all fail. When this happens the terraform state is left in a bad state and "terraform state rm" needs to be run to remove the last "sentry_integration_pagerduty" resource that didn't succeed.
It should fail gracefully without resulting in a bad statefile.
In the event the downstream api can not be changed. A retry or wait might help it not fail at all.