The goal of this Terraform provider plugin is to make manging your Twilio account easier.
Current features:
twilio_workspace
twilio_subaccount
twilio_application
twilio_worker
twilio_taskQueue
twilio_workflow
twilio_phoneNumber
More coming soon.
Build
Run:
make plugin
to build and move the plugin to ~/.terraform.d/plugins
which is where terraform will look for all 3rd party plugins
Getting Started
- Start a trial account at twilio.com (if you don't have one already). Use the Console Dashboard to take note of your Account SID (a long string starts with
AC
and looks like a GUID) and Auth Token (also a long GUID-like string, hidden under the View
link).
- Download the latest release of the provider and place in your
~/.terraform.d/plugins
directory.
- Use the example below, replacing
account_sid
and auth_token
with the appropriate values.
terraform apply
Note: this will cost you REAL MONEY (or at the very least trial credits).
Debugging
Adding the following lines to your bash profile will enable additional logging.
export TF_LOG=TRACE
export TF_LOG_PATH=./terraform.log
export DEBUG_HTTP_TRAFFIC=true
Example
Note: running and applying the below could cost you REAL MONEY! Please use this tool wisely!
provider "twilio" {
account_sid = "<your account sid here>"
auth_token = "<your auth token here>"
}
resource "twilio_subaccount" "woomy" {
friendly_name = "Woomy Subaccount #1"
}
resource "twilio_application" "new_twiml_app" {
friendly_name = "My new TwiML application"
}
resource "twilio_worker" "test_worker" {
friendly_name = "Your Name"
workspace_sid = "WSXXXXXXXXXXXXXX"
}
resource "twilio_taskQueue" "normal_support" {
friendly_name = "Normal Support"
workspace_sid = "WSXXXXXXXXXXXXXX"
}
resource "twilio_workflow" "test_workflow" {
friendly_name = "Test Workflow"
workspace_sid = "WSXXXXXXXXXXXXXX"
configuration = "{\"task_routing\":{\"default_filter\":{\"queue\":\"${twilio_taskQueue.normal_support.id}\"}}}"
}
resource "twilio_phoneNumber" "test_phone_number" {
friendly_name = "Test Phone Number"
search = "310*"
country_code = "US"
}