A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/twilio/terraform-provider-twilio below:

GitHub - twilio/terraform-provider-twilio: Terraform Twilio provider

Twilio Terraform Provider

⚠️ This project is currently in PILOT and NOT under active development and maintenance.

Documentation on the available resources that can be managed by this provider and their parameters can be found here.

Note that file upload resources are currently not available.

Clone repository:

git clone git@github.com:twilio/terraform-provider-twilio

Enter the provider directory and build the provider:

Installing and Using the Provider
  1. Run make install to install and build the twilio-terraform-provider.
  2. Configure the Twilio provider with your twilio credentials in your Terraform configuration file (e.g. main.tf). These can also be set via TWILIO_ACCOUNT_SID and TWILIO_AUTH_TOKEN environment variables.
  3. Add your resource configurations to your Terraform configuration file (e.g. main.tf).
terraform {
  required_providers {
    twilio = {
      source  = "twilio/twilio"
      version = "0.18.46"
    }
  }
}

# Credentials can be found at www.twilio.com/console.
provider "twilio" {
  //  username defaults to TWILIO_API_KEY with TWILIO_ACCOUNT_SID as the fallback env var
  //  password  defaults to TWILIO_API_SECRET with TWILIO_AUTH_TOKEN as the fallback env var
}

resource "twilio_api_accounts_keys" "key_name" {
  friendly_name = "terraform key"
}

output "messages" {
  value = twilio_api_accounts_keys.key_name
}
  1. Run terraform init and terraform apply to initialize and apply changes to your Twilio infrastructure.
Using environment variables

You can use credentials stored in environment variables for your setup:

For usage examples, checkout the documentation in usage.md and the examples folder.

The boilerplate includes the following:

If you wish to work on the provider, you'll first need Go installed on your machine (version 1.18+ is required).

To compile the provider, run make build. This will build the provider and put the provider binary in the $GOPATH/bin directory.

make build
...
$GOPATH/bin/terraform-provider-twilio
...

In order to run the full suite of Acceptance tests, run make testacc. Provide your Account SID and Auth Token as environment variables to properly configure the test suite.

Note: Acceptance tests create real resources, and often cost money to run.

 make testacc TWILIO_ACCOUNT_SID=YOUR_ACCOUNT_SID TWILIO_AUTH_TOKEN=YOUR_AUTH_TOKEN

You can also specify a particular suite to run like so:

 make testacc TEST=./twilio/ TWILIO_ACCOUNT_SID=YOUR_ACCOUNT_SID TWILIO_AUTH_TOKEN=YOUR_AUTH_TOKEN

An example test file can be found here.

First:

then refer to the Terraform Debugging Documentation.

You can build and debug the provider locally. When using Goland you can set break point and step through code:

$ dlv debug main.go -- -debug
Type 'help' for list of commands.
(dlv) c
Provider started, to attach Terraform set the TF_REATTACH_PROVIDERS env var:

	TF_REATTACH_PROVIDERS='{"registry.terraform.io/twilio/twilio":{...}}}'

Copy the TF_REATTACH_PROVIDERS and run Terraform with this value set:

$ TF_REATTACH_PROVIDERS='...' terraform init
$ TF_REATTACH_PROVIDERS='...' terraform plan
...

Terraform will use the binary running under dlv instead of the twilio/twilio registry version. For further details refer to the Terraform Debugging Providers documentation.


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4