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

Patching firewall rules with place_before #223

Closed
iliakonnov opened this issue May 30, 2023 · 3 comments · Fixed by #224
Closed

Patching firewall rules with place_before #223

iliakonnov opened this issue May 30, 2023 · 3 comments · Fixed by #224
Assignees
Labels
bug Something isn't working released

Comments

@iliakonnov
Copy link

iliakonnov commented May 30, 2023

Describe the bug
When running terraform apply

Terraform used the selected providers to generate the following execution plan. Resource actions are indicated with the following symbols:
  ~ update in-place

Terraform will perform the following actions:

  # routeros_firewall_filter.allow-internal-routing[0] will be updated in-place
  ~ resource "routeros_firewall_filter" "allow-internal-routing" {
      ~ action               = "reject" -> "accept"
        id                   = "*32"
        # (12 unchanged attributes hidden)
    }

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

routeros_firewall_filter.allow-internal-routing[0]: Modifying... [id=*32]
╷
│ Error: PATCH 'https://127.0.0.1:8443/rest/ip/firewall/filter/*32' returned response code: 400, message: 'Bad Request', details: 'unknown parameter place-before'
│
│   with routeros_firewall_filter.allow-internal-routing[0],
│   on firewall-filter-forward.tf line 23, in resource "routeros_firewall_filter" "allow-internal-routing":
│   23: resource "routeros_firewall_filter" "allow-internal-routing" {
│
╵

To Reproduce
Before:

resource "routeros_firewall_filter" "allow-internal-routing" {
  action       = "reject"  # <-
  chain        = "forward"
  src_address  = "172.24.1.0/24"
  dst_address  = "172.24.1.0/24"
  place_before = routeros_firewall_filter.reject-internal-routing.id
}
resource "routeros_firewall_filter" "reject-internal-routing" {
  action       = "drop"
  chain        = "forward"
}

After:

resource "routeros_firewall_filter" "allow-internal-routing" {
  action       = "accept"  # <- changed to accept
  chain        = "forward"
  src_address  = "172.24.1.0/24"
  dst_address  = "172.24.1.0/24"
  place_before = routeros_firewall_filter.reject-internal-routing.id
}
resource "routeros_firewall_filter" "reject-internal-routing" {
  action       = "drop"
  chain        = "forward"
}

Expected behavior
New configuration applied successfully.

@iliakonnov iliakonnov added the bug Something isn't working label May 30, 2023
@iliakonnov iliakonnov changed the title Patching firewall rules Patching firewall rules with place_before May 30, 2023
@vaerh vaerh self-assigned this May 30, 2023
vaerh added a commit that referenced this issue May 30, 2023
vaerh added a commit that referenced this issue May 30, 2023
@vaerh
Copy link
Collaborator

vaerh commented May 30, 2023

Please test the release on your dataset and give me feedback.

@vaerh
Copy link
Collaborator

vaerh commented May 30, 2023

🎉 This issue has been resolved in version 1.10.4 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

@vaerh vaerh added the released label May 30, 2023
@iliakonnov
Copy link
Author

Everything looks great now!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working released
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants