ALTER NETWORK POLICY
Modifies an existing network policy in TiDB Cloud Lake.
Syntax
ALTER NETWORK POLICY [ IF EXISTS ] <policy_name>
SET [ ALLOWED_IP_LIST = ('allowed_ip1', 'allowed_ip2', ...) ]
[ BLOCKED_IP_LIST = ('blocked_ip1', 'blocked_ip2', ...) ]
[ COMMENT = 'comment' ]
Examples
-- Modify the network policy test_policy to change the blocked IP address list from ('192.168.1.99') to ('192.168.1.10'):
ALTER NETWORK POLICY test_policy SET BLOCKED_IP_LIST=('192.168.1.10')
-- Update the network policy test_policy to allow IP address ranges ('192.168.10.0', '192.168.20.0') and remove any blocked IP address restrictions. Also, change the comment to 'new comment':
ALTER NETWORK POLICY test_policy SET ALLOWED_IP_LIST=('192.168.10.0', '192.168.20.0') BLOCKED_IP_LIST=() COMMENT='new comment'