Add a firewall rule
civo_create_firewall_ruleAdd one rule to a firewall — e.g. allow TCP 443 ingress from 0.0.0.0/0. This changes what is reachable on every instance, cluster and load balancer using the firewall, so prefer narrow CIDRs. Undo by deleting the rule in the Civo dashboard or CLI. Civo: POST /v2/firewalls/{id}/rules.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| cidr | No | Source (ingress) or destination (egress) CIDRs. Civo defaults to 0.0.0.0/0 — the whole internet. | |
| label | No | A display name for the rule. | |
| action | No | allow (default) or deny. | |
| region | No | Region code, e.g. LON1, NYC1, FRA1, PHX1 (see civo_list_regions). Defaults to CIVO_REGION; Civo resources are regional, so pass the region the resource lives in. | |
| end_port | No | Last port of a range. Omit for a single port. | |
| protocol | Yes | tcp, udp or icmp. | |
| direction | No | ingress (default) or egress. | |
| start_port | No | First port, e.g. "443". Required unless protocol is icmp. | |
| firewall_id | Yes | The firewall's id (a UUID). |