gcloud compute network-endpoint-groups update

NAME
gcloud compute network-endpoint-groups update - update a Compute Engine network endpoint group
SYNOPSIS
gcloud compute network-endpoint-groups updateNAME(--add-endpoint=[client-destination-port=CLIENT-DESTINATION-PORT],[fqdn=FQDN],[instance=INSTANCE],[ip=IP],[ipv6=IPV6],[port=PORT]    |--remove-endpoint=[client-destination-port=CLIENT-DESTINATION-PORT],[fqdn=FQDN],[instance=INSTANCE],[ip=IP],[ipv6=IPV6],[port=PORT])[--global    |--region=REGION    |--zone=ZONE][GCLOUD_WIDE_FLAG]
DESCRIPTION
Update a Compute Engine network endpoint group.
EXAMPLES
To add two endpoints to a network endpoint group:
gcloudcomputenetwork-endpoint-groupsupdatemy-neg--zone=us-central1-a--add-endpoint=instance=my-instance1,ip=127.0.0.1,port=1234--add-endpoint=instance=my-instance2

To remove two endpoints from a network endpoint group:

gcloudcomputenetwork-endpoint-groupsupdatemy-neg--zone=us-central1-a--remove-endpoint=instance=my-instance1,ip=127.0.0.1,port=1234--remove-endpoint=instance=my-instance2
POSITIONAL ARGUMENTS
NAME
Name of the network endpoint group to operate on.
REQUIRED FLAGS
These flags can be specified multiple times to add/remove multiple endpoints.

Exactly one of these must be specified:

--add-endpoint=[client-destination-port=CLIENT-DESTINATION-PORT],[fqdn=FQDN],[instance=INSTANCE],[ip=IP],[ipv6=IPV6],[port=PORT]
The network endpoint to add to the network endpoint group. Keys used depend onthe endpoint type of the NEG.

gce-vm-ip-port

*instance*-Nameofinstanceinsamezoneasthenetworkendpointgroup.
TheVMinstancemustbelongtothenetwork/subnetworkassociatedwiththenetworkendpointgroup.IftheVMinstanceisdeleted,thenanynetworkendpointgroupthathasareferencetoitisupdated.
*ip*-OptionalIPaddressofthenetworkendpoint.TheIPaddressmustbelongtoaVMincomputeengine(eithertheprimaryIPoraspartofanaliasedIPrange).IftheIPaddressisnotspecified,thentheprimaryIPaddressfortheVMinstanceinthenetworkthatthenetworkendpointgroupbelongstoisused.
*ipv6*-OptionalIPv6addressofthenetworkendpoint.TheIPv6addressmustbelongtoaVMincomputeengine(eithertheinternalorexternalIPv6address).
*port*-RequiredendpointportunlessNEGdefaultportisset.
*client-destination-port*-RequiredendpointclientdestinationportonlyfortheportmappingNEG.

internet-ip-port

*ip*-RequiredIPv4addressoftheendpointtoattach.Mustbepubliclyroutable.
*port*-Optionalportoftheendpointtoattach.Ifunspecified,theNEGdefaultportisset.Ifnodefaultportisset,thewell-knownportforthebackendprotocolisusedinstead(80forHTTP,443forHTTPS).

internet-fqdn-port

*fqdn*-Requiredfullyqualifieddomainnametousetolookupanexternalendpoint.MustberesolvabletoapublicIPaddressviapublicDNS.
*port*-Optionalportoftheendpointtoattach.Ifunspecified,theNEGdefaultportisset.Ifnodefaultportisset,thewell-knownportforthebackendprotocolisusedinstead(80forHTTP,443forHTTPSorHTTP2).
Example:`--add-endpoint="fqdn=backend.example.com,port=443"`

non-gcp-private-ip-port

*ip*-RequiredIPv4addressofthenetworkendpointtoattach.TheIPaddressmustbelongtoaVMnotinComputeEngineandmustberoutableusingaCloudRouteroverVPNoranInterconnectconnection.
*port*-RequiredportofthenetworkendpointtoattachunlesstheNEGdefaultportisset.

