allow a port on gcp compute engine code example

Example 1: allow a port on gcp compute engine

Go to cloud.google.com
Go to my Console
Choose your Project
Choose Networking > VPC network
Choose "Firewalls rules"
Choose "Create Firewall Rule"
To apply the rule to select VM instances,
select Targets > "Specified target tags",
and enter into "Target tags" the name of the tag.
This tag will be used to apply the new firewall rule onto 
		whichever instance you'd like. 
Then, make sure the instances have the network tag applied.
To allow incoming TCP connections to port for example 9090
		in "Protocols and Ports" enter tcp:9090
Click Create
You can use your desired port happily.

Example 2: how to open a port in gcp

gcloud compute firewall-rules create <rule-name> --allow tcp:9090 --source-tags=<list-of-your-instances-names> --source-ranges=0.0.0.0/0 --description="<your-description-here>"

Tags:

Misc Example