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

Case sensitive bug with "azurerm_firewall" firewall_policy_id #23990

Closed
1 task done
joakimlemb opened this issue Nov 22, 2023 · 1 comment · Fixed by #23993
Closed
1 task done

Case sensitive bug with "azurerm_firewall" firewall_policy_id #23990

joakimlemb opened this issue Nov 22, 2023 · 1 comment · Fixed by #23993
Labels
service/firewall upstream/microsoft Indicates that there's an upstream issue blocking this issue/PR v/3.x
Milestone

Comments

@joakimlemb
Copy link

joakimlemb commented Nov 22, 2023

Is there an existing issue for this?

  • I have searched the existing issues

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 and review the contribution guide to help.

Terraform Version

v1.4.2

AzureRM Provider Version

3.81.0

Affected Resource(s)/Data Source(s)

azurerm_firewall

Terraform Configuration Files

resource "azurerm_firewall" "firewall" {
  name                = "${local.prefix-hub}-afw"
  location            = local.location
  resource_group_name = local.rgname
  sku_name            = "AZFW_VNet"
  sku_tier            = "Standard"
  threat_intel_mode   = "Alert"

  firewall_policy_id = azurerm_firewall_policy.policy1.id

  ...

}

Debug Output/Panic Output

# azurerm_firewall.firewall will be updated in-place
  ~ resource "azurerm_firewall" "firewall" {
      ~ firewall_policy_id  = "/subscriptions/REDACTED/resourcegroups/REDACTED/providers/Microsoft.Network/firewallPolicies/policy1" -> "/subscriptions/REDACTED/resourceGroups/REDACTED/providers/Microsoft.Network/firewallPolicies/policy1"
        id                  = "/subscriptions/REDACTED/resourceGroups/REDACTED/providers/Microsoft.Network/azureFirewalls/REDACTED"
		....
    }

Plan: 0 to add, 1 to change, 0 to destroy.

Expected Behaviour

Nothing, it should match existing infrastructure if it followed Microsofts documentation regarding Azure resource id's: https://learn.microsoft.com/en-us/azure/azure-resource-manager/management/resource-name-rules
"Always perform a case-insensitive comparison of names."

Actual Behaviour

Case mismatch with "resourcegroups" vs "resourceGroups" for firewall_policy_id.

Steps to Reproduce

No response

Important Factoids

No response

References

From Microsoft documentation:
Resource and resource group names are case-insensitive unless specifically noted in the valid characters column.

When using various APIs to retrieve the name for a resource or resource group, the returned value may have different casing than what you originally specified for the name. The returned value may even display different case values than what is listed in the valid characters table.

Always perform a case-insensitive comparison of names.
ref: https://learn.microsoft.com/en-us/azure/azure-resource-manager/management/resource-name-rules

Similar issue:
#17090

@tombuildsstuff tombuildsstuff added the upstream/microsoft Indicates that there's an upstream issue blocking this issue/PR label Nov 22, 2023
@github-actions github-actions bot added this to the v3.82.0 milestone Nov 23, 2023
osfidelity pushed a commit to fidelity-contributions/hashicorp-terraform-provider-azurerm-archive that referenced this issue Nov 23, 2023
The Azure API incorrectly returns `resourcegroups` whereas the API Spec defines `resourceGroups`

Fixes hashicorp#23990
Copy link

github-actions bot commented May 1, 2024

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.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 1, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
service/firewall upstream/microsoft Indicates that there's an upstream issue blocking this issue/PR v/3.x
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants