Actions111
- Action Actions
- Certificate Actions
- Datacenter Actions
- Firewall Actions
- Floating IP Actions
- Image Actions
- ISO Actions
- Load Balancer Actions
- Load Balancer Type Actions
- Location Actions
- Network Actions
- Placement Group Actions
- Pricing Actions
- Primary IP Actions
- Server Actions
- Server Type Actions
- SSH Key Actions
- Volume Actions
Firewall → Create
AI-generatedSummary
Creates a new Hetzner Cloud firewall via POST /v1/firewalls with a name, optional rules array, and optional extra body fields, returning the API's create response.
Inputs
- Name (required) — Unique name for the firewall (sent as body
name). - Rules (JSON) — JSON array of firewall rules, e.g. [{"direction":"in","protocol":"tcp","port":"443","source_ips":["0.0.0.0/0","::/0"]}]. Defaults to []. Set as body
rules; invalid JSON raises an error. - Additional Body Fields (JSON) — JSON object merged into the request body for fields not exposed in the UI (e.g. labels, apply_to). Explicitly set fields such as name and rules take precedence over keys with the same name. Invalid JSON raises an error.
- Request Options — Node-level settings: batching (items per batch, interval), ignore SSL issues, proxy, and timeout (default 10000 ms).
Output shape
The raw JSON response from the Hetzner API for the create call, with no root-property unwrapping. This normally contains a firewall object (id, name, rules, labels, applied_to) and an actions array.
Unlike Get/Update, the response is not unwrapped, so the data sits under
firewallandactionskeys. Authentication uses the hetznerCloudApi credential. Errors from the API (e.g. duplicate name, invalid rules) are surfaced as node errors.
Examples
Example 1: Create a firewall allowing public HTTPS inbound
Name: web-firewall; Rules (JSON): [{"direction":"in","protocol":"tcp","port":"443","source_ips":["0.0.0.0/0","::/0"]}]
Example 2: Create a labeled firewall that auto-applies to servers by label
Name: prod-fw; Additional Body Fields: {"labels":{"env":"prod"},"apply_to":[{"type":"label_selector","label_selector":{"selector":"env=prod"}}]}