---
title: "ezgh compute firewalls rules replace"
description: "Replace a firewall's rules with a file's."
---

> Documentation Index
> Fetch the complete documentation index at: https://docs.ezghcloud.com/llms.txt
> Use this file to discover all available pages before exploring further.

# ezgh compute firewalls rules replace

{/* Generated by ezgh-cli's internal/tools/clidocs from the ezgh command tree. Don't edit: change the command's help in ezgh-cli and regenerate. */}

```sh
ezgh compute firewalls rules replace <firewall> -f rules.json [flags]
```

Make a firewall's rules exactly a file's (0 to 200; a file, or - for stdin): a JSON array of rules, an object with "rules", or a firewall as `ezgh compute firewalls get <firewall> -o json` prints it (rule IDs and creation times are ignored). A rule the firewall already has keeps its ID.

Part of [`ezgh compute firewalls rules`](/cli/reference/compute-firewalls-rules).

## Examples

```sh
ezgh compute firewalls get web -o json > web.json   # edit web.json's rules
ezgh compute firewalls rules replace web -f web.json
```

## Flags

| Flag | Type | Default | Description |
| --- | --- | --- | --- |
| `-f`, `--file` | string |  | the rules: a JSON file, or - for stdin |

This command also takes the [global flags](/cli/reference#global-flags).

Source: https://docs.ezghcloud.com/cli/reference/compute-firewalls-rules-replace/index.mdx
