hashicorp / terraform

Terraform enables you to safely and predictably create, change, and improve infrastructure. It is a source-available tool that codifies APIs into declarative configuration files that can be shared amongst team members, treated as code, edited, reviewed, and versioned.

Home Page:https://www.terraform.io/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Case sensitivity issue for azure resources

hboneta opened this issue · comments

Terraform Version

Terraform v1.8.5
on windows_amd64
+ provider registry.terraform.io/hashicorp/azurerm v3.106.1

Terraform Configuration Files

resource "azurerm_network_security_rule" "GS-251" {
  access                      = "Allow"
  destination_address_prefix  = "*"
  destination_port_range      = "22"
  direction                   = "Inbound"
  name                        = "SSH"
  network_security_group_name = "***********"
  priority                    = 300
  protocol                    = "TCP"
  resource_group_name         = "********"
  source_address_prefixes     = [*************]
  source_port_range           = "*************"

Debug Output

Error: expected protocol to be one of ["*" "Tcp" "Udp" "Icmp" "Ah" "Esp"], got TCP

│ with azurerm_network_security_rule.GS-255,
│ on main.aztfexport.tf line 2083, in resource "azurerm_network_security_rule" "GS-255":
│ 2083: protocol = "TCP"

Expected Behavior

Should accept the UPPER value for the protocol field as it is the one azure applies when configuring/provisioning through portal or other means.

Actual Behavior

See Debug Output requiring the value to be changed to Caps ("Tcp") instead of UPPER ("TCP"). If the tf code is changed to Caps to overcome the error, terraform apply would show up as an actual change to the azure resource (security rule) at apply time. Said change is transparent to functionality, but introduces significant inconvenience in the form of Change Requests and additional testing before applying vs. getting the "No changes. Your infrastructure matches the configuration." message.

Steps to Reproduce

terraform plan

Additional Context

No response

References

No response

Hello,

This appears to be an issue or question with the AzureRM provider, not with Terraform itself. You can see existing issues and file a new one in their repository here: https://github.com/terraform-providers/terraform-provider-azurerm/issues. If you have questions about Terraform or the AzureRM provider, it's better to use the community forum where there are more people ready to help. The GitHub issues here are monitored only by a few core maintainers.

Thanks!

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 have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.