Git Product home page Git Product logo

terraform-provider-twilio's People

Contributors

bobtfish avatar dependabot-preview[bot] avatar dependabot[bot] avatar johncowie avatar rjpearson94 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

terraform-provider-twilio's Issues

Rotate Auth Token

Hey, is there anyway to rotate the auth_token for a sub account using this provider.

I do see Twilio has an API for it here: https://www.twilio.com/docs/iam/api/authtoken

This could be useful in combination with Terraform time rotating feature or if a secret is exposed without having to update the token manually and re-import the resource.

Pass In Subaccount Details To Resources

Hey,

Instead of using an aliased provider for a subuser, would it be possible to add optional account_sid and auth_token properties on resources which could fall back to the provider ones?

Current Way:

provider "twilio" {
  auth_token  = var.auth_token
  account_sid = var.account_sid
}

resource "twilio_account_sub_account" "sub_account" {
  friendly_name = var.name
}

provider "twilio" {
  alias        = "sub"
  auth_token   = local.first_apply ? var.auth_token : twilio_account_sub_account.sub_account.auth_token
  account_sid  = local.first_apply ? var.account_sid : twilio_account_sub_account.sub_account.sid
}

resource "twilio_verify_service" "verify" {
  provider       = twilio.sub
  friendly_name  = "Test Name"
  lookup_enabled = true
  skip_sms_to_landlines = true
  totp {
    issuer      =  "Test Name"
    time_step   = 30
    code_length = 6
    skew        = 1
  }
}

Proposed Way:
Current Way:

provider "twilio" {
  auth_token  = var.auth_token
  account_sid = var.account_sid
}

resource "twilio_account_sub_account" "sub_account" {
  friendly_name = var.name
}

resource "twilio_verify_service" "verify" {
  auth_token   = twilio_account_sub_account.sub_account.auth_token
  account_sid  = twilio_account_sub_account.sub_account.sid
  friendly_name  = "Test Name"
  lookup_enabled = true
  skip_sms_to_landlines = true
  totp {
    issuer      =  "Test Name"
    time_step   = 30
    code_length = 6
    skew        = 1
  }
}

Serverless Build is not being triggered when asset or function version SID changed

Description

When an Asset or Function version is updated after a build has been created, a new build is not created

Affected Resource(s)

  • twilio_serverless_build

Affected Version(s)

  • Terraform: 0.12.26 & 0.13.2
  • Provider: 0.1.0 & 0.1.1

Terraform Configuration Files

resource "twilio_serverless_service" "service" {
  unique_name   = "twilio-test"
  friendly_name = "test"
}

resource "twilio_serverless_function" "function" {
  service_sid       = twilio_serverless_service.service.sid
  friendly_name     = "test"
  content           = <<EOF
exports.handler = function (context, event, callback) {
  callback(null, "Hello World");
};
EOF
  content_type      = "application/javascript"
  content_file_name = "helloWorld.js"
  path              = "/test-function"
  visibility        = "public"
}

resource "twilio_serverless_asset" "asset" {
  service_sid   = twilio_serverless_service.service.sid
  friendly_name = "test"
  source        = "module.png"
  source_hash   = filemd5("${path.module}/module.png")
  content_type  = "image/png"
  path          = "/test-asset"
  visibility    = "public"
}

resource "twilio_serverless_build" "build" {
  service_sid = twilio_serverless_service.service.sid

  function_version {
    sid = twilio_serverless_function.function.latest_version_sid
  }

  asset_version {
    sid = twilio_serverless_asset.asset.latest_version_sid
  }

  dependencies = {
    "twilio" : "3.6.3"
  }

  polling {
    enabled = true
  }
}

Expected Behavior

When the asset and/ or function version SID's are updated a new build (with new ID & SID) should be created

Actual Behavior

A new build is not created

Add support for trunking resources

Is your feature request related to a problem

Elastic SIP trunk and Origination URL support has been added to the master branch of the Twilio Go SDK, once a new version is released then support can be added to the Terraform provider

Describe the solution you'd like

Add at least 2 additional resources

  • twilio_trunking_trunk
  • twilio_trunking_origination_url

Add at least 3 additional data sources

  • twilio_trunking_trunk
  • twilio_trunking_origination_url
  • twilio_trunking_origination_urls

Additional context

Awaiting 0.7.0 of the Twilio Go SDK to be released

Twilio Studio Flow creation failing, resource created but not added to state

Technical Details

  • OS: Linux
  • Terraform Version: 1.3.4
  • Provider Version: 0.2.1

Affected Resources

  • twilio_studio_flow

Describe the bug

When creating a new studio flow the flow is created in Twilio but an error is thrown and the resource is not added into the terraform state. So when re-running the apply command, it attempts to recreate the flow with the same error again.

We are working around this issue to import the created resource into the state, the resource is then updated in place on the next apply.

This is the error that is thrown:

│ Error: Provider produced inconsistent result after apply

│ When applying changes to
│ module.twilio.twilio_studio_flow.${STUDIO_FLOW_NAME}, provider
│ "module.twillio.provider"[registry.terraform.io/rjpearson94/twilio"]"
│ produced an unexpected new value: Root resource was present, but now
│ absent.

│ This is a bug in the provider, which should be reported in the provider's
│ own issue tracker.

Steps to Reproduce

Steps to reproduce the behaviour:

  1. Add a new twilio_studio_flow resource to your plan
  2. Run terraform apply
  3. See error

Expected behaviour

Studio flow to be created, apply command to run successfully and resource added to terraform state

Importing a Twilio phone number doesn't populate its area code

Technical Details

  • OS: MacOS
  • Terraform Version: 1.4
  • Provider Version v0.18.18

Affected Resources

  • twilio_api_accounts_incoming_phone_numbers

Describe the bug

If you import a Twilio phone number, the terraform state will always set that number's area_code to null.

Steps to Reproduce

Steps to reproduce the behaviour:

  1. Create a Twilio phone number
  2. Import same
  3. Locate resource in the terraform state
  4. Notice that its area_code is set to null

Expected behaviour

The provider should populate the area_code based on what is returned by the Twilio API

Logs

N/A

Additional context

I believe this block should simply include a line for the area_code field.

twilio credential environment variables do not work

Technical Details

  • OS: osx
  • Terraform Version: 13.*/14.0.5
  • Provider Version: 0.6.1

Affected Resources

twilio auth credential environment variables do not work

Describe the bug

Using environment variables to pass in twilio credentials does not work

Steps to Reproduce

Steps to reproduce the behaviour:

# dont use credentials in provider
provider "twilio" {}
# run terraform plan passing in env vars
TWILIO_ACCOUNT_SID=sid TWILIO_API_KEY=key terraform plan

Expected behaviour

The plan should run like using credentials in provider

Logs

Error: Account Details Specified are invalid


2021-01-22T16:32:29.494Z [WARN]  plugin.stdio: received EOF, stopping recv loop: err="rpc error: code = Unavailable desc = transport is closing"

Twilio Rate limit reached

Technical Details

  • OS: MacOS
  • Terraform Version: 0.14.5
  • Provider Version: 0.15.0

Affected Resources

all if there are too many resources

Describe the bug

Error: Failed to create workflow: Rate limit exceeded for target Workflow-Create

This is caused by the 1 request per second rate limit: https://stackoverflow.com/questions/68637366/rate-limit-exceeded-for-target-task-list-evaluatetaskattributes#comment121322707_68644314

Steps to Reproduce

Steps to reproduce the behaviour:

  1. Create a lot of resources (multiple times)
  2. See error

Expected behaviour

Should retry if rate limit error is caught.

subAccount provider that depend on mainAccount?

I'm trying to create a twilio verify from a subAccount. the accountId and Authtoken I initially have are from the main account. So I need to create 2 twilio providers, one for the main account, and one for the sub account.

but the twilio provider would not let me create the sub account with a dependancy on the main account. The error that is returned is: Error: Account details specified are invalid. Validation errors: [SID is required, Auth token is required]

here is the code that would reproduce the issue:

terraform {
  required_providers {
    twilio = {
      source  = "RJPearson94/twilio"
      version = ">= 0.2.1"
    }
  }
}

locals {
  twilio_account_sid = "AC_Main_Account"
  twilio_auth_token  = "token"
  name_prefix = "terraform-test"
}

provider "twilio" {
  alias       = "main"
  account_sid = local.twilio_account_sid
  auth_token  = local.twilio_auth_token
}

resource "twilio_account_sub_account" "galoy_sub_account" {
  provider      = twilio.main
  friendly_name = "${local.name_prefix}-sub-account"
}

provider "twilio" {
  alias       = "sub"
  account_sid = twilio_account_sub_account.galoy_sub_account.sid
  auth_token  = twilio_account_sub_account.galoy_sub_account.auth_token
}

resource "twilio_verify_service" "service" {
  provider       = twilio.sub
  friendly_name  = local.name_prefix
  lookup_enabled = false
}

output "result" {
  value = twilio_verify_service.service.id
}

Signature: openpgp: key expired

Technical Details

  • Terraform Version: v0.12.26
  • Provider Version v0.23.0

Affected Resources

  • RJPearson94/twilio

Describe the bug

Hello there! We are facing a failing to install the provider running terraform-apply, looks like the openpgp is expired, how can we fix it?

Steps to Reproduce

Steps to reproduce the behavior:

Run terraform-apply

Expected behavior

Success on provider install

Logs

Initializing provider plugins...
- Reusing previous version of twilio/twilio from the dependency lock file
- Reusing previous version of rjpearson94/twilio from the dependency lock file
- Installing twilio/twilio v0.18.25...
- Installed twilio/twilio v0.18.25 (self-signed, key ID 2D8261056119B780)
- Installing rjpearson94/twilio v0.23.0...
╷
│ Error: Failed to install provider
│ 

│ Error while installing rjpearson94/twilio v0.23.0: error checking
│ signature: openpgp: key expired
╵

make: *** [Makefile:[114](https://github.com/twilio/tdp-foundational-demo/actions/runs/6431506450/job/17464549441#step:7:115): terraform-init] Error 1
Partner and community providers are signed by their developers.
If you'd like to know more about provider signing, you can read about it here:
https://www.terraform.io/docs/cli/plugins/signing.html
Error: Process completed with exit code 2.

Additional context

We are running it into a GitHub Actions pipeline

Autopilot ModelBuild is not being triggered when task is updated

Description

When an Autopilot Task is updated a new model build is not created.

Affected Resource(s)

  • twilio_autopilot_model_build

Affected Version(s)

  • Terraform: 0.12.26 & 0.13.2
  • Provider: 0.1.0 & 0.1.1

Terraform Configuration Files

resource "twilio_autopilot_assistant" "assistant" {
  friendly_name = "test"
}

resource "twilio_autopilot_task" "task" {
  assistant_sid = twilio_autopilot_assistant.assistant.sid
  unique_name   = "test"
}

resource "twilio_autopilot_task_sample" "task_sample" {
  assistant_sid = twilio_autopilot_task.task.assistant_sid
  task_sid      = twilio_autopilot_task.task.sid
  language      = "en-US"
  tagged_text   = "test"
}

resource "twilio_autopilot_model_build" "model_build" {
  assistant_sid = twilio_autopilot_assistant.assistant.sid
  unique_name   = "test"

  polling {
    enabled = true
  }

  depends_on = [
    twilio_autopilot_task_sample.task_sample
  ]
}

Expected Behavior

When an Autopilot task/ associated resources are updated then a new model build should be created

Actual Behavior

A new model build is not created

twilio_account_sub_account auth_token is empty

Technical Details

  • OS: Windows
  • Terraform Version: 1.2.2
  • Provider Version 0.17.0

Affected Resources

  • twilio_account_sub_account

Describe the bug

The auth_token output is always empty

Steps to Reproduce

Steps to reproduce the behaviour:

A quick way to test and see this is

resource "twilio_account_sub_account" "sub_account" {
  friendly_name = "test"
}

resource "local_file" "twilio" {
  filename = "twilio.json"
  content = jsonencode(twilio_account_sub_account.sub_account)
}

Domain base for twilio_serverless_service

Missing attribute for serverless service

Hi Rob, thanks for the provider!

I'm working on setting up Twilio infrastructure for our project using your provider. I need to create TwiML App with Voice URL pointing to Twilio Serverless Function. For this I need to know domainBase property for the service, which is used to construct URL for the function. I couldn't find this property in exported attributes for twilio_serverless_service.

Would it be possible to update that resource so the domainBase is exported?

Describe the solution you'd like

  • exported attribute domain_base so it can be used as an output
output "service_domain_base" {
  description = "The domain base of the Twilio service."
  value       = twilio_serverless_service.service.domain_base
}

Additional context

n/a

Add the ability to manage Studio Flow definition JSON via Terraform

Is your feature request related to a problem

No, not related to a problem.

Currently, you can manage a studio flow using the twilio_studio_flow resource, you can define the flow definition JSON inline or load it from an external file, the state transitions are predefined and interpolation can be used to substitute in certain values.

This approach is fine but if you need to conditionally include transitions e.g. in certain environments, you may not want to include a specific widget/ resources i.e. send to Autopilot. This would mean you would need to manage separate configuration for each permutation of the flow which would bring additional maintenance overhead.

The provider should support managing Studio flow definition and widgets as data sources as this would allow meta-arguments i.e. count, expressions, functions, etc. to be used to dynamically generate the definition JSON. This JSON can then be supplied as an input to the twilio_studio_flow resource.

Describe the solution you'd like

There would be a new data source for the Studio Flow definition and each Studio Flow widget.

The example below shows creating a studio flow with the trigger and send to flex widgets

## Studio Flow Definition 

data "twilio_studio_flow_widget_send_to_flex" "send_to_flex" {
  name = "SendMessageToAgent"

  workflow = var.workflow_sid
  channel  = var.channel_sid
  attributes = jsonencode({
    "name" : "{{trigger.message.ChannelAttributes.from}}",
    "channelType" : "{{trigger.message.ChannelAttributes.channel_type}}",
    "channelSid" : "{{trigger.message.ChannelSid}}"
  })

  offset {
    x = 200
    y = 240
  }
}

data "twilio_studio_flow_widget_trigger" "trigger" {
  name = "Trigger"

  transitions {
    incoming_message = data.twilio_studio_flow_widget_send_to_flex.send_to_flex.name
  }

  offset {
    x = 200
    y = 0
  }
}

data "twilio_studio_flow_definition" "definition" {
  description   = "Bot flow for creating a Flex webchat task"
  initial_state = data.twilio_studio_flow_widget_trigger.trigger.name

  flags {
    allow_concurrent_calls = true
  }

  state {
    json = data.twilio_studio_flow_widget_send_to_flex.send_to_flex.json
  }

  state {
    json = data.twilio_studio_flow_widget_trigger.trigger.json
  }
}

## Studio Flow 

resource "twilio_studio_flow" "flow" {
  friendly_name = "With widgets"
  status        = "draft"
  definition    = data.twilio_studio_flow_definition.definition.json
  validate      = true
}

## Variables

variable "workflow_sid" {
  description = "Task Router Workflow sid"
  type        = string
}

variable "channel_sid" {
  description = "Task Router Channel sid"
  type        = string
}

The example below shows the same studio flow above with the send to autopilot widget being conditionally included as the first transition in the definition JSON

## Studio Flow Definition 

locals {
  include_autopilot = var.autopilot_assistant_sid != null

  states = compact([
    data.twilio_studio_flow_widget_trigger.trigger.json,
    data.twilio_studio_flow_widget_send_to_flex.send_to_flex.json,
    join("", data.twilio_studio_flow_widget_send_to_autopilot.send_to_autopilot.*.json),
  ])

  message_transition = coalesce(
    join("", data.twilio_studio_flow_widget_send_to_autopilot.send_to_autopilot.*.name),
    data.twilio_studio_flow_widget_send_to_flex.send_to_flex.name
  )
}

data "twilio_studio_flow_widget_send_to_autopilot" "send_to_autopilot" {
  count = local.include_autopilot ? 1 : 0
  name  = "SendToAutopilot"

  offset {
    x = 200
    y = 240
  }

  transitions {
    failure = data.twilio_studio_flow_widget_send_to_flex.send_to_flex.name
    timeout = data.twilio_studio_flow_widget_send_to_flex.send_to_flex.name
  }

  autopilot_assistant_sid = var.autopilot_assistant_sid
  from                    = "{{flow.channel.address}}"
  body                    = "{{trigger.message.Body}}"
  timeout                 = 14400
}

data "twilio_studio_flow_widget_send_to_flex" "send_to_flex" {
  name = "SendMessageToAgent"

  workflow = var.workflow_sid
  channel  = var.channel_sid
  attributes = jsonencode({
    "name" : "{{trigger.message.ChannelAttributes.from}}",
    "channelType" : "{{trigger.message.ChannelAttributes.channel_type}}",
    "channelSid" : "{{trigger.message.ChannelSid}}"
  })

  offset {
    x = 270
    y = 540
  }
}

data "twilio_studio_flow_widget_trigger" "trigger" {
  name = "Trigger"

  transitions {
    incoming_message = local.message_transition
  }

  offset {
    x = 200
    y = 0
  }
}

data "twilio_studio_flow_definition" "definition" {
  description   = "Bot flow for creating a Flex webchat task"
  initial_state = data.twilio_studio_flow_widget_trigger.trigger.name

  flags {
    allow_concurrent_calls = true
  }

  dynamic "state" {
    for_each = local.states
    content {
      json = state.value
    }
  }
}

## Studio Flow 

resource "twilio_studio_flow" "flow" {
  friendly_name = "Conditional Widgets"
  status        = "draft"
  definition    = data.twilio_studio_flow_definition.definition.json
  validate      = true
}

## Variables

variable "workflow_sid" {
  description = "Task Router Workflow sid"
  type        = string
}

variable "channel_sid" {
  description = "Task Router Channel sid"
  type        = string
}

variable "autopilot_assistant_sid" {
  description = "autopilot assistant sid"
  type        = string
  default     = null
}

The solution should not enforce the use of the widget data sources i.e. if a user wants to specify the widget definition inline or in external files then this should be supported too.

Importing a Twilio phone number's assignment in a messaging service doesn't populate its phone_number_sid field

Technical Details

  • OS: MacOS
  • Terraform Version: 1.4
  • Provider Version v0.18.18

Affected Resources

  • twilio_messaging_services_phone_numbers_v1

Describe the bug

If you import a Twilio messaging service phone number, the terraform state will always set that number's phone_number_sid to null.

Steps to Reproduce

Steps to reproduce the behaviour:

  1. Create a Twilio messaging service, phone number, and add the number to the service.
  2. Import all 3 from above
  3. Locate twilio_messaging_services_phone_numbers_v1 resource in the terraform state
  4. Notice that its phone_number_sid is set to null

Expected behaviour

The provider should populate the phone_number_sid based on what is returned by the Twilio API

Logs

N/A

Additional context

I believe this block should simply include a line for the phone_number_sid field.

twilio_conversations_push_credential_apn fails to unmarshal the string response for Sandbox from twilio API

Technical Details

  • OS: Linux_AMD64
  • Terraform Version: 0.12.30
  • Provider Version 0.20.0

Affected Resources

  • twilio_conversations_push_credential_apn

Describe the bug

Looks like the twilio API responds with a string "True" or "False" for the Sandbox value, which is mismatched with the expected bool in the sdk you've written for this provider. This results in the following error.

Failed to create conversations credential: json: cannot unmarshal string into Go struct field CreateCredentialResponse.sandbox of type bool

Steps to Reproduce

Steps to reproduce the behaviour:

  1. Create resource

Expected behaviour

Resource created and able to proceed with other resource creation

Logs

Failed to create conversations credential: json: cannot unmarshal string into Go struct field CreateCredentialResponse.sandbox of type bool

Twiml Apps

Is your feature request related to a problem

It's not clear whether it's possible to create a Twiml App

Describe the solution you'd like

A way to make a Twiml App

resource "twilio_twiml_app" "resource_name" {
  friendly_name = ""
  voice {
    request_url = ""
    fallback_url = ""
    status_callback_url = ""
    caller_name_lookup = "disabled|enabled"
  }

  messaging {
    request_url = ""
    fallback_url = ""
    status_callback_url = ""
  }
}

Additional context

The Twiml Apps appear under the Phone Number and Voice sections. It's unclear where the ownership lies.

Error: Failed to create serverless environment

Technical Details

  • OS: MacOs
  • Terraform Version: 1.3.7
  • Provider Version: 0.23.0

Affected Resources

  • twilio_serverless_environment

Describe the bug

I created a service, a set of functions & assets and a build successfully using this module.
When I try to create an environment and deployment for the build, it fails with the following error.

Error: Failed to create serverless environment: Environment with this UniqueName or DomainSuffix already exists.

I've tried a bunch of different names and it's still the same error.
I've also commented out the deployment resource and narrowed it down to the twilio_serverless_environment resource

Expected behaviour

the environment would get created

panic: interface conversion: interface {} is []interface {}, not string

Technical Details

  • MacOS
  • Terraform Version: 0.14.4
  • Provider Version 0.2.1

Affected Resources

  • twilio_phone_number

Describe the bug

Running terraform apply using the twilio_phone_number resource is giving me an error:

panic: interface conversion: interface {} is []interface {}, not string

I'm fairly new to Terraform, but this seems like a Go type error from this func: https://github.com/RJPearson94/terraform-provider-twilio/blob/main/twilio/internal/services/phone_number/resource_phone_number.go#L306

Maybe this is user-error? Thanks for looking at this issue.

A clear and concise description of what the bug is. Feel free to include Terraform configuration, logs, etc.

Steps to Reproduce

Here's what my main.tf looks like:

terraform {
  required_providers {
    twilio = {
      source  = "RJPearson94/twilio"
      version = ">= 0.2.1"
    }
  }
}

provider "twilio" {
  account_sid = "ACXXX"
  auth_token  = "12345"
}

resource "twilio_phone_number" "phone_number" {
  account_sid  = "ACXXX"
  phone_number = "+14153631234"

  voice {
    url = "https://twilio.com"
  }

}

Steps to reproduce the behaviour:

  1. Step 1
    Run terraform apply

Expected behaviour

Purchase a Twilio number?

Logs

panic: interface conversion: interface {} is []interface {}, not string
2021-01-21T15:40:17.141-0800 [DEBUG] plugin.terraform-provider-twilio_v0.6.1:
2021-01-21T15:40:17.141-0800 [DEBUG] plugin.terraform-provider-twilio_v0.6.1: goroutine 53 [running]:
2021-01-21T15:40:17.141-0800 [DEBUG] plugin.terraform-provider-twilio_v0.6.1: github.com/RJPearson94/terraform-provider-twilio/twilio/internal/services/phone_number.resourcePhoneNumberCreate(0x231bfc0, 0xc00060e540, 0xc00065a280, 0x1d8e6a0, 0xc0000de460, 0xc00060dde0, 0x12d3e8a, 0xc00011d420)
2021-01-21T15:40:17.141-0800 [DEBUG] plugin.terraform-provider-twilio_v0.6.1: 	github.com/RJPearson94/terraform-provider-twilio/twilio/internal/services/phone_number/resource_phone_number.go:337 +0x1bd0
2021-01-21T15:40:17.141-0800 [DEBUG] plugin.terraform-provider-twilio_v0.6.1: github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*Resource).create(0xc000475ef0, 0x231bf40, 0xc00060a140, 0xc00065a280, 0x1d8e6a0, 0xc0000de460, 0x0, 0x0, 0x0)
2021-01-21T15:40:17.141-0800 [DEBUG] plugin.terraform-provider-twilio_v0.6.1: 	github.com/hashicorp/terraform-plugin-sdk/[email protected]/helper/schema/resource.go:275 +0x1ec
2021-01-21T15:40:17.141-0800 [DEBUG] plugin.terraform-provider-twilio_v0.6.1: github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*Resource).Apply(0xc000475ef0, 0x231bf40, 0xc00060a140, 0xc00062a150, 0xc00011d420, 0x1d8e6a0, 0xc0000de460, 0x0, 0x0, 0x0, ...)
2021-01-21T15:40:17.141-0800 [DEBUG] plugin.terraform-provider-twilio_v0.6.1: 	github.com/hashicorp/terraform-plugin-sdk/[email protected]/helper/schema/resource.go:386 +0x681
2021-01-21T15:40:17.141-0800 [DEBUG] plugin.terraform-provider-twilio_v0.6.1: github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*GRPCProviderServer).ApplyResourceChange(0xc000302560, 0x231bf40, 0xc00060a140, 0xc00061c0a0, 0xc00060a140, 0xc00060e100, 0x232d6c0)
2021-01-21T15:40:17.141-0800 [DEBUG] plugin.terraform-provider-twilio_v0.6.1: 	github.com/hashicorp/terraform-plugin-sdk/[email protected]/helper/schema/grpc_provider.go:951 +0x8b2
2021-01-21T15:40:17.141-0800 [DEBUG] plugin.terraform-provider-twilio_v0.6.1: github.com/hashicorp/terraform-plugin-go/tfprotov5/server.(*server).ApplyResourceChange(0xc000244b20, 0x231bf40, 0xc00060a140, 0xc00062a000, 0xc000244b20, 0xc000618180, 0xc000616ba0)
2021-01-21T15:40:17.141-0800 [DEBUG] plugin.terraform-provider-twilio_v0.6.1: 	github.com/hashicorp/[email protected]/tfprotov5/server/server.go:331 +0xac
2021-01-21T15:40:17.141-0800 [DEBUG] plugin.terraform-provider-twilio_v0.6.1: github.com/hashicorp/terraform-plugin-go/tfprotov5/internal/tfplugin5._Provider_ApplyResourceChange_Handler(0x1fe9a00, 0xc000244b20, 0x231c000, 0xc000618180, 0xc00060e120, 0x0, 0x231c000, 0xc000618180, 0xc000628500, 0x487)
2021-01-21T15:40:17.141-0800 [DEBUG] plugin.terraform-provider-twilio_v0.6.1: 	github.com/hashicorp/[email protected]/tfprotov5/internal/tfplugin5/tfplugin5_grpc.pb.go:380 +0x217
2021-01-21T15:40:17.142-0800 [DEBUG] plugin.terraform-provider-twilio_v0.6.1: google.golang.org/grpc.(*Server).processUnaryRPC(0xc0005d6380, 0x2329a00, 0xc00018d980, 0xc000624000, 0xc0005b2d80, 0x2c5dce0, 0x0, 0x0, 0x0)
2021-01-21T15:40:17.142-0800 [DEBUG] plugin.terraform-provider-twilio_v0.6.1: 	google.golang.org/[email protected]/server.go:1194 +0x50a
2021-01-21T15:40:17.142-0800 [DEBUG] plugin.terraform-provider-twilio_v0.6.1: google.golang.org/grpc.(*Server).handleStream(0xc0005d6380, 0x2329a00, 0xc00018d980, 0xc000624000, 0x0)
2021-01-21T15:40:17.142-0800 [DEBUG] plugin.terraform-provider-twilio_v0.6.1: 	google.golang.org/[email protected]/server.go:1517 +0xcfd
2021-01-21T15:40:17.142-0800 [DEBUG] plugin.terraform-provider-twilio_v0.6.1: google.golang.org/grpc.(*Server).serveStreams.func1.2(0xc00030b0b0, 0xc0005d6380, 0x2329a00, 0xc00018d980, 0xc000624000)
2021-01-21T15:40:17.142-0800 [DEBUG] plugin.terraform-provider-twilio_v0.6.1: 	google.golang.org/[email protected]/server.go:859 +0xa1
2021-01-21T15:40:17.142-0800 [DEBUG] plugin.terraform-provider-twilio_v0.6.1: created by google.golang.org/grpc.(*Server).serveStreams.func1
2021-01-21T15:40:17.142-0800 [DEBUG] plugin.terraform-provider-twilio_v0.6.1: 	google.golang.org/[email protected]/server.go:857 +0x204
2021-01-21T15:40:17.144-0800 [WARN]  plugin.stdio: received EOF, stopping recv loop: err="rpc error: code = Unavailable desc = transport is closing"
2021-01-21T15:40:17.144-0800 [DEBUG] plugin: plugin process exited: path=.terraform/providers/registry.terraform.io/rjpearson94/twilio/0.6.1/darwin_amd64/terraform-provider-twilio_v0.6.1 pid=17726 error="exit status 2"
2021/01/21 15:40:17 [DEBUG] twilio_studio_flow.flow: apply errored, but we're indicating that via the Error pointer rather than returning it: rpc error: code = Unavailable desc = transport is closing
2021/01/21 15:40:17 [TRACE] EvalWriteState: writing current state object for twilio_studio_flow.flow
2021/01/21 15:40:17 [DEBUG] twilio_phone_number.phone_number: apply errored, but we're indicating that via the Error pointer rather than returning it: rpc error: code = Unavailable desc = transport is closing
2021/01/21 15:40:17 [TRACE] EvalMaybeTainted: twilio_phone_number.phone_number encountered an error during creation, so it is now marked as tainted
2021/01/21 15:40:17 [TRACE] EvalWriteState: removing state object for twilio_phone_number.phone_number
2021/01/21 15:40:17 [TRACE] EvalApplyProvisioners: twilio_phone_number.phone_number has no state, so skipping provisioners
2021/01/21 15:40:17 [TRACE] EvalMaybeTainted: twilio_phone_number.phone_number encountered an error during creation, so it is now marked as tainted
2021/01/21 15:40:17 [TRACE] EvalWriteState: removing state object for twilio_phone_number.phone_number
2021/01/21 15:40:17 [TRACE] vertex "twilio_phone_number.phone_number": visit complete
2021/01/21 15:40:17 [TRACE] vertex "twilio_studio_flow.flow (destroy)": visit complete
2021/01/21 15:40:17 [TRACE] dag/walk: upstream of "twilio_taskrouter_workflow.did_workflow (destroy)" errored, so skipping
2021/01/21 15:40:17 [TRACE] dag/walk: upstream of "meta.count-boundary (EachMode fixup)" errored, so skipping
2021/01/21 15:40:17 [TRACE] dag/walk: upstream of "provider[\"registry.terraform.io/rjpearson94/twilio\"] (close)" errored, so skipping
2021/01/21 15:40:17 [TRACE] dag/walk: upstream of "root" errored, so skipping
2021/01/21 15:40:17 [TRACE] statemgr.Filesystem: creating backup snapshot at terraform.tfstate.backup
2021/01/21 15:40:17 [TRACE] statemgr.Filesystem: state has changed since last snapshot, so incrementing serial to 7
2021/01/21 15:40:17 [TRACE] statemgr.Filesystem: writing snapshot at terraform.tfstate
2021/01/21 15:40:17 [TRACE] statemgr.Filesystem: removing lock metadata file .terraform.tfstate.lock.info
2021/01/21 15:40:17 [TRACE] statemgr.Filesystem: unlocking terraform.tfstate using fcntl flock
2021-01-21T15:40:17.177-0800 [DEBUG] plugin: plugin exited