gce-vm-ip

*instance*-Requiredinstancenameinsamezoneasthenetworkendpointgroup.
TheVMinstancemustbelongtothenetwork/subnetworkassociatedwiththenetworkendpointgroup.IftheVMinstanceisdeleted,thenanynetworkendpointgroupthathasareferencetoitisupdated.
*ip*-OptionalIPaddressofthenetworkendpointtoattach.TheIPaddressmustbetheVM'snetworkinterfaceaddress.Ifnotspecified,theprimaryNICaddressisused.
--remove-endpoint=[client-destination-port=CLIENT-DESTINATION-PORT],[fqdn=FQDN],[instance=INSTANCE],[ip=IP],[ipv6=IPV6],[port=PORT]
The network endpoint to detach from the network endpoint group. Keys used dependon the endpoint type of the NEG.

gce-vm-ip-port

*instance*-Requirednameofinstancewhoseendpoint(s)todetach.IftheIPaddressisunset,allendpointsfortheinstanceintheNEGaredetached.
*ip*-OptionalIPv4addressofthenetworkendpointtodetach.Ifspecifiedportmustbeprovidedaswell.
*ipv6*-OptionalIPv6addressofthenetworkendpointtodetach.Ifspecifiedportmustbeprovidedaswell.
*port*-Optionalportofthenetworkendpointtodetach.
*client-destination-port*-Optionalclientdestinationport,onlyforportmappingNEGs.

internet-ip-port

*ip*-RequiredIPv4addressofthenetworkendpointtodetach.
*port*-Optionalportofthenetworkendpointtodetachiftheendpointhasaportspecified.

internet-fqdn-port

*fqdn*-Requiredfullyqualifieddomainnameoftheendpointtodetach.
*port*-Optionalportofthenetworkendpointtodetachiftheendpointhasaportspecified.

non-gcp-private-ip-port

*ip*-RequiredIPv4addressofthenetworkendpointtodetach.
*port*-RequiredportofthenetworkendpointtodetachunlessNEGdefaultportisset.

gce-vm-ip

*instance*-Requirednameofinstancewithendpointstodetach.IftheIPaddressisunset,allendpointsfortheinstanceintheNEGaredetached.
*ip*-OptionalIPaddressofthenetworkendpointtoattach.TheIPaddressmustbetheVM's network interface'sprimaryIPaddress.Ifnotspecified,theprimaryNICaddressisused.
OPTIONAL FLAGS
At most one of these can be specified:
--global
If set, the network endpoint group is global.
--region=REGION
Region of the network endpoint group to operate on. If not specified, you mightbe prompted to select a region (interactive mode only).

To avoid prompting when this flag is omitted, you can set thecompute/region property:

gcloudconfigsetcompute/regionREGION

A list of regions can be fetched by running:

gcloudcomputeregionslist

To unset the property, run:

gcloudconfigunsetcompute/region

Alternatively, the region can be stored in the environment variableCLOUDSDK_COMPUTE_REGION.

--zone=ZONE
Zone of the network endpoint group to operate on. If not specified and thecompute/zone property isn't set, you mightbe prompted to select a zone (interactive mode only).

To avoid prompting when this flag is omitted, you can set thecompute/zone property:

gcloudconfigsetcompute/zoneZONE

A list of zones can be fetched by running:

gcloudcomputezoneslist

To unset the property, run:

gcloudconfigunsetcompute/zone

Alternatively, the zone can be stored in the environment variableCLOUDSDK_COMPUTE_ZONE.

GCLOUD WIDE FLAGS
These flags are available to all commands:--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.

NOTES
These variants are also available:
gcloudalphacomputenetwork-endpoint-groupsupdate
gcloudbetacomputenetwork-endpoint-groupsupdate

Except as otherwise noted, the content of this page is licensed under theCreative Commons Attribution 4.0 License, and code samples are licensed under theApache 2.0 License. For details, see theGoogle Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.

Last updated 2025-07-22 UTC.