gcloud compute 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] [--organization=ORGANIZATION] [--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-resources=[TARGET_RESOURCES,…]] [--target-secure-tags=[TARGET_SECURE_TAGS,…]] [--target-service-accounts=[TARGET_SERVICE_ACCOUNTS,…]] [--[no-]tls-inspect] [GCLOUD_WIDE_FLAG …]
gcloud compute firewall-policies rules update is used to update
organization firewall policy rules.
gcloud compute firewall-policies rules update 10 --firewall-policy=123456789 --action=allow --description=new-example-rulePRIORITY--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. Cannot be specified when the source network
context is NON_INTERNET.
--dest-threat-intelligence=[DEST_THREAT_INTELLIGENCE_LISTS,…]egress. Cannot be specified when source
network context is NON_INTERNET. 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--organization=ORGANIZATION--security-profile-group=SECURITY_PROFILE_GROUPgcloud CLI will create a reference
matching format "a", but to make it work
CLOUDSDK_API_ENDPOINT_OVERRIDES_NETWORKSECURITY property must be set. In order
to set this property, please run the command gcloud config set
api_endpoint_overrides/networksecurity https://<namespace>/.
--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. Cannot be specified when the source network context is
NON_INTERNET, VPC_NETWORK or INTRA_VPC.
--src-threat-intelligence=[SOURCE_THREAT_INTELLIGENCE_LISTS,…]ingress. Cannot be specified when the source
network context is NON_INTERNET, VPC_NETWORK or INTRA_VPC. The available lists
can be found here: https://cloud.google.com/vpc/docs/firewall-policies-rule-details#threat-intelligence-fw-policy.
--target-resources=[TARGET_RESOURCES,…]--target-service-accounts=[TARGET_SERVICE_ACCOUNTS,…]--[no-]tls-inspect--tls-inspect to enable and
--no-tls-inspect to disable.
--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 firewall-policies rules updategcloud beta compute firewall-policies rules updategcloud preview compute 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.