gcloud compute network-firewall-policies rules update PRIORITY --firewall-policy=FIREWALL_POLICY [--action=ACTION] [--description=DESCRIPTION] [--dest-address-groups=[DEST_ADDRESS_GROUPS,…]] [--dest-fqdns=[DEST_FQDNS,…]] [--dest-ip-ranges=[DEST_IP_RANGE,…]] [--dest-network-context=DEST_NETWORK_CONTEXT] [--dest-region-codes=[DEST_REGION_CODES,…]] [--dest-threat-intelligence=[DEST_THREAT_INTELLIGENCE_LISTS,…]] [--direction=DIRECTION] [--[no-]disabled] [--[no-]enable-logging] [--layer4-configs=[LAYER4_CONFIG,…]] [--new-priority=NEW_PRIORITY] [--security-profile-group=SECURITY_PROFILE_GROUP] [--src-address-groups=[SOURCE_ADDRESS_GROUPS,…]] [--src-fqdns=[SOURCE_FQDNS,…]] [--src-ip-ranges=[SRC_IP_RANGE,…]] [--src-network-context=SRC_NETWORK_CONTEXT] [--src-networks=[SRC_NETWORKS,…]] [--src-region-codes=[SOURCE_REGION_CODES,…]] [--src-secure-tags=[SOURCE_SECURE_TAGS,…]] [--src-threat-intelligence=[SOURCE_THREAT_INTELLIGENCE_LISTS,…]] [--target-forwarding-rules=[TARGET_FORWARDING_RULES,…]] [--target-secure-tags=[TARGET_SECURE_TAGS,…]] [--target-service-accounts=[TARGET_SERVICE_ACCOUNTS,…]] [--target-type=TARGET_TYPE] [--[no-]tls-inspect] [--firewall-policy-region=FIREWALL_POLICY_REGION | --global-firewall-policy] [GCLOUD_WIDE_FLAG …]
gcloud compute network-firewall-policies rules update is used to
update network firewall policy rules.
10 in a
global network firewall policy with name
my-policy to change the action to
allow and description to
new example rule, run:
gcloud compute network-firewall-policies rules update 10 --firewall-policy=my-policy --action=allow --description="new example rule"PRIORITY--firewall-policy=FIREWALL_POLICY--action=ACTIONACTION must be one of: allow,
deny, goto_next,
apply_security_profile_group.
--description=DESCRIPTION--dest-address-groups=[DEST_ADDRESS_GROUPS,…]--dest-fqdns=[DEST_FQDNS,…]egress.
--dest-ip-ranges=[DEST_IP_RANGE,…]--dest-network-context=DEST_NETWORK_CONTEXT--dest-region-codes=[DEST_REGION_CODES,…]egress.
--dest-threat-intelligence=[DEST_THREAT_INTELLIGENCE_LISTS,…]egress. The available lists can be found
here: https://cloud.google.com/vpc/docs/firewall-policies-rule-details#threat-intelligence-fw-policy.
--direction=DIRECTIONDIRECTION must be one of:
INGRESS, EGRESS.
--[no-]disabled--disabled to enable and --no-disabled to disable.
--[no-]enable-logging--enable-logging to enable and
--no-enable-logging to disable.
--layer4-configs=[LAYER4_CONFIG,…]--new-priority=NEW_PRIORITY--security-profile-group=SECURITY_PROFILE_GROUP--src-address-groups=[SOURCE_ADDRESS_GROUPS,…]--src-fqdns=[SOURCE_FQDNS,…]ingress.
--src-ip-ranges=[SRC_IP_RANGE,…]--src-network-context=SRC_NETWORK_CONTEXT--src-networks=[SRC_NETWORKS,…]--src-region-codes=[SOURCE_REGION_CODES,…]ingress.
--src-threat-intelligence=[SOURCE_THREAT_INTELLIGENCE_LISTS,…]ingress. The available lists can be found here: https://cloud.google.com/vpc/docs/firewall-policies-rule-details#threat-intelligence-fw-policy.
--target-forwarding-rules=[TARGET_FORWARDING_RULES,…]--target-service-accounts=[TARGET_SERVICE_ACCOUNTS,…]--target-type=TARGET_TYPETARGET_TYPE must be one of: INSTANCES,
INTERNAL_MANAGED_LB.
--[no-]tls-inspect--tls-inspect to enable and
--no-tls-inspect to disable.
--firewall-policy-region=FIREWALL_POLICY_REGIONcompute/region property value for this command invocation.
--global-firewall-policy--access-token-file,
--account, --billing-project,
--configuration,
--flags-file,
--flatten, --format, --help, --impersonate-service-account,
--log-http,
--project, --quiet, --trace-token, --user-output-enabled,
--verbosity.
Run $ gcloud help for details.
gcloud alpha compute network-firewall-policies rules updategcloud beta compute network-firewall-policies rules updategcloud preview compute network-firewall-policies rules update
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2026-05-27 UTC.