Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Terraform hitting API rate limits on Twilio when creating multiple resources #547

Open
jared-hunter opened this issue Apr 22, 2024 · 4 comments

Comments

@jared-hunter
Copy link
Contributor

As the subject line suggests, when adding multiple terraform resources of the same type the terraform deployment can fail because the Twilio rest API returns a 429, "Too many requests"

I'm aware this is an issue in the terraform provider and a retry handler should be implemented there.

I wanted to raise an issue for the community so we can track any progress in this area and also discuss any possible mitigation strategies we might be able to leverage until a fix in the provider can be made.

@dremin
Copy link
Contributor

dremin commented Apr 22, 2024

Opened an issue to support this in the Go SDK used by the provider: twilio/twilio-go#247

@jared-hunter
Copy link
Contributor Author

Typically when hitting this issue in the past, its been for activities or queues, which we could repeatedly run terraform apply to ensure everything ultimately made it into the environment.

Im now finding with workflows thats impossible because workflows and studio flows will always trigger an update, due to the provider not ignoring whitespace

Has anyone discovered any strategies for working around this?

@dremin
Copy link
Contributor

dremin commented May 7, 2024

I've found that the -refresh=false flag can help but does not totally solve things. It skips comparing the state to what is deployed. It's been a while since I used it, but I think that may also prevent triggering the whitespace issue.

@jared-hunter
Copy link
Contributor Author

jared-hunter commented May 8, 2024

i think i've found a workaround

in the resource declare the configuration as follows

  configuration = jsonencode(jsondecode(templatefile("${path.module}/workflows/<workflow-name>.json", {
   vars...
  })))

it still reports a diff, at least in terraform and i have not dug into exactly why but in testing, it successfully creates and updates through the long list of workflows, but when the workflow is the same - it doesnt seem to invoke the API - allowing us to progress through the long list of workflows with retries instead of getting stuck re-applying the same ones.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants