Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IP Access Control Lists do not support /0 "wildcard" CIDRs #137

Open
WestonReed opened this issue Apr 11, 2024 · 0 comments
Open

IP Access Control Lists do not support /0 "wildcard" CIDRs #137

WestonReed opened this issue Apr 11, 2024 · 0 comments

Comments

@WestonReed
Copy link

WestonReed commented Apr 11, 2024

Issue Summary

This may be more of an issue with the Twilio API than the Terraform provider directly, but if so, the provider does not correctly handle cidr_prefix_length = 0 during plans. The API appears to overwrite this with a /32, which then leads to drift on every run.

Steps to Reproduce

  1. Use the below code snippet to create a couple of resources in the Twilio console.
  2. The apply will run successfully, but the Twilio console will show that the below access control list was created as 0.0.0.0/32; not the expected 0.0.0.0/0.
  3. Subsequent plans now show that cidr_prefix_length drifts, and Terraform is never able to correct this.

Code Snippet

resource "twilio_api_accounts_sip_ip_access_control_lists" "twilio_acl" {
  friendly_name    = "All (0.0.0.0/0)"
}

resource "twilio_api_accounts_sip_ip_access_control_lists_ip_addresses" "twilio_acl_all" {
  ip_access_control_list_sid = twilio_api_accounts_sip_ip_access_control_lists.twilio_acl.sid
  friendly_name              = "All (0.0.0.0/0)"
  ip_address                 = "0.0.0.0"
  cidr_prefix_length         = 0
}

Technical details:

  • terraform-provider-twilio version: 0.18.43
  • terraform version: 1.3.9

Workaround

As a workaround, creating two access control lists with prefixes of 0.0.0.0/1 and 128.0.0.0/1 respectively works, however this is confusing.

Expected Behavior

Either:
A. The API should support wildcards (0.0.0.0/0) and thus the above code works as expected (preferred)
B. The Terraform provider should fail validation on the above code because the API does not support /0s and the API should return a 4XX to indicate that it isn't supported.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant