Under provider version 1.30.2, it seems it is not possible to update telephony_providers_edges_did_pool without un-assigning all the routes in the existing pool first.
The reason is that TF does not actually update the pool, and instead attempts to delete and re-create the object (we have flagged this behaviour with different object types before).
Example when trying to update a range in an existing DID pool:
module.telephony_providers_edges_did_pool.genesyscloud_telephony_providers_edges_did_pool.CICDTest must be replaced
-/+ resource "genesyscloud_telephony_providers_edges_did_pool" "CICDTest" {
...
If a DID from this pool is already assigned, this operation fails with the following error:
Error: Exhausted retries. Last error: [{0 Failed to delete DID pool with starting number +1xxxxx: API Error: 409 - The resource didPool is referenced by the phoneNumber <> (<>) []}]
Could you please review and advise? With this behaviour, we are not able to add DID Pools into our CICD pipelines. This is great for shrinking the Pools, but we would need create new Pool with every expansion, which may become difficult to manage over time.
(Please advise if this should be reported as a separate Topic)
Another thing we noticed is that when shrinking a Pool, once all the routes are un-assigned, the pipeline has to be executed twice as we get an error message with the first run.
module.telephony_providers_edges_did_pool.genesyscloud_telephony_providers_edges_did_pool.CICDTest: Destruction complete after 0s
module.telephony_providers_edges_did_pool.genesyscloud_telephony_providers_edges_did_pool.CICDTest: Creating...
...
Error: Failed to create DID pool +1xxxxx: API Error: 409 - The DID Pool's phone numbers overlap with the phone numbers of one or more existing pools. ()
I will open a ticket on our development team. Since we just started our sprint, I will see if we can squeeze this in. I can not give ETA yet as we will need to dig into whether the issue is in the Terraform provider or a change in the underlying API.
During any change to the resource, we are going to modify the terraform provider to update the genesyscloud_telephony_providers_edges_did_pool
resource instead of delete and recreate , which should solve the problem mentioned. Will keep you posted once the change is released.