Skip to content
This repository has been archived by the owner on Sep 16, 2021. It is now read-only.

Commit

Permalink
☎️📱 Phone numbers: create & update details (#26)
Browse files Browse the repository at this point in the history
Phone numbers now pretty much usable! 🎉

- Create, Update, and Delete fully functional (#3)
- Finding phone numbers
  - Search by area code
  - Free form sequence search
- Configuration settings
  - Voice Settings
    - Application SID (#4)
    - Primary and fallback URLs and methods (#20)
    - Caller ID enabled/disabled
    - Line receive mode - voice/fax
  - SMS Settings
    - Application SID
    - Primary and fallback URLs and methods
  - Status callback
    - URL and method
  - Emergency calling (not fully tested, as I don't have a validated Address at the moment)
    - Address SID
    - Status
  • Loading branch information
Preskton committed Oct 12, 2019
1 parent 16b5097 commit 4742748
Show file tree
Hide file tree
Showing 4 changed files with 194 additions and 63 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ notifications:
email: false
script:
- env GO111MODULE=on go build
- env GO111MODULE=on gox -osarch="linux/amd64 windows/amd64 darwin/amd64" -output="terraform-provider-twilio_${TRAVIS_TAG}_{{.OS}}_{{.Arch}}"
- env GO111MODULE=on gox -osarch="linux/amd64 windows/amd64 darwin/amd64" -output="terraform-provider-twilio_v${TRAVIS_TAG}_{{.OS}}_{{.Arch}}"
.
- env GO111MODULE=on go test -v ./...
deploy:
Expand Down
71 changes: 60 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,21 @@ The goal of this Terraform provider plugin is to make manging your Twilio accoun

Current features:

- Compatible with Terraform `v0.12.10`
- `twilio_phone_number`
- Search
- US & International
- Country code
- Area Code
- Number prefix (or place * wherever you'd like!)
- Purchase (`terraform apply`)
- Delete/release (`terraform destroy`)
- Create/Purchase
- Update
- Delete/Release
- `twilio_subaccount`
- Create
- Update
- Delete

More coming soon.
More coming eventually!

## Getting Started

Expand All @@ -40,15 +43,61 @@ resource "twilio_subaccount" "woomy" {
friendly_name = "Woomy Subaccount #1"
}
resource "twilio_phone_number" "us_dallas_tx" {
resource "twilio_phone_number" "area_code_test" {
// Find a number
country_code = "US"
search = "972"
friendly_name = "Howdy from TX"
area_code = "972"
friendly_name = "terraform-provider-twilio area code test number"
// Configure your number
address_sid = "ADXXXX" // Certain countries may require a validated address!
identity_sid = "IDXXXX" // Certain countries may require a validated identity!
trunk_sid = "XXXXX"
voice {
primary_url = "https://genoq.com/handlers/voice-primary"
primary_http_method = "POST"
fallback_url = "https://genoq.com/handlers/voice-fallback"
fallback_http_method = "GET"
caller_id_enabled = "true"
receive_mode = "voice"
}
sms {
primary_url = "https://genoq.com/handlers/sms-primary"
primary_http_method = "POST"
fallback_url = "https://genoq.com/handlers/sms-fallback"
fallback_http_method = "GeT"
}
status_callback {
url = "https://genoq.com/handlers/status-callback"
http_method = "GET"
}
// Note: Emergency calling requires a validated address
emergency {
address_sid = "ADXXXXX"
status = "active"
}
}
resource "twilio_phone_number" "japan_somewhere" {
country_code = "JP"
search = "503*"
friendly_name = "日本"
resource "twilio_phone_number" "search_test" {
country_code = "US"
search = "972*"
friendly_name = "terraform-provider-twilio by-search test number"
sms {
primary_url = "https://genoq.com/handlers/sms-primary"
primary_http_method = "POST"
fallback_url = "https://genoq.com/handlers/sms-fallback"
fallback_http_method = "GET"
}
voice {
receive_mode = "fax"
application_sid = "APXXXXX"
}
}
```
1 change: 1 addition & 0 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ require (
github.com/onsi/ginkgo v1.7.0
github.com/onsi/gomega v1.4.3
github.com/sirupsen/logrus v1.2.0
github.com/spf13/cast v1.3.0
github.com/ttacon/builder v0.0.0-20170518171403-c099f663e1c2 // indirect
github.com/ttacon/libphonenumber v1.0.1 // indirect
gopkg.in/mgo.v2 v2.0.0-20180705113604-9856a29383ce // indirect
Expand Down
Loading

0 comments on commit 4742748

Please sign in to comment.