Skip to main content

firewall_rules

Creates, updates, deletes, gets or lists a firewall_rules resource.

Overview

Namefirewall_rules
TypeResource
Iddigitalocean.compute.firewall_rules

Fields

The following fields are returned by SELECT queries:

SELECT not supported for this resource, use SHOW METHODS to view available operations for the resource.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
firewalls_add_rulesinsertfirewall_idTo add additional access rules to a firewall, send a POST request to
/v2/firewalls/$FIREWALL_ID/rules. The body of the request may include an
inbound_rules and/or outbound_rules attribute containing an array of rules to
be added.

No response body will be sent back, but the response code will indicate
success. Specifically, the response code will be a 204, which means that the
action was successful with no returned body data.
firewalls_delete_rulesdeletefirewall_idTo remove access rules from a firewall, send a DELETE request to
/v2/firewalls/$FIREWALL_ID/rules. The body of the request may include an
inbound_rules and/or outbound_rules attribute containing an array of rules
to be removed.

No response body will be sent back, but the response code will indicate
success. Specifically, the response code will be a 204, which means that the
action was successful with no returned body data.

Parameters

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
firewall_idstring (uuid)A unique ID that can be used to identify and reference a firewall. (example: bb4b2611-3d72-467b-8602-280330ecd65c)

INSERT examples

To add additional access rules to a firewall, send a POST request to
/v2/firewalls/$FIREWALL_ID/rules. The body of the request may include an
inbound_rules and/or outbound_rules attribute containing an array of rules to
be added.

No response body will be sent back, but the response code will indicate
success. Specifically, the response code will be a 204, which means that the
action was successful with no returned body data.

INSERT INTO digitalocean.compute.firewall_rules (
data__inbound_rules,
data__outbound_rules,
firewall_id
)
SELECT
'{{ inbound_rules }}',
'{{ outbound_rules }}',
'{{ firewall_id }}'
;

DELETE examples

To remove access rules from a firewall, send a DELETE request to
/v2/firewalls/$FIREWALL_ID/rules. The body of the request may include an
inbound_rules and/or outbound_rules attribute containing an array of rules
to be removed.

No response body will be sent back, but the response code will indicate
success. Specifically, the response code will be a 204, which means that the
action was successful with no returned body data.

DELETE FROM digitalocean.compute.firewall_rules
WHERE firewall_id = '{{ firewall_id }}' --required;