question

OrdonezMiguel-7783 avatar image
0 Votes"
OrdonezMiguel-7783 asked ChaitanyaNaykodiMSFT-9638 answered

Why I got this error

I have a code in terraform that add a network security rule deny all in azure, in the variable destination_port_ranges the documentations said:
https://registry.terraform.io/providers/hashicorp/azurestack/latest/docs/resources/network_security_group

put "*" when you are going to select all ports, but when I run the plan I don't know why still got the error

on ../../../common-modules/NetworkSecurityRuleDenyInboundTcpVNet/main.tf line 10, in resource "azurerm_network_security_rule" "rule":
10: destination_port_ranges = "*"

Inappropriate value for attribute "destination_port_ranges": set of string
required.

azure-virtual-network
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

1 Answer

ChaitanyaNaykodiMSFT-9638 avatar image
0 Votes"
ChaitanyaNaykodiMSFT-9638 answered

Hello @OrdonezMiguel-7783, Thank you for reaching out! After a quick glance at the Terraform documentation. Is there any reason you are using destination_port_ranges attribute instead of destination_port_range ? I think destination_port_range supports "*" to match any. Please refer to the image below. Thank you!
128787-image.png



image.png (37.2 KiB)
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.