News:

SMF - Just Installed!

Main Menu

How to Manage Vultr Firewall Groups

Started by Suhitha, Sep 30, 2025, 07:44 AM

Previous topic - Next topic

Suhitha

Question: How to Manage Vultr Firewall Groups


A feature that allows you to organize and manage multiple resources collectively for easier administration and access control.

Vultr Firewall groups enable the creation and application of network filtering rules that apply to attached instances. A firewall group can consist of multiple rules that filter IPv4 and IPv6 network traffic when attached to an instance.

Follow this guide to manage Vultr Firewall groups using the Vultr Customer Portal, API, CLI, or Terraform.


Vultr Customer Portal

1.Navigate to Products, expand the Network drop-down and select Firewall from the list of options.

2.Select your target firewall group to manage it.


Vultr API

1.Send a GET request to the List Firewall Groups endpoint to view all firewall groups in your Vultr account.

console


$ curl "https://api.vultr.com/v2/firewalls" \
  -X GET \
  -H "Authorization: Bearer ${VULTR_API_KEY}"


Vultr CLI

1.List all firewall groups in your Vultr account.

console


$ vultr-cli firewall group list


Terraform

1.Open your Terraform configuration for the existing Firewall groups.

2.Add or update a vultr_firewall_group with example rules, then apply.

terraform


resource "vultr_firewall_group" "default" {
    description = "default-fw"
}

resource "vultr_firewall_rule" "allow_http" {
    firewall_group_id = vultr_firewall_group.default.id
    protocol          = "tcp"
    port              = "80"
    ip_type           = "v4"
    subnet            = "0.0.0.0"
    subnet_size       = 0
    notes             = "Allow HTTP"
}

resource "vultr_firewall_rule" "allow_https" {
    firewall_group_id = vultr_firewall_group.default.id
    protocol          = "tcp"
    port              = "443"
    ip_type           = "v4"
    subnet            = "0.0.0.0"
    subnet_size       = 0
    notes             = "Allow HTTPS"
}

3.Apply the configuration and observe the following output:

Apply complete! Resources: 3 added, 0 changed, 0 destroyed.