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

[Bug]: Removing firewall_ids section from resource description of server does NOT remove the firewall from the server #1061

Closed
mkarg opened this issue Dec 17, 2024 · 1 comment
Labels

Comments

@mkarg
Copy link

mkarg commented Dec 17, 2024

What happened?

I have removed the section firewall_ids from resource "hcloud_server", then executed tofu plan to see the resulting action. Strange but true, tofu told me that it won't change anything, while hcloud firewall list told me that the firewall is assigned to that hcloud server.

What did you expect to happen?

I expected that tofu plan tells me it will remove the firewall from the hcloud server.

Please provide a minimal working example

terraform {
  required_providers {
    hcloud = {
      source  = "hetznercloud/hcloud"
      version = "1.49.1"
    }
  }
}

variable "hetzner_token" {
  type = string
}

provider "hcloud" {
  token = var.hetzner_token
}

resource "hcloud_firewall" "f" {
  name = "f"

  rule {
    direction  = "in"
    protocol   = "icmp"
    source_ips = [
      "0.0.0.0/0",
      "::/0"
    ]
  }
}

resource "hcloud_server" "s" {
  name         = "s"
  image        = "debian-12"
  server_type  = "cax11"
  datacenter   = "fsn1-dc14"
  firewall_ids = [
    hcloud_firewall.f.id
  ]
}
@mkarg mkarg added the bug label Dec 17, 2024
@jooola
Copy link
Member

jooola commented Dec 20, 2024

Closing this ticket as it is a duplicate of #998

@jooola jooola closed this as completed Dec 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants