Skip to main content
Allow rules let you lock down a database so that only connections from specific sources are accepted. You can restrict by IP address or CIDR range, by AWS VPC endpoint ID, or both at the same time.
AND semantics. When both lists are configured, a connection must satisfy both rules: the client IP must be on the allowed-IP list and the connection must arrive through one of the allowed VPC endpoints.

Show Current Rules

If no rules are configured, all connections are accepted:
When rules are set, the command prints each list:

Restrict by IP Address or CIDR

Use --ip (repeatable) to set the list of allowed IP addresses and CIDR blocks. The flag replaces the current list each time it is used.
Both IPv4 and IPv6 addresses are accepted. CIDR notation (e.g. 10.0.0.0/8) is supported for ranges.

Restrict by AWS VPC Endpoint

Use --aws-vpc (repeatable) to set the list of allowed AWS VPC endpoint IDs. IDs must start with vpce-.

Combine IP and VPC Rules

You can set both lists in a single command. Connections must satisfy both constraints.
A later call that only specifies --ip leaves the VPC list unchanged, and vice versa:

Clear Rules

Remove all allow rules to allow connections from any source:
Clear only one list while leaving the other intact:

API

Allow rules are managed through the database configuration endpoint. Set allowed_ips and/or allowed_aws_vpc_ids in the request body:
Pass an explicit empty array to clear a list:
Omitting a field from the request body leaves that list unchanged.