doctl Verified current stable Not installed? Documentation

Doctl / Remove Database Firewall Rule

Remove Database Firewall Rule

Remove a specific firewall rule from a database in DigitalOcean's Databases service.

$
Terminal
doctl {d|databases} {fw|firewalls} {rm|remove} {database_id} {rule_uuid}

When To Use

When deprecating outdated or insecure rules to maintain compliance.

Pro Tip

Use caution; removal of active rules can disrupt services depending on your architecture.

Warning

Destructive operation. Confirm the target path and keep a backup before executing.

Terminal Output

Expected runtime feedback

Simulated preview
>
Output
Removing firewall rule...

Rule UUID: 123e4567-e89b-12d3-a456-426614174000
Database ID: db-abc123

Success: Firewall rule removed.

Current firewall rules:
+----------------------+----------------------+----------------------+---------------------+
|        Rule ID      |      IP Address      |        Type          |      Created At     |
+----------------------+----------------------+----------------------+---------------------+
| 123e4567-e89b-12d3-a456-426614174001 | 192.0.2.1          |  Allow               | 2023-10-01 12:00:00 |
| 123e4567-e89b-12d3-a456-426614174002 | 203.0.113.5        |  Allow               | 2023-10-02 12:00:00 |
+----------------------+----------------------+----------------------+---------------------+

Anatomy of Output

Understanding the result

Rule removed: 123456 Removed Rule ID

Identifier for the deleted rule.

Total rules now: 5 Remaining Rule Count

Total rules available post-deletion.

Status: success Operation Status

Indicates successful execution.

Troubleshooting

Common pitfalls

Error: Rule UUID not found.

Solution: Verify that the UUID for the rule is correct.

Error: Cannot remove active rule.

Solution: Ensure the rule is inactive before deleting.

Error: Database ID not valid.

Solution: Check the provided database ID for accuracy.

Command Breakdown

What each part is doing

doctl
Base Command
The executable that performs this operation. Here it runs Doctl before the shell applies any redirect operators.

How To Run

Execution path

  1. Step 1

    Identify the database ID and rule UUID to remove.

  2. Step 2

    Run the command: doctl databases fw rm {database_id} {rule_uuid}.

  3. Step 3

    Verify removal by listing current firewall rules.

Alternative Approaches

Comparable commands in other tools

Alternative documentation tools for the same job.