The opsgenie_service_incident_rule resource cannot detect if any managed rule is deleted manually from the OpsGenie console. If you delete any rule managed by terraform provider it still shows as existing upon plan or apply.
Terraform Version
Terraform v0.14.11 (Same behaviour on latest version)
As the rule is deleted manually, the terraform apply should detect the rule as not existing and start destroying the resource by removing it from the state.
Actual Behavior
Terraform apply or plan shows the rule still exist and exists without any change detected. It will only throw error when the resource is commented out (or removed) from the code and start complaining like this:
Error: Error occurred with Status code: 404, Message: IncidentRollupRule with id [XXXXXXXX] does not exist., Took: 0.036000, RequestId: XXXXXX
Releasing state lock. This may take a few moments...
ERRO[0225] 1 error occurred:
* exit status 1
Steps to Reproduce
Please list the steps required to reproduce the issue, for example:
terraform apply
Wait for the incident rule to be created in the OpsGenie console
Delete the incident rule from OpsGenie manually
Run terraform apply again. NO CHANGES ARE DETECTED!
Comment out the opsgenie_service_incident_rule from the terraform code
Run terraform apply again
It tries to destroy the incident rule but it fails with the mentioned error Error: Error occurred with Status code: 404, Message: IncidentRollupRule with id [XXXXXXXX] does not exist
References
Could not find any issue raised about this so I am reporting it here.
Hi there,
TL/DR:
The
opsgenie_service_incident_rule
resource cannot detect if any managed rule is deleted manually from the OpsGenie console. If you delete any rule managed by terraform provider it still shows as existing upon plan or apply.Terraform Version
Terraform v0.14.11 (Same behaviour on latest version)
Provider version
opsgenie/opsgenie: 0.6.20
Affected Resource(s)
Terraform Configuration Files
Expected Behavior
As the
rule
is deleted manually, theterraform apply
should detect the rule as not existing and start destroying the resource by removing it from the state.Actual Behavior
Terraform apply or plan shows the rule still exist and exists without any change detected. It will only throw error when the resource is commented out (or removed) from the code and start complaining like this:
Steps to Reproduce
Please list the steps required to reproduce the issue, for example:
terraform apply
terraform apply
again. NO CHANGES ARE DETECTED!opsgenie_service_incident_rule
from the terraform codeterraform apply
againError: Error occurred with Status code: 404, Message: IncidentRollupRule with id [XXXXXXXX] does not exist
References
Could not find any issue raised about this so I am reporting it here.