linode / terraform-provider-linode

Terraform Linode provider
https://www.terraform.io/docs/providers/linode/
Mozilla Public License 2.0
202 stars 97 forks source link

[Feature]: Add ability to update firewall rules #1606

Open iolesyk opened 1 month ago

iolesyk commented 1 month ago

Description

Terraform provider for Linode doesn't have ability to change existing Firewall.

Thank you.

New or Affected Terraform Resources

No response

Potential Terraform Configuration

resource "aws_security_group_rule" "example" {
  type              = "ingress"
  from_port         = 0
  to_port           = 65535
  protocol          = "tcp"
  cidr_blocks       = [aws_vpc.example.cidr_block]
  ipv6_cidr_blocks  = [aws_vpc.example.ipv6_cidr_block]
  security_group_id = "sg-123456"
}
zliang-akamai commented 1 month ago

Hi @iolesyk, thanks for the feature request!

Due to current API limitations, it's not easy for Terraform to directly change the firewall of a Linode instance.

If a firewall is not required during Linode instance booting time, you may you use linode_firewall_device resource to attach the Linode to the firewall, and then you can easily update the firewall in that resource.

On the other hand, if firewall coverage is required during Linode booting, we might have to look into a complicated way, for example, setting firewall_id in the linode_instance resource, and then remove that attribute and then import it to a linode_firewall_device resource.

The firewall rules can be updated within a linode_firewall resource, but be aware that there is a bug related to this operation that's being fixed in https://github.com/linode/terraform-provider-linode/pull/1605

github-actions[bot] commented 3 days ago

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days