To add a new forwarding rule, you can use the gcloud compute forwarding-rules create command or create a HTTP POST request to the Forwarding Rules collection.
An example of creating a forwarding rule to a target instance using the gcloud command-line tool is:
gcloud compute forwarding-rules create [FORWARDING_RULE] \
--load-balancing-scheme internal | external \
--region [REGION] \
[--target-instance-zone [ZONE]] \
--ip-protocol TCP --ports 80 \
--target-instance [TARGET_INSTANCE]
If you omit the --target-instance-zone flag, the gcloud command-line tool prompts you to choose a zone if you did not set the compute/zone property with gcloud config set compute/zone.
The gcloud compute forwarding-rules create command supports setting a target instance as a target when the load balancing scheme is internal.