cannot use account_sid and auth_token in provider configuration

Technical Details

  • OS: macosx
  • Terraform Version: 0.14.6
  • Provider Version 0.7.1

Affected Resources

https://github.com/RJPearson94/terraform-provider-twilio/blob/main/docs/index.md#account-sid--auth-token

Describe the bug

Defining account_sid and auth_token in the twilio provider block does not work:

provider "twilio" {
  account_sid = data.vault_generic_secret.twilio_dev.data["account_sid"]
  auth_token  = data.vault_generic_secret.twilio_dev.data["auth_token"]
}

or

provider "twilio" {
  account_sid = "xxx"
  auth_token  = "yyy"
}

both do not work.

Acquiring state lock. This may take a few moments...
Error: Account Details Specified are invalid

If I use the same credentials but with

TWILIO_ACCOUNT_SID="" TWILIO_AUTH_TOKEN="" terraform plan

I can authenticate and create resources

Steps to Reproduce

Steps to reproduce the behaviour:

  1. define credentials in twilio provider block
  2. terraform plan
  3. See error

Expected behaviour

terraform should be able to use these credentials and successfully continue without error

Logs

trawled the logs, nothing of use.

Additional context

Add any other context about the problem here.

Twilio API returns serverless function and asset versions in a random order causes incorrect drifts to be detected

