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

"twilio_api_accounts_incoming_phone_numbers" should not release a number when the resource is tainted #138

Open
anujc4 opened this issue May 14, 2024 · 0 comments

Comments

@anujc4
Copy link

anujc4 commented May 14, 2024

Issue Summary

As the title says, essentially. I have a use case where I have a lot of numbers that I want to configure multiple phone numbers with a similar configuration. I was able to do this successfully, then I tainted one of the phone number configuration to force terraform to re-apply the same configuration to the phone number (this was my expectation).

When I ran terraform apply after the taint, the provider releases the number and then terraform fails because the provider was not able to re-purchase the number.

Steps to Reproduce

  1. This is the first step
  2. This is the second step
  3. Further steps, etc.

Code Snippet

resource "twilio_api_accounts_incoming_phone_numbers" "phone_number_1_of_20" {
  path_account_sid       = var.account_sid
  friendly_name          = "foobar"
  phone_number           = "a phone number I purchased from Twilio"
  status_callback        = local.service_status_handler_url
  status_callback_method = "POST"
  voice_url              = local.service_call_handler_url
  voice_method           = "POST"
}

Exception/Log

╷
│ Error: Status: 400 - ApiError 21422: +_the_phone_number is not available. (null) More info: https://www.twilio.com/docs/errors/21422
│ 
│   with twilio_api_accounts_incoming_phone_numbers.resource,
│   on phone_number_configuration.tf line 13, in resource "twilio_api_accounts_incoming_phone_numbers" "resource":
│   13: resource "twilio_api_accounts_incoming_phone_numbers" "resource" {
│ 
╵

Technical details:

  • terraform-provider-twilio version: 0.18.44
  • terraform version: 1.20
@anujc4 anujc4 changed the title "twilio_api_accounts_incoming_phone_numbers" should not release a number when tainting the resource "twilio_api_accounts_incoming_phone_numbers" should not release a number when the resource is tainted May 14, 2024
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

1 participant