title: How to enable Allow HTTP traffic / Allow HTTP traffic on Google Compute Engine with terraform
body: <p>Is there any other way to enable these rules directly with terraform without having to create a separate firewall rule in GCP and then attaching tags to compute engine</p>
  <p><a href="https://i.stack.imgur.com/G1g0y.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/G1g0y.jpg" alt="enter image description here" /></a></p>
  <p>Currently I am doing this way</p>
  <pre><code>resource &quot;google_compute_firewall&quot; &quot;allow_http&quot; {
    name    = &quot;allow-http-rule&quot;
    network = &quot;default&quot;
    allow {
      ports    = [&quot;80&quot;]
      protocol = &quot;tcp&quot;
    }
    target_tags = [&quot;allow-http&quot;]
    priority    = 1000
  
  }
  </code></pre>
  <p>and then use this tag in</p>
  <pre><code>resource &quot;google_compute_instance&quot; &quot;app&quot; {
    ...
    tags = [&quot;allow-http&quot;]
  }
  </code></pre>