Description
Issue Summary
When creating a new Autopilot Task for a bot, the data appears to be populated from the Terrafrom twilio_autopilot_assistants_tasks_v1
resource correctly, but subsequent updates don't seem to be applied
In my case, I was attempting to update the URI of a redirect action. The URI in the JSON was set as uri: "${var.serverless_url}/autopilotRedirect"
Initially var.serverless_url
was blank, so the URI property was set to /autopilotRedirect
in Twilio console, as you would expect.
But the var.serverless_url
was populated and terraform apply
was ran again. The change was detected and reported as an update that would be applied, but after the apply was run, whilst the state was updated, the URI in Twilio Console still read /autopilotRedirect
I tried changing some of the static JSON in the URI value, just to see if it was because only a variable had changed, but same result, the change was detected and applied to the state, but no change in the Twilio Console.
Steps to Reproduce
- Create an Autopilot Assistant Task resource with a redirect action defined
- Run
terraform apply
- the new task should be added to the state and created on the Twilio account as expected - Change the URI of the redirect in the resource's
action
attribute's JSON. - Run
terraform apply
again
Expected Result:
The updated task is detected and updated in the state and set to the updated URI on the Twilio account.
Actual Result
The updated task is detected and updated in the state, but the URI in Twilio Console is still the one the task was initially created with.
Code Snippet
resource "twilio_autopilot_assistants_tasks_v1" "redirect_function" {
unique_name = "redirect_function"
assistant_sid = twilio_autopilot_assistants_v1.pre_survey.sid
actions = jsonencode({
"actions" : [
{
"redirect" : {
"method" : "POST",
"uri" : "${var.serverless_url}/autopilotRedirect"
}
}
]
})
}
Technical details:
- terraform-provider-twilio version: 0.11.1:
- terraform version: v1.1.0 (windows_amd64)