0

I checked the [documentation][1]

[1]: https://cloud.google.com/compute/docs/reference/rest/v1/firewalls and what I saw is that whether allow or deny, you can only specify ports and protocol but not "allow all" like what you can do in the portal?

Dean Christian Armada
  • 6,724
  • 9
  • 67
  • 116

1 Answers1

1

Using the Deployment Manager, you can create a firewall rule to allow/deny traffic on all protocols/ports for example like this:

resources:
- name: a-firewall-rule
  type: compute.v1.firewall
  properties:
    sourceRanges: ["0.0.0.0/0"]
    allowed:
    - IPProtocol: all

I've tested it on my side and it does work like "Allow all" in the Dev Console, although it isn't properly documented here. I'll file a documentation update request to mention that the "all" value is actually accepted.

LundinCast
  • 9,412
  • 4
  • 36
  • 48