I am able to import the Twilio TaskRouter TaskChannel resource into my terraform state, but when attempting to update the "channel_optimized_routing" parameter for any imported(already existing) TaskChannel resource, the terraform apply fails.
On further investigation, It seems for the TaskRouter TaskChannel Resource REST API, “FriendlyName” parameters is optional and there is no way to update the “UniqueName” using the REST API.
Although, when using the terraform provider, the schema defined for the TaskChannel resource states that “friendly_name” is mandatory/required represented with “SchemaRequired” and “unique_name” is not only mandatory/required but is also marked as “ForceNew” represented with “SchemaForceNewRequired”. According to Terraform docs, ForceNew indicates that any change in this field requires the resource to be destroyed and recreated.
The terraform-provider-twilio requires us to pass the unique_name because it is mandatory, but the Twilio TaskRouter backend throws an error doing the update as TaskRouter does not allow us to update the unique_name/UniqueName of the TaskChannel once created.
Steps to Reproduce
Import any Twilio TaskRouter TaskChannel into your state.
Update the TaskChannel resource you imported to change the "channel_optimized_routing" parameter from false --> true.
Issue Summary
I am able to import the Twilio TaskRouter TaskChannel resource into my terraform state, but when attempting to update the "channel_optimized_routing" parameter for any imported(already existing) TaskChannel resource, the terraform apply fails.
On further investigation, It seems for the TaskRouter TaskChannel Resource REST API, “FriendlyName” parameters is optional and there is no way to update the “UniqueName” using the REST API.
Although, when using the terraform provider, the schema defined for the TaskChannel resource states that “friendly_name” is mandatory/required represented with “SchemaRequired” and “unique_name” is not only mandatory/required but is also marked as “ForceNew” represented with “SchemaForceNewRequired”. According to Terraform docs, ForceNew indicates that any change in this field requires the resource to be destroyed and recreated.
The terraform-provider-twilio requires us to pass the unique_name because it is mandatory, but the Twilio TaskRouter backend throws an error doing the update as TaskRouter does not allow us to update the unique_name/UniqueName of the TaskChannel once created.
Steps to Reproduce
Code Snippet
Exception/Log
Technical details: