How do I enable http traffic for GCE instance templates?

The default network in the project comes with default firewall rules "default-allow-http" and "default-allow-https" to allow traffic on port 80 and 443. These rules have a target tag setup as "http-server". When setting up the instance template you can check the box "Allow HTTP traffic" and "Allow HTTPS traffic" from your developer console, by doing that the default firewall rules will be applied to the new instances created through this instance template.


The following should work in theory, but in practice, it didn't work.

One potential solution is to enable http traffic for all of your instances in that project. To do so, from within GCE command line tools, run:

gcloud compute firewall-rules create FIREWALL_RULE --allow tcp:80

It's not clear to me that setting the rule for a particular instance template is possible, but hopefully someone will correct me if it is.