twilio / terraform-provider-twilio

Terraform Twilio provider
MIT License
63 stars 13 forks source link

Cant use provider with region ie1 #142

Closed mstuercke closed 4 months ago

mstuercke commented 4 months ago

Issue Summary

It is not possible to create an TwiML App in Ireland (ie1) with terraform. If I use my US credentials, everything works just fine.

Steps to Reproduce

  1. Put the code snippet into a file main.tf
    • Replace the <account-sid> and <auth-token> with the live credentials from Twilio Account
  2. Execute terraform init
  3. Execute terraform apply --auto-approve

Code Snippet

# main.tf
terraform {
  required_providers {
    twilio = {
      source  = "twilio/twilio"
      version = "0.18.46"
    }
  }
}

provider "twilio" {
  username = "<account-sid>"
  password = "<auth-token>"
  region   = "ie1"
}

resource "twilio_api_accounts_applications" "twiml_app" {
  friendly_name = "tmp"
}

Exception/Log

twilio_api_accounts_applications.twiml_app: Refreshing state... [id=xxx]
╷
│ Error: Status: 401 - ApiError 20003: Authenticate (null) More info: https://www.twilio.com/docs/errors/20003
│ 
│   with twilio_api_accounts_applications.twiml_app,
│   on main.tf line 21, in resource "twilio_api_accounts_applications" "twiml_app":
│   21: resource "twilio_api_accounts_applications" "twiml_app" {
│ 
╵

Technical details:

mstuercke commented 4 months ago

The edge location was missing in the provider config. I was sure, that I've tried this exact combination multiple times. Whatever, it works now.

provider "twilio" {
  username = "<account-sid>"
  password = "<auth-token>"
  region  = "ie1"
  edge = "dublin"
}