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] - Instance is never unlinked from firewall_group #544

Open
insoIite opened this issue Jan 16, 2025 · 0 comments
Open

[BUG] - Instance is never unlinked from firewall_group #544

insoIite opened this issue Jan 16, 2025 · 0 comments
Labels

Comments

@insoIite
Copy link

Hello there :)

Describe the bug

It seems firewall_group_id state is not correctly managed in vultr_instance resource.

I can successfully add a firewall_group_id to an instance (at creation, or after) but I can never unlink it.

To Reproduce


variable "disable_firewall_group_link" {
  description = "Does not link the instance to any firewall group"
  type        = bool
  default     = false
}

variable "firewall_group_to_link" {
  description = "Name of the firewall group the instance should be linked"
  type        = string
  default     = "instance-rules"
}

data "vultr_firewall_group" "instance_firewall_group" {
  count = var.disable_firewall_group_link ? 0 : 1
  filter {
    name   = "description"
    values = [var.firewall_group_to_link]
  }
}

# in vultr_instance resource

    firewall_group_id = var.disable_firewall_group_link ? null : data.vultr_firewall_group.instance_firewall_group[0].id

Expected behavior
I expect the instance to be unlinked from the firewall group when my boolean variable is set to true.

I also modified my module to have just

firewall_group_id = null

or even removing the attribute from the resource definition but the instance is never unlinked from the firewall_group.

plan Just show no changes.

@insoIite insoIite added the bug label Jan 16, 2025
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

1 participant