Manage Raff security groups (firewalls) with Terraform — named inbound/outbound rule sets you attach to VM NICs. Updates replace the entire rule set; reboot required for VMs to pick up new rules.
Updated May 10, 2026Manages a Raff security group — a named set of inbound/outbound rules that attach to VM NICs. A reboot is required for VMs to pick up rule changes inside the guest. Rules are nested blocks; updating the rule list replaces the entire set on the API side.
resource "raff_security_group" "web" { name = "web-public" template_id = "<web-server-template-uuid>"}
Templates copy a curated rule set at create time; you can then add explicit rule blocks to merge in extras. Get template IDs via raff security-group templates.
The API key needs security_group.create, security_group.manage, and security_group.delete in the project. The system role Project Admin grants all of these.
# Single security group by UUIDdata "raff_security_group" "web" { id = raff_security_group.web.id}# All security groups in the current projectdata "raff_security_groups" "all" {}