Technical Details

  • OS: MacOS
  • Terraform Version: 0.15.0
  • Provider Version 0.9.0

Affected Resources

  • twilio_serverless_build

Describe the bug

When creating a serverless build with multiple function or asset versions that were created simultaneously, the Twilio API can return these in any order. As the order may not match the order the asset or function versions were supplied Terraform will detect this as a drift and the build is re-created on the next deployment.

This causes inconsistent behaviour in the resource as drift may or may not be detected

Expected behaviour

The resource should not detect a drift when the API returns the details in a random order

Adding functions to phone numbers

Is your feature request related to a problem

I am not sure if this is already implemented, but under phone numbers I want to be able to define my twilio_serverless_function like so:

image

thanks

Verify Message Template Not Applying

When specifying a default_template_sid for the twilio_verify_service resource, the Terraform apply is successful but inside Twilio it never actually gets set, and when re-running Terraform apply it lists the default_template_sid as a configuration change again.

For more context I am trying to apply the HJ1552d2ed1b7588baf459dee4acaa0b2b template (Static Verify Templates Brandful)

Build is not being correctly un-deployed on destruction of a deployment

Technical Details

  • OS: MacOS
  • Terraform Version: 0.14.7
  • Provider Version v0.8.1

Affected Resources

  • twilio_serverless_deployment
  • twilio_serverless_build
  • twilio_serverless_environment

Describe the bug

When destroying a deployment resource. The build_sid is not being superseded correctly, this causes the following error Failed to delete serverless build: Cannot delete Build because it's part of an active Deployment. to be thrown when attempting to destroy a build.

This error occurs when you destroy a deployment and build but leave other resources i.e. service, environment, etc. behind
Occasionally this error also occurs when running a terraform destroy on all deployed resources, this is intermittent because depending on the order in which Terraform deletes the resources i.e. if the environment is destroyed before the build then no active deployment exists so the build can be deleted. Whereas if the build is destroyed before the environment (which can happen when a number of environment variables are attached to an environment) then the error above will be thrown

Steps to Reproduce

Steps to reproduce the behaviour:

  1. Deploy the Serverless Deployment example
  2. Remove the deployment and build from the main.tf (the build and deployment outputs also need to be removed)
  3. Run an apply
  4. The error should be shown

Expected behaviour

The build_sid of the active deployment should be set to null, this can be seen by checking the environment should have the build_sid set to null. The build should be successfully deleted once the deployment has been deleted/ superseded.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.