cisco-open / terraform-provider-meraki

A Terraform Provider for Cisco Meraki
Mozilla Public License 2.0
17 stars 7 forks source link

Rules in meraki_networks_appliance_firewall_l3_firewall_rules doesn't preserve order #143

Closed yujiterada closed 1 month ago

yujiterada commented 3 months ago

Prerequisites

Describe the bug Rules in meraki_networks_appliance_firewall_l3_firewall_rules doesn't preserve order. For example, "Allow all other traffic rule" can become rule 1 and "Deny HTTPS to internal network" can become rule 2.

resource "meraki_networks_appliance_firewall_l3_firewall_rules" "l3_firewall_rules" {
  network_id = "L_669347494617955075"
  rules = [
    {
      comment        = "Deny HTTPS to internal network"
      dest_cidr      = "192.168.1.0/24"
      dest_port      = "443"
      policy         = "deny"
      protocol       = "tcp"
      src_cidr       = "any"
      src_port       = "any"
      syslog_enabled = false
    },
    {
      comment        = "Allow all other traffic"
      dest_cidr      = "any"
      dest_port      = "any"
      policy         = "allow"
      protocol       = "any"
      src_cidr       = "any"
      src_port       = "any"
      syslog_enabled = false
  }]
}

Expected behavior Order inside rules needs to be preserved.

Screenshots image

Debug A set is being used rather than list in terraform-provider-meraki/internal/provider/resource_meraki_networks_appliance_firewall_l3_firewall_rules.go.

Environment (please complete the following information):

Additional context