terraform-provider-hcloud icon indicating copy to clipboard operation
terraform-provider-hcloud copied to clipboard

[Feature]: Allow hcloud_firewall.source_ips without suffix

Open Niecke opened this issue 1 year ago • 2 comments

What whould you like to see?

Right now, it is only possible to provide source_ips for the hcloud_firewall object in the form of 1.1.1.1/32. It would be helpful to be able to provide only the ip and skip the suffix.

I tried to give ssh access from one single server that was also created with terraform and the best solution I came up with was the following:

resource "hcloud_firewall" "master_firewall" {
  name = "master-firewall"

  rule {
    direction = "in"
    protocol  = "tcp"
    port      = "22"
    source_ips = [
      format("%s/%s",hcloud_server.management.ipv4_address,"32")
    ]
  }
}

Niecke avatar Feb 20 '23 19:02 Niecke

This issue has been marked as stale because it has not had recent activity. The bot will close the issue if no further action occurs.

github-actions[bot] avatar Oct 10 '23 12:10 github-actions[bot]

This is a useful addition and we are open to accepting PRs for this :)

apricote avatar Oct 12 '23 11:10 apricote