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

azurerm_firewall_policy_rule_collection_group destination_ports argument does not support "*" or "1-65535" #9304

Closed
ghost opened this issue Nov 12, 2020 · 3 comments · Fixed by #9490

Comments

@ghost
Copy link

ghost commented Nov 12, 2020

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
  • Please do not leave "+1" or "me too" comments, they generate extra noise for issue followers and do not help prioritize the request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment

Terraform (and AzureRM Provider) Version

terraform 0.13.5
azurerm 2.35.0

Affected Resource(s)

  • azurerm_firewall_policy_rule_collection_group

Terraform Configuration Files

resource "azurerm_firewall_policy_rule_collection_group" "defaultgrouprules" {
  name               = "DefaultNetworkRuleCollectionGroup"
  firewall_policy_id = azurerm_firewall_policy.pol01.id
  priority           = 200

 network_rule_collection {
    name     = "CollectionforTesting"
    priority = 1000
    action   = "Allow"
    rule {
      name                  = "AllowAll"
      protocols             = ["Any","ICMP","TCP","UDP"]
      source_addresses      = ["*"]
      destination_addresses = ["*"]
      destination_ports     = ["*"]
    }
  }
 network_rule_collection {
    name     = "DenyTest"
    priority = 101
    action   = "Deny"
    rule {
      name                  = "DenyTest"
      protocols             = ["ICMP"]
      source_addresses      = ["161.211.222.59"]
      destination_addresses = ["10.187.9.4"]
      destination_ports     = ["*"]
    }
  }
}

Debug Output

Panic Output

Expected Behaviour

Either skip existing rules or apply new rules as specified in the configuration file.

Actual Behaviour

An error results when using "*" as a destination_ports argument. An asterisk is a valid destination_port argument when using the Azure Portal. We have existing rules already configured via the Azure portal using asterisks for destination_ports.

Error: invalid format of "network_rule_collection.3.rule.0.destination_ports.0"
on main.tf line 37, in resource "azurerm_firewall_policy_rule_collection_group" "defaultgrouprules":
37: resource "azurerm_firewall_policy_rule_collection_group" "defaultgrouprules" {

or attempting to use "1-65535" port range instead

Error: port 65535 is out of range (0-64000)
on main.tf line 37, in resource "azurerm_firewall_policy_rule_collection_group" "defaultgrouprules":
37: resource "azurerm_firewall_policy_rule_collection_group" "defaultgrouprules" {

Steps to Reproduce

  1. Run terraform apply using configuration above with "*" as an argument for destination_ports

Important Factoids

References

  • #0000
@neil-yechenwei
Copy link
Contributor

neil-yechenwei commented Nov 26, 2020

Thanks for opening this issue. Hopes the fix would be helpful.

@daruskorz
Copy link

Hello, do you have any eta about fix release ?

katbyte pushed a commit that referenced this issue Jan 4, 2021
…rm_firewall_policy_rule_collection_group (#9490)

fixes #9304

--- PASS: TestAccAzureRMFirewallPolicyRuleCollectionGroup_requiresImport (153.90s)
--- PASS: TestAccAzureRMFirewallPolicyRuleCollectionGroup_basic (194.10s)
--- PASS: TestAccAzureRMFirewallPolicyRuleCollectionGroup_complete (202.27s)
--- PASS: TestAccAzureRMFirewallPolicyRuleCollectionGroup_update (269.51s)
@ghost
Copy link

ghost commented Feb 3, 2021

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.

If you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. If you feel I made an error 🤖 🙉 , please reach out to my human friends 👉 hashibot-feedback@hashicorp.com. Thanks!

@ghost ghost locked as resolved and limited conversation to collaborators Feb 3, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
3 participants