bpg / terraform-provider-proxmox

Terraform Provider for Proxmox
https://registry.terraform.io/providers/bpg/proxmox
Mozilla Public License 2.0
770 stars 125 forks source link

Creating a Security Group with Capital Letters in the Name Fails #769

Open g1t-out opened 9 months ago

g1t-out commented 9 months ago

Describe the bug Using capital letters in the proxmox_virtual_environment_cluster_firewall_security_group causes the security group to be created with the lowercase version of this name. Any subsequent rules are never added to the security group and it can no longer be managed.

To Reproduce Using the terraform below, when running a create, I'll get two errors (One for each rule) that say:

Error: error creating firewall rule: received an HTTP 500 response - Reason: no such security group 'MyTestFilter'

Please also provide a minimal Terraform configuration that reproduces the issue.

resource "proxmox_virtual_environment_cluster_firewall_security_group" "testgroup" {
  name    = "MyTestFilter"
  comment = "Managed by Terraform"
  rule {
    type    = "out"
    action  = "ACCEPT"
    comment = "ALLOW DNS"
    dest    = "10.1.5.1"
    macro   = "DNS"
    log     = "nolog"
  }

  rule {
    type    = "out"
    action  = "DROP"
    comment = "Drop traffic"
    dest    = "8.8.8.8"
    log     = "info"
  }
}

Expected behavior Security Group is created and firewall rules are added.

Screenshots If applicable, add screenshots to help explain your problem. Proxmox_TF_Bug

Additional context Add any other context about the problem here.

bpg commented 9 months ago

Thanks for reporting, @g1t-out!

Lower-casing the group name seems to be a PVE feature, a group created from PVE UI gets lower-cased as well.

We can probably normalize the name when reading the template and store it in lower case as well.

bpg-autobot[bot] commented 1 week ago

Marking this issue as stale due to inactivity in the past 180 days. This helps us focus on the active issues. If this issue is reproducible with the latest version of the provider, please comment. If this issue receives no comments in the next 30 days it will automatically be closed. If this issue was automatically closed and you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. Thank you!